contingency table

I have troubles with these codes:

addmargins(Base_1$dev_bed, Base_1$education)
sjt.xtab(Base_1$dev_bed, Base_1$education)

The console shows:

addmargins(Base_1$dev_bed, Base_1$education)
Error in addmargins(Base_1$dev_bed, Base_1$education) :
'A' must be an array or table
sjt.xtab(Base_1$dev_bed, Base_1$education)
Error in sjt.xtab(Base_1$dev_bed, Base_1$education) :
could not find function "sjt.xtab"

Also, when I try activate sjPlot, the console shows:

library(sjPlot)
Error: package or namespace load failed for ‘sjPlot’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘xfun’

Hi.

Try installing the package xfun first, then installing sjPlot.

'A' must be an array or table

Perhaps a reproducible example would help.

You should be able to fix the problem with loading the sjPlot package by running

install.packages("xfun")

The problem with addmargins() is that, as the message says, it expects an array or table as the first argument and you are passing it two vectors. What are you trying to do at that step?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.