I am trying to analyse a multiple response question. I am using a weighted dataset. Something using survey, srvey or the tidyverse would be great.
ID <- c(1,2,3,4,5,6,7,8,9,10)
rent_income <- c(1, 1, 0, 1, 0, 1, 0, 1, 0, 0)
salary_income <- c( 0, 1, 0, 1, 0, 1, 1, 0, 1, 0)
other_income <- c( 0, 1, 0, 0, 0, 0, 1, 0, 0, 0)
survey_weights <- c(0.8, 0.8 , 0.8 , 0.8 , 0.8 , 1.2 , 1.2 , 1.2 , 1.2 , 1.2)
df<-data.frame(ID, rent_income, salary_income, other_income, survey_weights)
Weighted dataset:
weighted_dataset <- data %>% as_survey_design(ids=ID, weights=survey_weights)
I am aware that this question is similar to this previous one (Multiple response analysis in weighted survey data using srvyr), but that response did not in any way answer the question. I would think that this is a pretty common issue in survey analysis so hopefully someone has an answer.
Expected answer: Some sort of code that will allow me to produce a table with weighted frequencies and weighted case proportions.
Thanks