[R] problem with svyglm

David Winsemius dwinsemius at comcast.net
Fri Nov 23 21:56:32 CET 2012


On Nov 23, 2012, at 12:08 PM, Pablo Menese wrote:

> I have this problem.
>
> test <- svydesign(id=~1,weights=~peso)
>
> logit <- svyglm(bach ~ job2 + mujer + egp4 + programa + delay + mdeo  
> + str
> + evprivate, family=binomial,design=test)
>
> then appear:
>
> Error in svyglm.survey.design(bach ~ job2 + mujer + egp4 + programa  
> +  :
>  all variables must be in design= argument
>
> I don't know what this mean...

I suspect you have attach()-ed your dataset and are expecting  
regression functions to be "aware" of your column names. That  
expectation doesn't always get fulfilled since the authrs of  
regression packages are expecting dataframe arguments to be supplied.  
You may want to detach the dataset and use data= arguments in  
svydesign().

You should forget that you ever heard about the function attach().

-- 

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list