effect("Parent.Engagement.Score:Instruction.Score", interact_read, type="response")
##
## Parent.Engagement.Score*Instruction.Score effect
## Instruction.Score
## Parent.Engagement.Score 1 30 50 70 100
## 42 37.12161 30.56570 26.04438 21.52306 14.74109
## 48 36.78408 34.00593 32.08996 30.17399 27.30004
## 55 36.39030 38.01953 39.14314 40.26674 41.95216
## 62 35.99652 42.03313 46.19631 50.35950 56.60427
## 68 35.65899 45.47336 52.24189 59.01042 69.16322
plot(effect("Parent.Engagement.Score:Instruction.Score", interact_read, type="response"))
library(sjPlot)
library(sjmisc)
theme_set(theme_sjplot())
plot_model(interact_read, type= "pred", terms= c("Parent.Engagement.Score","Instruction.Score"), mdrt.values = "meansd")
### My no confidence intervals (the shaded area around the lines) are
very large. I think this is because I have less data (only 194
observations) and because there is high variability in my data. I do not
think parent engagement and instruction score have a strong relationship
(correlation coefficient = 0.34), that’s to say I do not think parent
engagement matters more if the instruction score of the teacher is
higher and vice versa.
interact_progress<-lm(GR3_5_readlevel ~ Parent.Engagement.Score*Instruction.Score+student_attendance+yearly_progress, data= dataschools2)
summary(interact_progress)
##
## Call:
## lm(formula = GR3_5_readlevel ~ Parent.Engagement.Score * Instruction.Score +
## student_attendance + yearly_progress, data = dataschools2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -29.405 -6.776 -1.017 6.514 44.852
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) -2.748e+02 5.432e+01 -5.060
## Parent.Engagement.Score 1.045e+00 6.241e-01 1.674
## Instruction.Score 4.436e-02 5.326e-01 0.083
## student_attendance 2.663e+00 5.055e-01 5.268
## yearly_progressYes 2.574e+01 2.594e+00 9.926
## Parent.Engagement.Score:Instruction.Score -5.965e-04 1.062e-02 -0.056
## Pr(>|t|)
## (Intercept) 9.94e-07 ***
## Parent.Engagement.Score 0.0958 .
## Instruction.Score 0.9337
## student_attendance 3.75e-07 ***
## yearly_progressYes < 2e-16 ***
## Parent.Engagement.Score:Instruction.Score 0.9553
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.82 on 188 degrees of freedom
## Multiple R-squared: 0.6291, Adjusted R-squared: 0.6193
## F-statistic: 63.78 on 5 and 188 DF, p-value: < 2.2e-16
dataschools2$yearly_progress<-as.factor(dataschools2$yearly_progress)
dataschools2$predicted_progress<-predict(interact_progress)
dataschools2$residuals_progress<-residuals(interact_progress)
plot(dataschools2$predicted_progress,dataschools2$residuals_progress, col=dataschools2$yearly_progress)
coeftest(interact_progress, vcov=vcovHC(interact_progress, type="HC1"))
##
## t test of coefficients:
##
## Estimate Std. Error t value
## (Intercept) -2.7484e+02 4.8905e+01 -5.6199
## Parent.Engagement.Score 1.0447e+00 7.3318e-01 1.4249
## Instruction.Score 4.4365e-02 6.5980e-01 0.0672
## student_attendance 2.6632e+00 4.4579e-01 5.9741
## yearly_progressYes 2.5743e+01 3.0963e+00 8.3142
## Parent.Engagement.Score:Instruction.Score -5.9647e-04 1.3559e-02 -0.0440
## Pr(>|t|)
## (Intercept) 6.809e-08 ***
## Parent.Engagement.Score 0.1558
## Instruction.Score 0.9465
## student_attendance 1.137e-08 ***
## yearly_progressYes 1.823e-14 ***
## Parent.Engagement.Score:Instruction.Score 0.9650
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
residuals_sdprogress<-dataschools2 %>%
group_by(yearly_progress)%>%
summarise(residuals_sdprogress=sd(residuals_progress))%>%
arrange(residuals_sdprogress)
absolute_residualprogress<- dataschools2 %>%
group_by(yearly_progress)%>%
summarise(absolute_residual_avgprogress=mean(abs(residuals_progress)))%>%
arrange(absolute_residual_avgprogress)
vcov(interact_progress, type="HC1")
## (Intercept) Parent.Engagement.Score
## (Intercept) 2950.3946404 -16.753052172
## Parent.Engagement.Score -16.7530522 0.389481691
## Instruction.Score -14.6769179 0.305314924
## student_attendance -22.6486981 -0.025638035
## yearly_progressYes 23.1544132 0.069961720
## Parent.Engagement.Score:Instruction.Score 0.3011668 -0.006177297
## Instruction.Score student_attendance
## (Intercept) -14.676917862 -2.264870e+01
## Parent.Engagement.Score 0.305314924 -2.563803e-02
## Instruction.Score 0.283640341 -6.398135e-03
## student_attendance -0.006398135 2.555706e-01
## yearly_progressYes 0.219077771 -2.847891e-01
## Parent.Engagement.Score:Instruction.Score -0.005628249 5.397137e-05
## yearly_progressYes
## (Intercept) 23.154413237
## Parent.Engagement.Score 0.069961720
## Instruction.Score 0.219077771
## student_attendance -0.284789118
## yearly_progressYes 6.726717511
## Parent.Engagement.Score:Instruction.Score -0.004651338
## Parent.Engagement.Score:Instruction.Score
## (Intercept) 3.011668e-01
## Parent.Engagement.Score -6.177297e-03
## Instruction.Score -5.628249e-03
## student_attendance 5.397137e-05
## yearly_progressYes -4.651338e-03
## Parent.Engagement.Score:Instruction.Score 1.128368e-04
coeftest(interact_progress, vcov=vcovHC(interact_progress, type="HC1"))
##
## t test of coefficients:
##
## Estimate Std. Error t value
## (Intercept) -2.7484e+02 4.8905e+01 -5.6199
## Parent.Engagement.Score 1.0447e+00 7.3318e-01 1.4249
## Instruction.Score 4.4365e-02 6.5980e-01 0.0672
## student_attendance 2.6632e+00 4.4579e-01 5.9741
## yearly_progressYes 2.5743e+01 3.0963e+00 8.3142
## Parent.Engagement.Score:Instruction.Score -5.9647e-04 1.3559e-02 -0.0440
## Pr(>|t|)
## (Intercept) 6.809e-08 ***
## Parent.Engagement.Score 0.1558
## Instruction.Score 0.9465
## student_attendance 1.137e-08 ***
## yearly_progressYes 1.823e-14 ***
## Parent.Engagement.Score:Instruction.Score 0.9650
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
###Parent.Engagement.Score:Instruction.Score -5.9647e-04
coeftest(interact_progress, vcov=vcovHC(interact_progress, type="HC3"))
##
## t test of coefficients:
##
## Estimate Std. Error t value
## (Intercept) -2.7484e+02 5.2353e+01 -5.2498
## Parent.Engagement.Score 1.0447e+00 8.0948e-01 1.2906
## Instruction.Score 4.4365e-02 7.5098e-01 0.0591
## student_attendance 2.6632e+00 4.6149e-01 5.7709
## yearly_progressYes 2.5743e+01 3.2276e+00 7.9760
## Parent.Engagement.Score:Instruction.Score -5.9647e-04 1.5396e-02 -0.0387
## Pr(>|t|)
## (Intercept) 4.091e-07 ***
## Parent.Engagement.Score 0.1984
## Instruction.Score 0.9530
## student_attendance 3.202e-08 ***
## yearly_progressYes 1.438e-13 ***
## Parent.Engagement.Score:Instruction.Score 0.9691
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(interact_progress)
##
## Call:
## lm(formula = GR3_5_readlevel ~ Parent.Engagement.Score * Instruction.Score +
## student_attendance + yearly_progress, data = dataschools2)
##
## Residuals:
## Min 1Q Median 3Q Max
## -29.405 -6.776 -1.017 6.514 44.852
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) -2.748e+02 5.432e+01 -5.060
## Parent.Engagement.Score 1.045e+00 6.241e-01 1.674
## Instruction.Score 4.436e-02 5.326e-01 0.083
## student_attendance 2.663e+00 5.055e-01 5.268
## yearly_progressYes 2.574e+01 2.594e+00 9.926
## Parent.Engagement.Score:Instruction.Score -5.965e-04 1.062e-02 -0.056
## Pr(>|t|)
## (Intercept) 9.94e-07 ***
## Parent.Engagement.Score 0.0958 .
## Instruction.Score 0.9337
## student_attendance 3.75e-07 ***
## yearly_progressYes < 2e-16 ***
## Parent.Engagement.Score:Instruction.Score 0.9553
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.82 on 188 degrees of freedom
## Multiple R-squared: 0.6291, Adjusted R-squared: 0.6193
## F-statistic: 63.78 on 5 and 188 DF, p-value: < 2.2e-16