[R] stata.get labels glm()

Tobias Caris Quark at gmx.at
Sun Feb 27 18:50:16 CET 2011


ok, solved it.

In case anyone else is interested:

1st step: import data with convert.factors = FALSE

2nd step: replace only for variable v2 numeric values to labels:

wvs1981$v2 <- factor(wvs1981$v2, labels = labels(attributes(wvs1981)$stata.info$label.table$v2))




-------- 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.

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl


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



More information about the R-help mailing list