Skip to content

Instantly share code, notes, and snippets.

@fpcMotif
Forked from mollietaylor/factorDummies.R
Created October 21, 2018 21:51
Show Gist options
  • Select an option

  • Save fpcMotif/45c99ce0b3a25e439b73d91d90c5eb39 to your computer and use it in GitHub Desktop.

Select an option

Save fpcMotif/45c99ce0b3a25e439b73d91d90c5eb39 to your computer and use it in GitHub Desktop.

Revisions

  1. @mollietaylor mollietaylor created this gist Jan 2, 2014.
    13 changes: 13 additions & 0 deletions factorDummies.R
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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)