R svyby gives error but svytotal works

Home / r / R svyby gives error but svytotal works

Question:
I am creating descriptive statistic of a dataset and when I run the following it works
svytotal(~interaction(w4_prov2011,w4_c_grcurtyp),design=LFCP4.W,na.rm=TRUE)
but the following gives an error
svyby(~w4_c_grcurtyp,~w4_prov2011,design=LFCP4.W,svytotal,na.rm=TRUE)

Error in tapply(1:NROW(x), list(factor(strata)), function(index) { :arguments must have same length

Is that possible?


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *