[R] help with aggregate.survey.design

Thomas Lumley tlumley at u.washington.edu
Thu Oct 16 03:38:24 CEST 2003


On Wed, 15 Oct 2003 TyagiAnupam at aol.com wrote:

> I am trying to modify aggregate.data.frame to create an aggregate method for
> survey design objects.  I am running into problems because survey design
> objects are lists, with the variables and other design information stored in
> separate dataframes, or objects of other classes, in this list. *Apply and split
> functions do not seem to work on the design objects. How do I approach this,
> without having to rewrite *apply and split (and what would that involve?)?  I
> thought of creating lots of subsets, using "subset", but that does not seem to be
> a good approach.
>

I think the right approach is to extract the `variables' component of the
survey.design, use aggregate on it, and then work out how to attach the
right design metadata (weights, clusters, &c) to it.

This is not completely trivial, or I would have done it already.

	-thomas




More information about the R-help mailing list