The base R function filter() can be used to calculate moving averages. This is one of the base R functions… Read more
Category: Using R
US Names: section 2.3 of Regression and Other Stories
In section 2.3 of Regression and Other Stories, Gelman et al. discuss using graphs to learn more about data. The third… Read more
Age Adjustment: section 2.4 of Regression and Other Stories
In section 2.4 of Regression and Other Stories, Gelman, et al. explain the necessity of age adjustment when investigating mortality rates…. Read more
Encoding a contrast in a linear model
This is note to myself on how to encode a contrast in a linear model. The following data come from… Read more
Some R Fundamentals
I recently came across the book R Programming for Bioinformatics at my local library and decided to check it out…. Read more
Would you rather
Someone texted me the following image and asked for my response. So what would I rather do? Flip 3 coins… Read more
Fixing the p-value note in a HTML stargazer table
If you insert a stargazer table into R Markdown that outputs an HTML file, you may get a p-value note… Read more
Most useful tests for an ANCOVA model
In his book Regression Modeling Strategies, 2nd Ed, Frank Harrell provides a list of what he calls the “most useful… Read more
Using natural splines in linear modeling
Take a look at this scatterplot: It's clear there is a relationship between x and y, but the relationship is… Read more
Recreating a Geometric CDF plot from Casella and Berger
For reasons I no longer remember I decided a while back to reproduce Figure 1.5.2 from Casella and Berger (page… Read more