Dear S/R users,
I am conducting the following procedure using the survey library
attach(BRFSS.04)
options(survey.lonely.psu = "fail")
BRFSS.04.svy<-svydesign(ids=~0, strata=~STSTR.factor, weights=~FINALWT,
data="">
BRFSS.04.svy<-as.svydesign2(BRFSS.04.svy)
summary(BRFSS.04.svy)
svyby(~factor(ASTHMA2), ~SEX, BRFSS.04.svy, svymean, vartype=c("se"))
the correct result is display.
Nevertheless, when testing with other variables, such as MARITAl;
svyby(~factor(ASTHMA2), ~MARITAL, BRFSS.04.svy, svymean, vartype=c("se"))
an error messages is display.
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 7, 1
In addition: Warning messages:
1: In onestrat(x[index, , drop = FALSE], clusters[index], nPSU[index][1], :
Stratum (72051) has only one PSU at stage 1
2: In onestrat(x[index, , drop = FALSE], clusters[index], nPSU[index][1], :
Stratum (72081) has only one PSU at stage 1
Can someone help me interpret the message error?
I have check the data.frame and parameters among others but do not get to the solution.
Thanks in advance,
Jose
Search that pays you back! Introducing Live Search cashback. Search Now!
|