Installing and Checking Packages

library("lavaan")
library("effects")
library("psych")
library("lme4")
library("lmerTest")
library("sjstats")
library("sjmisc")
library("lattice")

Importing and Attaching Data

library("sjmisc")
setwd("C:/Users/pickrese/Dropbox/Vanderbilt/Cutting Lab/Reading Error Measure (RED)/PCRC/Poster Data/Wide Data Y2")
REDmasterPassageCombined <- read.csv("C:/Users/pickrese/Dropbox/Vanderbilt/Cutting Lab/Reading Error Measure (RED)/PCRC/Poster Data/Wide Data Y2/REDmasterPassageCombined.csv")
View(REDmasterPassageCombined)
attach(REDmasterPassageCombined)

Checking Variable Distributions

histogram(rc3_pass_expository_total)

boxplot(rc3_pass_expository_total)

histogram(rc3_pass_narrative_total)

boxplot(rc3_pass_narrative_total)

histogram(recall_combined)

boxplot(recall_combined)

histogram(total_q_combined)

boxplot(total_q_combined)

histogram(rc3_age)

boxplot(rc3_age)

Passage specific comprehension genre combined

M00 <- lm(recall_combined ~ CWPM_Total ,  data = REDmasterPassageCombined)
summary(M00)
## 
## Call:
## lm(formula = recall_combined ~ CWPM_Total, data = REDmasterPassageCombined)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.879  -8.033   0.345   6.839  32.987 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 10.46565    2.44625   4.278 3.22e-05 ***
## CWPM_Total   0.06947    0.01108   6.268 3.22e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.03 on 161 degrees of freedom
## Multiple R-squared:  0.1962, Adjusted R-squared:  0.1912 
## F-statistic: 39.29 on 1 and 161 DF,  p-value: 3.219e-09
M0 <- lm(recall_combined ~ CWPM_Total + rc3_wj_br_ss_age ,  data = REDmasterPassageCombined)
summary(M0)
## 
## Call:
## lm(formula = recall_combined ~ CWPM_Total + rc3_wj_br_ss_age, 
##     data = REDmasterPassageCombined)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.326  -8.122   0.187   6.766  32.672 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      17.90933    9.52162   1.881   0.0618 .  
## CWPM_Total        0.08049    0.01865   4.316 2.79e-05 ***
## rc3_wj_br_ss_age -0.09007    0.11337  -0.794   0.4281    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.11 on 158 degrees of freedom
##   (2 observations deleted due to missingness)
## Multiple R-squared:  0.1914, Adjusted R-squared:  0.1811 
## F-statistic:  18.7 on 2 and 158 DF,  p-value: 5.153e-08
M1 <- lm(recall_combined ~ CWPM_Total + rc3_wj_br_ss_age + Delta_DSyM_Sum_Combined ,  data = REDmasterPassageCombined)
summary(M1)
## 
## Call:
## lm(formula = recall_combined ~ CWPM_Total + rc3_wj_br_ss_age + 
##     Delta_DSyM_Sum_Combined, data = REDmasterPassageCombined)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -25.6513  -8.7819  -0.0091   7.1666  30.8197 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             27.57587   11.97631   2.303   0.0227 *  
## CWPM_Total               0.08168    0.01901   4.296 3.13e-05 ***
## rc3_wj_br_ss_age        -0.16446    0.12767  -1.288   0.1997    
## Delta_DSyM_Sum_Combined -0.07724    0.04821  -1.602   0.1113    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11 on 148 degrees of freedom
##   (11 observations deleted due to missingness)
## Multiple R-squared:  0.2263, Adjusted R-squared:  0.2107 
## F-statistic: 14.43 on 3 and 148 DF,  p-value: 2.684e-08
M2 <- lm(recall_combined ~ CWPM_Total + rc3_wj_br_ss_age + Passage_e + Delta_DSyM_Sum_Combined ,  data = REDmasterPassageCombined)
summary(M2)
## 
## Call:
## lm(formula = recall_combined ~ CWPM_Total + rc3_wj_br_ss_age + 
##     Passage_e + Delta_DSyM_Sum_Combined, data = REDmasterPassageCombined)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -22.870  -7.451  -0.346   7.614  28.395 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             29.57781   11.70713   2.526  0.01258 *  
## CWPM_Total               0.07879    0.01858   4.241 3.91e-05 ***
## rc3_wj_br_ss_age        -0.15475    0.12463  -1.242  0.21634    
## Passage_e               -5.07087    1.74715  -2.902  0.00427 ** 
## Delta_DSyM_Sum_Combined -0.08012    0.04706  -1.703  0.09075 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.74 on 147 degrees of freedom
##   (11 observations deleted due to missingness)
## Multiple R-squared:  0.2683, Adjusted R-squared:  0.2484 
## F-statistic: 13.47 on 4 and 147 DF,  p-value: 2.218e-09
M3 <- lm(recall_combined ~ CWPM_Total + rc3_wj_br_ss_age + Passage_e + rc3_age +  Delta_DSyM_Sum_Combined ,  data = REDmasterPassageCombined)
summary(M3)
## 
## Call:
## lm(formula = recall_combined ~ CWPM_Total + rc3_wj_br_ss_age + 
##     Passage_e + rc3_age + Delta_DSyM_Sum_Combined, data = REDmasterPassageCombined)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -21.8665  -6.7536  -0.6404   7.5144  28.4819 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -17.23530   25.30214  -0.681 0.496837    
## CWPM_Total                0.07123    0.01873   3.804 0.000209 ***
## rc3_wj_br_ss_age         -0.10741    0.12532  -0.857 0.392837    
## Passage_e                -4.76613    1.73389  -2.749 0.006737 ** 
## rc3_age                   5.13795    2.46930   2.081 0.039205 *  
## Delta_DSyM_Sum_Combined  -0.09347    0.04697  -1.990 0.048477 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.62 on 146 degrees of freedom
##   (11 observations deleted due to missingness)
## Multiple R-squared:  0.2893, Adjusted R-squared:  0.265 
## F-statistic: 11.89 on 5 and 146 DF,  p-value: 1.167e-09
M4 <- lm(total_q_combined ~ CWPM_Total + rc3_wj_br_ss_age + Passage_e +rc3_age +  Delta_DSyM_Sum_Combined ,  data = REDmasterPassageCombined)
summary(M4)
## 
## Call:
## lm(formula = total_q_combined ~ CWPM_Total + rc3_wj_br_ss_age + 
##     Passage_e + rc3_age + Delta_DSyM_Sum_Combined, data = REDmasterPassageCombined)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.5790 -1.0442  0.0092  1.0266  4.3853 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              8.820891   3.912667   2.254   0.0257 *  
## CWPM_Total               0.012399   0.002896   4.282 3.34e-05 ***
## rc3_wj_br_ss_age        -0.021087   0.019380  -1.088   0.2784    
## Passage_e               -1.092002   0.268125  -4.073 7.59e-05 ***
## rc3_age                  0.521886   0.381847   1.367   0.1738    
## Delta_DSyM_Sum_Combined -0.010421   0.007264  -1.435   0.1535    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.642 on 146 degrees of freedom
##   (11 observations deleted due to missingness)
## Multiple R-squared:  0.3147, Adjusted R-squared:  0.2912 
## F-statistic: 13.41 on 5 and 146 DF,  p-value: 9.305e-11
M5 <- lm(rc3_wj_pc_raw_age ~ CWPM_Total + rc3_wj_br_ss_age + Passage_e +rc3_age +  Delta_DSyM_Sum_Combined ,  data = REDmasterPassageCombined)
summary(M5)
## 
## Call:
## lm(formula = rc3_wj_pc_raw_age ~ CWPM_Total + rc3_wj_br_ss_age + 
##     Passage_e + rc3_age + Delta_DSyM_Sum_Combined, data = REDmasterPassageCombined)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.0842 -2.0402 -0.0951  2.0010  5.9698 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              7.784494   6.953765   1.119   0.2648    
## CWPM_Total               0.029892   0.005147   5.808  3.8e-08 ***
## rc3_wj_br_ss_age         0.056605   0.034443   1.643   0.1024    
## Passage_e                0.256197   0.476524   0.538   0.5916    
## rc3_age                  1.259679   0.678635   1.856   0.0654 .  
## Delta_DSyM_Sum_Combined -0.025530   0.012910  -1.978   0.0499 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.918 on 146 degrees of freedom
##   (11 observations deleted due to missingness)
## Multiple R-squared:  0.571,  Adjusted R-squared:  0.5563 
## F-statistic: 38.87 on 5 and 146 DF,  p-value: < 2.2e-16
M6 <- lm(rc3_gates_comp_raw ~ CWPM_Total + rc3_wj_br_ss_age + Passage_e +rc3_age +  Delta_DSyM_Sum_Combined ,  data = REDmasterPassageCombined)
summary(M6)
## 
## Call:
## lm(formula = rc3_gates_comp_raw ~ CWPM_Total + rc3_wj_br_ss_age + 
##     Passage_e + rc3_age + Delta_DSyM_Sum_Combined, data = REDmasterPassageCombined)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -11.3358  -4.2751  -0.2094   3.6836  14.2080 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              6.74660   13.70304   0.492  0.62323    
## CWPM_Total               0.08856    0.01004   8.821 3.58e-15 ***
## rc3_wj_br_ss_age         0.04050    0.06726   0.602  0.54804    
## Passage_e                1.78950    0.93873   1.906  0.05862 .  
## rc3_age                  0.48068    1.33699   0.360  0.71973    
## Delta_DSyM_Sum_Combined -0.07129    0.02537  -2.810  0.00564 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.685 on 143 degrees of freedom
##   (14 observations deleted due to missingness)
## Multiple R-squared:  0.6907, Adjusted R-squared:  0.6799 
## F-statistic: 63.88 on 5 and 143 DF,  p-value: < 2.2e-16
r2(M2)
## Warning: 'r2' is deprecated.
## Use 'performance::r2()' instead.
## See help("Deprecated")
## # R2 for Linear Regression
## 
##        R2: 0.268
##   adj. R2: 0.248
anova(M1,M2)
anova(M2,M3)

basic reading model

M7 <- lm(rc3_wj_br_ss_age ~ CWPM_Total +  Passage_e  ,  data = REDmasterPassageCombined)
summary(M7)
## 
## Call:
## lm(formula = rc3_wj_br_ss_age ~ CWPM_Total + Passage_e, data = REDmasterPassageCombined)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -22.3589  -5.6527   0.0374   4.9725  20.2515 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 80.466743   1.921402   41.88   <2e-16 ***
## CWPM_Total   0.131169   0.008267   15.87   <2e-16 ***
## Passage_e    0.625087   1.275740    0.49    0.625    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.849 on 149 degrees of freedom
##   (11 observations deleted due to missingness)
## Multiple R-squared:  0.6282, Adjusted R-squared:  0.6232 
## F-statistic: 125.9 on 2 and 149 DF,  p-value: < 2.2e-16
M8 <- lm(rc3_wj_br_ss_age ~ CWPM_Total +  Passage_e  +  Delta_DSyM_Sum_Combined ,  data = REDmasterPassageCombined)
summary(M8)
## 
## Call:
## lm(formula = rc3_wj_br_ss_age ~ CWPM_Total + Passage_e + Delta_DSyM_Sum_Combined, 
##     data = REDmasterPassageCombined)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -21.2741  -5.1881  -0.1494   4.9544  17.2705 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             89.592247   2.320611  38.607  < 2e-16 ***
## CWPM_Total               0.102438   0.008901  11.508  < 2e-16 ***
## Passage_e                0.376172   1.151915   0.327    0.744    
## Delta_DSyM_Sum_Combined -0.165123   0.027911  -5.916  2.2e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.082 on 148 degrees of freedom
##   (11 observations deleted due to missingness)
## Multiple R-squared:  0.6993, Adjusted R-squared:  0.6932 
## F-statistic: 114.7 on 3 and 148 DF,  p-value: < 2.2e-16
anova(M7,M8)
r2(M7)
## Warning: 'r2' is deprecated.
## Use 'performance::r2()' instead.
## See help("Deprecated")
## # R2 for Linear Regression
## 
##        R2: 0.628
##   adj. R2: 0.623
r2(M8)
## Warning: 'r2' is deprecated.
## Use 'performance::r2()' instead.
## See help("Deprecated")
## # R2 for Linear Regression
## 
##        R2: 0.699
##   adj. R2: 0.693