s-news
[Top] [All Lists]

survey library

To: s-plus news <s-news@lists.biostat.wustl.edu>
Subject: survey library
From: jose Bartolomei <surfprjab@hotmail.com>
Date: Fri, 13 Jun 2008 18:18:41 +0000
Importance: Normal
 
 

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!
<Prev in Thread] Current Thread [Next in Thread>
  • survey library, jose Bartolomei <=