Categorical Variables

The Problem with Dummies The Index Variable Approach More Categories Even More Categories Notes of Caution These are code snippets and notes for the fifth chapter, The Many Variables & The Spurious Waffles, section 2, of the book Statistical Rethinking (version 2) by Richard McElreath. In this section, we go through different ways how to add categorical variables to our models. The Problem with Dummies In the simplest case we only have two categories, e. »

Masked Relationship

Hidden Influence in Milk The Causal Reasoning behind it Markov Equivalence Simulating a Masking Ball These are code snippets and notes for the fifth chapter, The Many Variables & The Spurious Waffles, section 2, of the book Statistical Rethinking (version 2) by Richard McElreath. Hidden Influence in Milk In the previous section about spurious associations we used multiple regression to eliminate variables that seemed to have an influence when comparing bivariate relationships but whose association vanishes when introducing more variables to the regression. »

Spurious Association

Spurious Waffles (and Marriages) Yo, DAG Does this DAG fit? More than one predictor: Multiple regression In Matrix Notation Simulating some Divorces How do we plot these? Predictor residual plots Posterior prediction plots Counterfactual plot Simulating spurious associations Simulating counterfactuals These are code snippets and notes for the fifth chapter, The Many Variables & The Spurious Waffles, section 1, of the book Statistical Rethinking (version 2) by Richard McElreath. »

Curvy Regression

Polynomial Regression Splines These are code snippets and notes for the fourth chapter, Geocentric Models, , sections 5, of the book Statistical Rethinking (version 2) by Richard McElreath. Polynomial Regression Standard linear models using a straight line to fit data are nice for their simplicity but a straight line is also very restrictive. Most data does not come in a straight line. We can use polynomial regression to extend the linear model. »

First Linear Predictions

Prior Predictive Checks Running the Model in R Visualize our Model All the Uncertainty These are code snippets and notes for the fourth chapter, Geocentric Models, , sections 4, of the book Statistical Rethinking (version 2) by Richard McElreath. In this section, we work with our first prediction model where we use the weight to predict the height of a person. We again use the !Kung data and restrict to adults above 18. »