[R] survey weights
kerbo2004 at yahoo.com
Sun Sep 4 20:45:46 CEST 2005
That worked. Many thanks, Thomas.
--- Thomas Lumley <tlumley at u.washington.edu> wrote:
> On Sun, 4 Sep 2005, A Das wrote:
> > Just: "missing values in object". That would imply
> > object was created. But then I write "dchina", and
> > says "object dchina not found".
> No, it would not imply the object was created. If
> it was an error message
> (rather than a warning) the object would not have
> been created.
> I presume the full message was
> Error in na.fail.default(object) : missing values
> in object
> If so, it sounds as though you have missing values
> in the id, weights, or
> strata variable.
> will verify this.
> Stata will just have dropped these observations (use
> -svydes- to verify
> this). If you want to drop the observations in R
> you need to do this
> explicitly. Having missing data may be unavoidable,
> but if you have
> observations in a sample it seems that you should
> know how they were
> To drop these observations you could use
> obsChina <- subset(China, !is.na(psu) &
> !is.na(strata) & !is.na(weight0x))
> and then use obsChina rather than China in the
> svydesign() function.
> > -Bobby
> > --- Thomas Lumley <tlumley at u.washington.edu>
> >> On Sun, 4 Sep 2005, A Das wrote:
> >>> Thanks, Thomas.
> >>> Yes, that's exactly what happened: the
> >>> came first after "data(China)", and then after
> >>> "dchina<-svydesign..." So the design object
> >>> being produced? The dataset is very large, and
> >>> weights were already set in Stata before
> >> importing.
> >>> Would either of those cause problems?
> >> Probably not. What was the error message from
> >> svydesign()? That is what
> >> will say what went wrong.
> >> -thomas
> > Start your day with Yahoo! - make it your home
> > http://www.yahoo.com/r/hs
> Thomas Lumley Assoc. Professor, Biostatistics
> tlumley at u.washington.edu University of Washington,
More information about the R-help