Skip to content

Instantly share code, notes, and snippets.

@mollietaylor
Created January 2, 2014 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mollietaylor/8214220 to your computer and use it in GitHub Desktop.
Save mollietaylor/8214220 to your computer and use it in GitHub Desktop.
Compare Regression Results to a Specific Factor Level in R
str(ChickWeight$Diet)
table(ChickWeight$Diet)
ols <- lm(weight ~ Time + Diet,
data = ChickWeight)
summary(ols)
ChickWeight$Diet <- relevel(ChickWeight$Diet,
ref = 4)
olsRelevel <- lm(weight ~ Time + Diet,
data = ChickWeight)
summary(olsRelevel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment