I am analysing survey data. Since my demographic categories are discrete I can summarise responses within demographics using prop.table
. However, I would also like to be able to summarise responses using survey weights. How do I do that?
1 Answer
$\begingroup$
$\endgroup$
The survey package is your friend.
See the functions svyby
and svymean
for some nice examples. Note that you have to specify the survey design via svydesign
, which takes the weights as an argument, before applying the other functions.
Hope this helps!