Re: [R] rake() error message

2014-06-09 Thread Thomas Lumley
Anthony is right about the cause. The lack of partial=TRUE option in rake is deliberate, and there's really only such an option in postStratify() for debugging or simulation purposes. What partial=TRUE allows is the situation where an observation in your sample has a combination of values that doe

Re: [R] rake() error message

2014-06-08 Thread Anthony Damico
(1) you hit a memory error, because you are including too many variable levels. even if you narrowed your 16 variables down to these four, the `rake` function would need room for matricies containing as much data as a 6-million record table: nrow( expand.grid( data473t[ , c( 'm11' , 'm12c' , 'm13

Re: [R] rake() error message

2014-06-08 Thread Michael Willmorth
Here is some code with a subset of 50 cases that produces a similar set of errors to what I got with the full data set (31,690 cases): ## # Load "survey" package # library(survey) ## # Create raking margins ## pop.m01 <- data.frame(m01=1:14, Freq=c(1013620, 136

Re: [R] rake() error message

2014-06-08 Thread Anthony Damico
could you provide a reproducible example ?dput is your friend http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example On Sat, Jun 7, 2014 at 11:22 AM, Michael Willmorth < mwillmo...@clearwater-research.com> wrote: > I'm teaching myself how to use rake() in the R "

[R] rake() error message

2014-06-07 Thread Michael Willmorth
I'm teaching myself how to use rake() in the R "survey" package, using Thomas Lumley's "Complex Surveys" book. Working with one of my data sets, I received an error that has me stumped. Here is the code I used: d473.raked <- rake(sdes473, sample=list(~m01, ~m02, ~m03, ~m04, ~m05, ~m06c, ~m07c,