The coefficient for x is ^β (95% CI: LB^β,UB^β). A one-unit increase in x yields an expected increase in y of ^β, holding all other variables constant.
sat=β0+β1salary+β2(frac=LOW)+β3(frac=HIGH)+ϵ
The coefficient for average salary is 1.09 (95% CI: -0.90, 3.08). A one-unit increase in average salary yields an expected increase in average SAT score of 1.09, holding the fraction of students that took the SAT constant.
Weight=β0+β1Age+β2Girl+β3Age×Girl+ϵ
lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Weight=β0+β1Age+β2Girl+β3Age×Girl+ϵ
lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Weight=β0+β1Age+β2Girl+β3Age×Girl+ϵ
lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Weight=β0+β1Age+β2Girl+β3Age×Girl+ϵ
lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Sex = 1
)Weight=β0+β1Age+β2Girl+β3Age×Girl+ϵ
lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Sex = 1
)Weight=β0+β1Age+β2Girl+β3Age×Girl+ϵ
lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Sex = 1
)Weight=β0+β1Age+β2Girl+β3Age×Girl+ϵ
lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Sex = 1
)lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Sex = 1
)lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Sex = 1
)lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Sex = 1
)lm(Weight ~ Age + Sex + Age * Sex, data = Kids198)
## ## Call:## lm(formula = Weight ~ Age + Sex + Age * Sex, data = Kids198)## ## Coefficients:## (Intercept) Age Sex Age:Sex ## -33.6925 0.9087 31.8506 -0.2812
Sex = 0
)Sex = 1
)The coefficient for the interaction between x and I is ^β (95% CI: LB^β,UB^β). This means that the effect of x on y differs by ^β when I=1 compared to I=0 holding all other variables constant*.
The coefficient for the interaction between x and I is ^β (95% CI: LB^β,UB^β). This means that the effect of x on y differs by ^β when I=1 compared to I=0 holding all other variables constant*.
Weight=β0+β1Age+β2Girl+β3Age×Girl+ϵ
The coefficient for the interaction between Age
and Sex
is -0.28 (95% CI: -0.44, -0.12). This means that the effect of Age
on Weight
lower by 0.28 among girls compared to boys.
lm(TotalPrice ~ Carat + I(Carat^2), data = Diamonds)
lm(TotalPrice ~ Carat + I(Carat^2), data = Diamonds)
TotalPrice=β0+β1Carat+β2Carat2+ϵ
TotalPrice=β0+β1Carat+β2Carat2+ϵ
TotalPrice=β0+β1Carat+β2Carat2+ϵ
Caret
holding Carat
2 constant?TotalPrice=β0+β1Carat+β2Carat2+ϵ
Caret
holding Carat
2 constant?lm(TotalPrice ~ Carat + I(Carat^2), data = Diamonds) %>% tidy()
## # A tibble: 3 x 5## term estimate std.error statistic p.value## <chr> <dbl> <dbl> <dbl> <dbl>## 1 (Intercept) -523. 466. -1.12 2.63e- 1## 2 Carat 2386. 753. 3.17 1.66e- 3## 3 I(Carat^2) 4498. 263. 17.1 5.09e-48
What is the expected change in TotalPrice
for a one-unit change in Carat
, changing from 0.8 to 1.8?
lm(TotalPrice ~ Carat + I(Carat^2), data = Diamonds) %>% tidy()
## # A tibble: 3 x 5## term estimate std.error statistic p.value## <chr> <dbl> <dbl> <dbl> <dbl>## 1 (Intercept) -523. 466. -1.12 2.63e- 1## 2 Carat 2386. 753. 3.17 1.66e- 3## 3 I(Carat^2) 4498. 263. 17.1 5.09e-48
What is the expected change in TotalPrice
for a one-unit change in Carat
, changing from 0.8 to 1.8?
(-522.7 + 2386 * 1.8 + 4498.2 * 1.8^2) - (-522.7 + 2386 * 0.8 + 4498.2 * 0.8^2)
## [1] 14081.32
lm(TotalPrice ~ Carat + I(Carat^2), data = Diamonds) %>% tidy()
## # A tibble: 3 x 5## term estimate std.error statistic p.value## <chr> <dbl> <dbl> <dbl> <dbl>## 1 (Intercept) -523. 466. -1.12 2.63e- 1## 2 Carat 2386. 753. 3.17 1.66e- 3## 3 I(Carat^2) 4498. 263. 17.1 5.09e-48
What is the expected change in TotalPrice
for a one-unit change in Carat
, changing from 0.8 to 1.8?
(-522.7 + 2386 * 1.8 + 4498.2 * 1.8^2) - (-522.7 + 2386 * 0.8 + 4498.2 * 0.8^2)
## [1] 14081.32
2386 * (1.8 - 0.8) + 4498.2 * (1.8^2 - 0.8^2)
## [1] 14081.32
lm(TotalPrice ~ Carat + I(Carat^2), data = Diamonds) %>% tidy()
## # A tibble: 3 x 5## term estimate std.error statistic p.value## <chr> <dbl> <dbl> <dbl> <dbl>## 1 (Intercept) -523. 466. -1.12 2.63e- 1## 2 Carat 2386. 753. 3.17 1.66e- 3## 3 I(Carat^2) 4498. 263. 17.1 5.09e-48
What is the expected change in TotalPrice
for a one-unit change in Carat
, changing from 1.8 to 2.8?
lm(TotalPrice ~ Carat + I(Carat^2), data = Diamonds) %>% tidy()
## # A tibble: 3 x 5## term estimate std.error statistic p.value## <chr> <dbl> <dbl> <dbl> <dbl>## 1 (Intercept) -523. 466. -1.12 2.63e- 1## 2 Carat 2386. 753. 3.17 1.66e- 3## 3 I(Carat^2) 4498. 263. 17.1 5.09e-48
What is the expected change in TotalPrice
for a one-unit change in Carat
, changing from 1.8 to 2.8?
2386 * (2.8 - 1.8) + 4498.2 * (2.8^2 - 1.8^2)
## [1] 23077.72
lm(TotalPrice ~ Carat + I(Carat^2), data = Diamonds) %>% tidy()
## # A tibble: 3 x 5## term estimate std.error statistic p.value## <chr> <dbl> <dbl> <dbl> <dbl>## 1 (Intercept) -523. 466. -1.12 2.63e- 1## 2 Carat 2386. 753. 3.17 1.66e- 3## 3 I(Carat^2) 4498. 263. 17.1 5.09e-48
What is the expected change in TotalPrice
for a one-unit change in Carat
, changing from 1.8 to 2.8?
2386 (2.8 - 1.8) + 4498.2 (2.8^2 - 1.8^2)
## [1] 23077.72
Carat
?The linear term in the model for x has a coefficient of ^β1 (95% CI: (LB^β1,UB^β1)). The quadratic term in the model for x has a coefficient of ^β2 (95% CI: (LB^β2,UB^β2)). A change in x from a to b yields an expected change in y of ^β1(b−a)+^β2(b2−a2) holding all other variables constant*.
The linear term in the model for x has a coefficient of ^β1 (95% CI: (LB^β1,UB^β1)). The quadratic term in the model for x has a coefficient of ^β2 (95% CI: (LB^β2,UB^β2)). A change in x from a to b yields an expected change in y of ^β1(b−a)+^β2(b2−a2) holding all other variables constant*.
The linear term in the model for Carat
has a coefficient of 2386 (95% CI: (906,3866)). The quadratic term in the model for Carat
has a coefficient of 4498 (95% CI: (3981,5016)). A change in Carat
from 0.7 to 1.24 yields an expected change in TotalPrice
of 6000.5.
The linear term in the model for Carat
has a coefficient of 2386 (95% CI: (906,3866)). The quadratic term in the model for Carat
has a coefficient of 4498 (95% CI: (3981,5016)). A change in Carat
from 0.7 to 1.24 yields an expected change in TotalPrice
of 6000.5.
Diamonds %>% summarise(q1 = quantile(Carat, 0.25), q3 = quantile(Carat, 0.75))
## q1 q3## 1 0.7 1.24
Diamonds
Diamonds
Carat
The coefficient for x is ^β (95% CI: LB^β,UB^β). A one-unit increase in x yields an expected increase in y of ^β, holding all other variables constant.
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |