The sample for a survey I am analysing was not selected randomly and so I need to apply a vector of weights to make the findings representative of the population. I have used wtd.table()
(from gmodels) successfully to create frequency tables but now want to create a contingency table to compare two categorical variables and conduct a Chi-sqrd test. I'm struggling to find the right function. The svytable()
function in the survey
package sounds promising but I don't see where I should input the weight vector. I'm new to R. Could anyone explain how to use svytable()
or suggest an alternative?
Asked
Active
Viewed 628 times
3
-
type ?svytable for some examples. for more examples, play with the public use survey microdata syntax at http://github.com/ajdamico/usgsd – Anthony Damico Apr 12 '15 at 11:46