Articles by Econometrics and Free Software

Building formulae

December 26, 2017 | Econometrics and Free Software

This Stackoverflow question made me think about how to build formulae. For example, you might want to programmatically build linear model formulae and then map these models on data. For example, suppose the following (output suppressed):
data(mtcars)

lm(mpg ~ hp, data = mtcars)
lm(mpg ~I(hp^2), data = mtcars)
lm(mpg ~I(hp^3), data = mtcars)
lm(mpg ~I(hp^4), data = mtcars)
lm(mpg ~I(hp^5), data = mtcars)
lm(mpg ~I(hp^6), data = mtcars)
To avoid doing this, one can write a function that builds the formulae: {{... [Read more...]

Teaching the tidyverse to beginners

December 16, 2017 | Econometrics and Free Software

End October I tweeted this: will teach #rstats soon again but this time following @drob 's suggestion of the tidyverse first as laid out here: https://t.co/js8SsUs8Nv— Bruno Rodrigues (@brodriguesco) October 24, 2017 and it generated some discussion. Some people believe that this is the right approach, and ... [Read more...]

Functional peace of mind

November 13, 2017 | Econometrics and Free Software

I think what I enjoy the most about functional programming is the peace of mind that comes with it. With functional programming, there’s a lot of stuff you don’t need to think about. You can write functions that are general enough so that they solve a variety of ... [Read more...]
1 8 9 10 11 12

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)