-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
21 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,54 @@ | ||
## ----------------------------------------------------------------------------- | ||
library("tidyverse") | ||
library("Sleuth3") | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m <- lm(Lifetime ~ Diet, data = case0501) | ||
anova(m) | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
summary(m) | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m0 <- lm(Lifetime ~ 1, data = case0501) # 1 indicates intercept | ||
anova(m0, m) | ||
|
||
|
||
|
||
|
||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m <- lm(Speed ~ Starters + Track, data = ex0920) | ||
anova(m) | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m0 <- lm(Speed ~ 1, data = ex0920) | ||
mS <- lm(Speed ~ Starters, data = ex0920) | ||
mT <- lm(Speed ~ Track, data = ex0920) | ||
mST <- lm(Speed ~ Starters + Track, data = ex0920) | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
anova(m0, mS ) # we are looking to add (S)tarters to the model | ||
anova(mS, mST) # we are looking to add (T)rack to the model | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
anova(m0, mS, mST) | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m <- lm(Speed ~ Track*Starters, data = Sleuth3::ex0920) | ||
anova(m) | ||
|
||
|
||
|
||
|
||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m <- lm(Speed ~ Track + Starters, data = Sleuth3::ex0920) | ||
drop1(m, test="F") | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
mT <- lm(Speed ~ Track, data = Sleuth3::ex0920) | ||
mS <- lm(Speed ~ Starters, data = Sleuth3::ex0920) | ||
mST <- lm(Speed ~ Track + Starters, data = Sleuth3::ex0920) | ||
anova(mS,mST) # Consider adding Track into the model that already has Starters | ||
anova(mT,mST) # Consider adding Starters into the model that already has Track | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m <- lm(Ingestion ~ Weight + Organic, data = Sleuth3::ex0921) | ||
drop1(m, test='F') | ||
|
||
|
||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m <- lm(Ingestion ~ Weight * Organic, data = Sleuth3::ex0921) | ||
drop1(m, test = 'F') | ||
|
||
|
||
## ----------------------------------------------------------------------------- | ||
m0 <- lm(Ingestion ~ Weight + Organic, data = Sleuth3::ex0921) | ||
anova(m0,m) | ||
|
||
anova(m0, m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.