[R] weighted ftable

Thomas Lumley tlumley at u.washington.edu
Tue Nov 25 22:00:57 CET 2008

On Mon, 24 Nov 2008, Andrew Choens wrote:

> I need to do some fairly deep tables, and ftable() offers most of what I
> need, except for the weighting. With smaller samples, I've just used
> replicate to let me have a weighted data set, but with this data set,
> I'm afraid replicate is going to make my data set too big for R to
> handle comfortably.
> That being said, is there some way to weight my table (similar to
> wtd.table) but offer the nuanced control and depth of ftable?

xtabs() will take a weight as the left-hand side of the formula, and its 
output can then be processed by ftable().


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

More information about the R-help mailing list