contTable with stacked bar charts
Posted: Sat Apr 09, 2022 9:46 pm
Hi all!
I am teaching Jamovi in a Bachelor's seminar and I have my students reproduce their analysis in R.
I did that for the contTables (i.e., Chi-square) and encountered a problem, but I don't know if this is unique to my computer or a general issue:
This code should produce a a crosstab and it works in both Jamovi and R:
jmv::contTables(
formula = ~ var1:var2,
data = data,
odds = TRUE,
pcRow = TRUE)
This code should produce a stacked bar chart along with all other info:
jmv::contTables(
formula = ~ var1:var2,
data = data,
odds = TRUE,
pcRow = TRUE,
barplot = TRUE,
yaxis = "ypc",
yaxisPc = "row_pc",
bartype = "stack")
It does so in jamovi, but in R, it tells me:
Error in app$vspace(new_style$`margin-top` %||% 0) :
attempt to apply non-function
In some cases, one has to be specific about whether the variable is "numeric" or a "factor", but this did not solve the issue in that case.
Let me know, if you know a solution to that.
Thank you so much!
Hilmar
PS: Jamovi is amazing and you guys (Jonathon et al) did a great job!
I am teaching Jamovi in a Bachelor's seminar and I have my students reproduce their analysis in R.
I did that for the contTables (i.e., Chi-square) and encountered a problem, but I don't know if this is unique to my computer or a general issue:
This code should produce a a crosstab and it works in both Jamovi and R:
jmv::contTables(
formula = ~ var1:var2,
data = data,
odds = TRUE,
pcRow = TRUE)
This code should produce a stacked bar chart along with all other info:
jmv::contTables(
formula = ~ var1:var2,
data = data,
odds = TRUE,
pcRow = TRUE,
barplot = TRUE,
yaxis = "ypc",
yaxisPc = "row_pc",
bartype = "stack")
It does so in jamovi, but in R, it tells me:
Error in app$vspace(new_style$`margin-top` %||% 0) :
attempt to apply non-function
In some cases, one has to be specific about whether the variable is "numeric" or a "factor", but this did not solve the issue in that case.
Let me know, if you know a solution to that.
Thank you so much!
Hilmar
PS: Jamovi is amazing and you guys (Jonathon et al) did a great job!