An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121123/36c443e4/attachment.pl>
problem with svyglm
6 messages · Pablo Menese, David Winsemius
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
4 days later
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121127/8b12fc0c/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121127/4b4c8a34/attachment.pl>
On Nov 27, 2012, at 2:31 PM, Pablo Menese wrote:
Sorry, it send it alone... When I use it: logit <- glm(bach ~ egp4 + programa, weight=wst7, family=quasibinomial(link"logit")) I reach the same betas that in STATA, but the hypothesis test, the t value, and the std. error is different.
As might be expected if one (Stata) were a weighted analysis and the (R) other is using a different interpretation of "weights".
I think that the solution can't be so far from this...
If so, then you will be the one to achieve it. You have offered no data in either the original question for which you have omitted context, and the code in this posting is obviously incorrect. Furthermore you started with a `svyglm` question and this code only attempts to use `glm`.
David Winsemius, MD Alameda, CA, USA
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121128/c84450dd/attachment.pl>