Week Learning Objectives
By the end of this module, you will be able to
- Describe the statistical model for regression
- Write out the model equations
- Simulate data based on a regression model
- Plot interactions
Slides
PDF version
In the example in the video, why do we need a random component?
What is the coding for the
sex
variable?
Take a pause and look at the scatterplot matrix. Ask yourself the following:
- How does the distribution of
salary
look?
- Are there more males or females in the data?
- How would you describe the relationship between number of publications and salary?
Sample regression line
How would you translate the regression line
into R?
Centering
The mean of the
pub
variable is 18.2. If we call the mean-centered version of it as
pub_c
, what should be the value of
pub_c
for someone with 10 publications?
Categorical Predictor
In a regression analysis, assume that there is a binary predictor that indicates whether a school is public (coded as 0) or private (coded as 1). If the coefficient for that predictor is 1.5, which category has a higher predicted score?
The coefficient of pub_c
becomes smaller after adding time
into the equation. Why do you think that is the case?
Interaction
From the interaction model, obtain the regression line when pub
= 50.