Splitting Linear Models

Last Thursday I watched Wolfgang Viechtbauer’s stream on Twitch. Wolfgang spoke about linear regression. (If you’re interested in the results: Wolfgang lists the R-code he wrote during the stream at https://www.wvbauer.com/doku.php/live_streams.)

During the stream we had an example with one categorical and one numeric predictor and we built a model with interaction between these two predictors. So the result is a straight line for each value of the categorival group.

The question was if it makes a difference if you build a simple linear model for each group.

So let’s look at it.

Converting Lists of Lists of Lists to Data.Frames (or Tibbles)

I’m working on an R-package to access the data of a web service. So I have to handle large data I get back from an API call. The result is encoded in JSON-format which itself results in a large list of lists (of lists).

But I want to convert these lists of lists into a data.frame or tibble. Sounds easy …. Here are the caveats I came across.