![r lm rename x r lm rename x](https://i.otto.de/i/otto/24888423/fujifilm-x-h1-xf-16-55mm-set-plus-vpb-xh1-kit-systemkamera-fujinon-xf16-55mm-f2-8-r-lm-wr-24-3-mp-bluetooth-videoaufnahmen-in-4k-2160p.jpg)
![r lm rename x r lm rename x](https://farm5.staticflickr.com/4707/39639256661_166f39f70b_h.jpg)
screenreg(list(mod1, mod2),Ĭ=c('intercept', 'education', 'type: blue collar', We can rename variables before constructing the table using the argument. I mean, 'typebc'? Making better variable names But these variable names are automatically constructed and inevitably a bit weird-looking. Now let's compare these two models screenreg(list(mod1, mod2)) Mod2 <- lm(prestige ~ education + type * income + women, data=prest)
![r lm rename x r lm rename x](http://www.i-deel.org/uploads/5/2/4/1/52416001/new_orig.png)
# Income has different relationship to job prestige depending on job type Mod1 <- lm(prestige ~ education + type + income + women, data=prest) # Income has a single relationship to job prestige # make professional the base category and rebase income Let’s tidy the data and construct a couple of models to show texreg at work. The covariates are the average income of that occupation in dollars, the average years of education in years, the percentage of women it contained, a census occupational code that we can ignore, and a nominal variable called type that takes the values blue collar (‘bc’), white collar (‘wc’), and professional (‘prof’). For each occupation there’s a level of job prestige and some covariates that potentially explain that level. This dataset gives information about various occupations collected from census data in Canada in the early 1970s. I’ll demonstrate all this using screenreg on a classic data set on job prestige.Ĭonsider the ‘Prestige’ data in the car package. So for work people are going to see, variables should have sensible names.įirst I’ll walk through the existing texreg machinery for renaming, omitting, and reordering variables, and then propose a hopefully more intuitive implementation. Even R will cheerfully mash up your carefully chosen variable names through formulas, factors, and interactions.
#R lm rename x software
That is particularly important when data comes from variable-mangling statistical software or from co-authors whose idea of a descriptive name could pass for an online banking password. This post is about making the variables listed in those combined regression tables more readable. The coefficient plots from plotreg are pretty cool too.
#R lm rename x pdf
Also, the ascii art creating screenreg function allows me to bypass the pdf construction cycle I previously described here. It’s not the only package to do that – see here for a review – but it’s often handy to be able to generate both ascii art, latex, and html versions of the same table using almost identical syntax. I’ve been playing around with the R package texreg for creating combined regression tables for multiple models.