getting strata/cluster level values with survey package?
First, I appoligise for the rookie question, but...
I'm trying to obtain standard errors, confidence intervals, etc. from a
sample design and have been trouble getting the results for anything other
than the basic total or mean for the overall survey from the survey
which reports the number of observations in each of the strata. I'm sure
this is a RTFM question, but I just need a start. The size of each "plot"
is 0.04 units (hectares) and I want to be able to quickly examine working
up each sample with and without clusters (this is going to be part of a
larger simulation study).
I'm trying to not use SAS for this and hate to admit defeat.
Re: getting strata/cluster level values with survey package?
On Tue, 7 Feb 2006, Jeff D. Hamann wrote:
> First, I appoligise for the rookie question, but...
> I'm trying to obtain standard errors, confidence intervals, etc. from a
> sample design and have been trouble getting the results for anything other
> than the basic total or mean for the overall survey from the survey
You want svyby() and then perhaps ftable() for formatting. (?svyby,
(You also want to send only one copy of the email message, not three).
> For example, using the following dataset,
> where this is read into stand.data. When I use the following survey designs,
> srv1 <- svydesign(ids=~1, strata=~strata, data=stand.data )
> srv1 <- svydesign(ids=~cluster, strata=~strata, data=stand.data )
> print( svytotal( ~vol, srv1 ) )
> I only obtain the total,
>> print( svytotal( ~vol, srv1 ) )
> total SE
> vol 2377 34.464
> or worse,
> print( svytotal( ~vol + strata, srv1 ) )
> total SE
> vol 2377.0 34.464
> strataA 42.0 0.000
> strataB 64.0 0.000
> strataC 34.0 0.000
> which reports the number of observations in each of the strata. I'm sure
> this is a RTFM question, but I just need a start. The size of each "plot"
> is 0.04 units (hectares) and I want to be able to quickly examine working
> up each sample with and without clusters (this is going to be part of a
> larger simulation study).
> I'm trying to not use SAS for this and hate to admit defeat.
Thomas Lumley Assoc. Professor, Biostatistics
[hidden email] University of Washington, Seattle