I am working with some SPSS data currently and making some contingency tables using the survey package.
I want to be able to make weighted survey cross tables using the standard Pearson Chi Sq tests, and not the Rao Scott second order adjusted ones. In part this is for comparison purposes, but also to be able to replicate previous SPSS tables that do not use the correct adjusted test.
data <- read_sav("data.sav")
tab <- data %>%
haven::as_factor() %>%
survey::svydesign(id=~1, weights=~w, data = .) %>%
tbl_svysummary(by=var1, include = c(var2,var3,var4)) %>%
add_p()
tab
the above will give me the Rao Scott, is there a way to "force" unadjusted Chi Square and keep using the weighted data?
I tried this and it didn't work:
data <- read_sav("data.sav")
tab <- data %>%
haven::as_factor() %>%
survey::svydesign(id=~1, weights=~w, data = .) %>%
tbl_svysummary(by=var1, include = c(var2,var3,var4)) %>%
add_p(test = all_categorical() ~ svychisq, method = "Chisq", adjust = FALSE)
tab
the error i got was:
`...` must be empty.
✖ Problematic arguments:
• method = "Chisq"
• adjust = FALSE