Skip to content

problem with svyglm()

2 messages · Federico Calboli, Thomas Lumley

3 days later
#
On Thu, 2 Apr 2009, Federico Calboli wrote:

            
I don't know what you are trying to do here, but svyglm() wants a formula 
where the variables are all in the design object. Also, data_svy[,iCol] 
won't do what you probably expect, since data_svy isn't a data frame.
There are two differences here. The first is that glm() doesn't require 
variables to be in the data= argument, because it doesn't have to carry 
around the design meta-data.  The second is that data[,4] is a 
well-defined variable, whereas data_svy[,4] is meaningless.

It's hard to guess exactly what you are trying to do here. If you are 
trying to do a loop over regression models then you have to do something 
like

for(v in vnames) {
   models[[v]] <- eval(bquote( svyglm(y~x+.(as.name(v)), design=data_svy)))
}

 	-thomas