[R] stata.get labels glm()

Quark at gmx.at Quark at gmx.at
Sun Feb 27 17:58:29 CET 2011


Thanks for the idea, Ben. It works, but unfortunately the numbers assigned by as.numeric() do not correspond to the original coding.

Any other suggestions are very much appreciated.

Best regards, Tobias



-------- Original-Nachricht --------
> Datum: Sun, 27 Feb 2011 15:13:47 +0000
> Von: Ben Bolker <bbolker at gmail.com>
> An: r-help at stat.math.ethz.ch
> Betreff: Re: [R] stata.get labels glm()

>  <Quark <at> gmx.at> writes:
> 
> > 
> > Dear R community,
> > 
> > I would like to import data saved with Stata and then
> >  run a Probit model using R.
> > 
> > My data comes from the World Values Surveys and 
> > in the Probit model I want to control for countries.
> > 
>  [snip]
> 
> 
>  [snip]
> 
>   Why don't you set convert.factors to TRUE and convert the
> particular values you are interested in into numeric labels after
> you import them into R?
> 
> wvs1981 <- transform(wvs1981,
>     v214=as.numeric(v214),
>     v216=as.numeric(v216))
> glm(v220bin ~ v214 + v216 + v2, ...)
> 
>   ?
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Schon gehört? GMX hat einen genialen Phishing-Filter in die



More information about the R-help mailing list