statistics

Understanding Conditional and Iterated Expectations with a Linear Regression Model

TL;DR You can a regress an outcome on a grouping variable plus any other variable(s) and the unadjusted and adjusted group means will be identical. We can see this in a simple example using the iris data: iris %>% # fit a linear regression for sepal length given sepal width and species # make a new column containing the fitted values for sepal length mutate(preds = predict(lm(Sepal.

A Day in the Life of a Biostatistician

It seems fitting that my first blog post is on a topic that I tried and failed to find via Google search a few years ago. I’ll back up for a second. A few years ago I was a recent college graduate, and trying hard to “figure out my life.” My major was biochemistry, which is one of those degrees where 99%* of people just keep on going to school.