Data + dealing with NAs

library(readxl)
df <- read_excel("econom.xlsx")
library(naniar)
miss_var_summary(df)

Performing kNN imputation

library(VIM)
set.seed(123)
df_imp <- df %>%
  kNN(variable=c("foreign_language_scores","social_studies_scores","russian_language_scores","math_scores","certificate_social_studiesgrade", "profile", "adaptation2", "intrgoal14", "statanxiety24_1","statanxiety22","testanxiety4", "statanxiety23_1", "statanxiety21_1", "statanxiety15_1", "statanxiety3_1", "testanxiety1", "intrgoal12", "testanxiety3", "statanxiety9_1", "statanxiety13_1", "statanxiety14_1", "statanxiety27", "extrgoal13", "adaptation1", "inter1_5", "statanxiety1_1", "statanxiety18_1", "efficacy17", "statanxiety7_1", "statanxiety12_1", "inter1_6", "efficacy15", "mathanxiety2", "mathanxiety3", "mathanxiety4", "mathanxiety5", "mathanxiety6", "mathanxiety7", "mathanxiety8", "mathanxiety9", "extrgoal11", "statanxiety5_1", "inter1_3", "statanxiety8_1", "efficacy12", "testanxiety5", "statanxiety6_1", "statanxiety16_1", "efficacy13", "intrgoal11", "inter1_1", "inter1_4", "living", "job", "certificate_mathgrade", "certificate_russianlanggrade", "certificate_foreign_langgrade", "father_ISCO", "mother_ISCO"))
miss_var_summary(df_imp)

EFA

Stat anxiety

stat_save1<-c("statanxiety16_1", "statanxiety6_1", "statanxiety8_1", "statanxiety5_1", "statanxiety12_1", "statanxiety7_1", "statanxiety18_1", "statanxiety1_1", "statanxiety14_1", "statanxiety9_1", "statanxiety3_1", "statanxiety15_1", "statanxiety21_1", "statanxiety23_1", "statanxiety22", "statanxiety24_1", "statanxiety10_1", "statanxiety17", "statanxiety28_1", "statanxiety25_1", "statanxiety11", "statanxiety19_1", "statanxiety26_1", "statanxiety4_1", "statanxiety2_1", "statanxiety20_1", "statanxiety13_1", "statanxiety27")
stat_save2<-c("statanxiety16_1", "statanxiety6_1", "statanxiety8_1", "statanxiety5_1", "statanxiety12_1", "statanxiety7_1", "statanxiety18_1", "statanxiety1_1", "statanxiety14_1", "statanxiety9_1", "statanxiety3_1", "statanxiety15_1", "statanxiety21_1", "statanxiety23_1", "statanxiety22", "statanxiety24_1", "statanxiety10_1", "statanxiety17", "statanxiety28_1", "statanxiety25_1", "statanxiety11", "statanxiety19_1", "statanxiety26_1", "statanxiety4_1", "statanxiety2_1", "statanxiety20_1", "statanxiety13_1", "statanxiety27", "math_scores", "social_studies_scores", "russian_language_scores", "foreign_language_scores", "certificate_mathgrade", "certificate_social_studiesgrade", "certificate_russianlanggrade", "certificate_foreign_langgrade", "gpa", "subject_mark")
stat_fa <- df_imp[stat_save1] 
stat_reg <- df_imp[stat_save2] 

Building a factor model with 4 factors

library(psych)
fa1<-fa(stat_fa, 4, cor = "mixed")
fa1
## Factor Analysis using method =  minres
## Call: fa(r = stat_fa, nfactors = 4, cor = "mixed")
## Standardized loadings (pattern matrix) based upon correlation matrix
##                   MR1   MR2   MR3   MR4   h2   u2 com
## statanxiety16_1  0.00  0.67  0.14 -0.12 0.63 0.37 1.2
## statanxiety6_1   0.32  0.28  0.61  0.08 0.81 0.19 2.0
## statanxiety8_1   0.00  0.06  0.63 -0.23 0.58 0.42 1.3
## statanxiety5_1  -0.09 -0.22 -0.03  0.70 0.77 0.23 1.2
## statanxiety12_1  0.14  0.02  0.79  0.06 0.74 0.26 1.1
## statanxiety7_1  -0.02  0.04  0.76  0.00 0.57 0.43 1.0
## statanxiety18_1 -0.10 -0.46  0.00  0.29 0.47 0.53 1.8
## statanxiety1_1  -0.17 -0.24  0.08  0.73 0.81 0.19 1.4
## statanxiety14_1  0.27 -0.43 -0.03  0.48 0.62 0.38 2.6
## statanxiety9_1   0.50 -0.10  0.20 -0.09 0.40 0.60 1.5
## statanxiety3_1   0.58  0.06  0.24  0.03 0.55 0.45 1.4
## statanxiety15_1  0.34 -0.46 -0.05  0.33 0.49 0.51 2.8
## statanxiety21_1 -0.06  0.79  0.14  0.05 0.63 0.37 1.1
## statanxiety23_1  0.72  0.06  0.06 -0.02 0.59 0.41 1.0
## statanxiety22   -0.31 -0.02 -0.29  0.24 0.41 0.59 2.9
## statanxiety24_1 -0.48  0.09  0.07  0.30 0.30 0.70 1.8
## statanxiety10_1 -0.09  0.11 -0.32  0.62 0.58 0.42 1.6
## statanxiety17    0.06  0.54  0.14 -0.02 0.38 0.62 1.2
## statanxiety28_1  0.52 -0.17  0.05 -0.12 0.32 0.68 1.3
## statanxiety25_1  0.71 -0.06  0.11 -0.05 0.60 0.40 1.1
## statanxiety11   -0.02  0.09 -0.44  0.43 0.45 0.55 2.1
## statanxiety19_1  0.15  0.70 -0.01  0.06 0.50 0.50 1.1
## statanxiety26_1  0.59  0.24 -0.24  0.10 0.32 0.68 1.7
## statanxiety4_1   0.65  0.06  0.14 -0.24 0.73 0.27 1.4
## statanxiety2_1   0.43  0.11  0.18 -0.27 0.52 0.48 2.2
## statanxiety20_1  0.10  0.44 -0.11 -0.28 0.39 0.61 2.0
## statanxiety13_1  0.06  0.67 -0.09 -0.19 0.59 0.41 1.2
## statanxiety27    0.57  0.02  0.13  0.19 0.39 0.61 1.3
## 
##                        MR1  MR2  MR3  MR4
## SS loadings           4.46 4.04 3.34 3.32
## Proportion Var        0.16 0.14 0.12 0.12
## Cumulative Var        0.16 0.30 0.42 0.54
## Proportion Explained  0.29 0.27 0.22 0.22
## Cumulative Proportion 0.29 0.56 0.78 1.00
## 
##  With factor correlations of 
##       MR1   MR2   MR3   MR4
## MR1  1.00  0.19  0.52 -0.21
## MR2  0.19  1.00  0.25 -0.53
## MR3  0.52  0.25  1.00 -0.31
## MR4 -0.21 -0.53 -0.31  1.00
## 
## Mean item complexity =  1.6
## Test of the hypothesis that 4 factors are sufficient.
## 
## The degrees of freedom for the null model are  378  and the objective function was  18.91 with Chi Square of  6085
## The degrees of freedom for the model are 272  and the objective function was  3.57 
## 
## The root mean square of the residuals (RMSR) is  0.04 
## The df corrected root mean square of the residuals is  0.05 
## 
## The harmonic number of observations is  333 with the empirical chi square  448.15  with prob <  9e-11 
## The total number of observations was  333  with Likelihood Chi Square =  1139.39  with prob <  1.9e-106 
## 
## Tucker Lewis Index of factoring reliability =  0.787
## RMSEA index =  0.098  and the 90 % confidence intervals are  0.092 0.104
## BIC =  -440.42
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy             
##                                                    MR1  MR2  MR3  MR4
## Correlation of (regression) scores with factors   0.95 0.94 0.95 0.94
## Multiple R square of scores with factors          0.90 0.89 0.89 0.89
## Minimum correlation of possible factor scores     0.79 0.78 0.79 0.78
fa.diagram(fa1)

Description of the model fit:

  • First of all, looking at the factor loadings it can be seen that almost all variables belong to only one factor, this is also proved by the low complexity values.

  • Proportion explained: the explained variance should be evenly distributed among factors which is exactly what we can observe in this case

  • Proportion variance: A factor should explain at least 10% of the variance. In this model it can be seen that all the factors meet this criterion.

  • Cumulative Variance: looking at this parameter we can see that all in all our model explains 54% of variance

  • Also Chi Square of 6104.67 tells us that observed and expected data aren’t significantly different, which is good

  • Tucker Lewis Index of factoring reliability = 0.784, which is not very good measure of model fit (it should be >0.9)

  • RMSR index = 0.04 , which is somewhat good, as it should be <0,05

Scale reliability:

stat_MR1<- as.data.frame(stat_fa [c("statanxiety23_1", "statanxiety25_1", "statanxiety4_1", "statanxiety26_1", "statanxiety27", "statanxiety3_1", "statanxiety28_1", "statanxiety9_1", "statanxiety24_1", "statanxiety2_1", "statanxiety22")])
psych::alpha(stat_MR1,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = stat_MR1, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.85      0.85    0.85      0.34 5.7 0.012  2.7 0.52     0.32
## 
##  lower alpha upper     95% confidence boundaries
## 0.83 0.85 0.88 
## 
##  Reliability if an item is dropped:
##                  raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## statanxiety23_1       0.83      0.83    0.83      0.33 4.9    0.013 0.011  0.31
## statanxiety25_1       0.83      0.83    0.83      0.33 4.9    0.013 0.010  0.31
## statanxiety4_1        0.83      0.82    0.82      0.32 4.7    0.014 0.009  0.30
## statanxiety26_1       0.85      0.85    0.85      0.36 5.7    0.012 0.011  0.34
## statanxiety27         0.85      0.84    0.85      0.35 5.4    0.012 0.012  0.32
## statanxiety3_1        0.84      0.83    0.84      0.33 5.0    0.013 0.011  0.32
## statanxiety28_1       0.85      0.84    0.85      0.35 5.4    0.012 0.013  0.34
## statanxiety9_1        0.84      0.84    0.84      0.34 5.3    0.012 0.013  0.31
## statanxiety24_1-      0.85      0.85    0.85      0.36 5.5    0.012 0.012  0.34
## statanxiety2_1        0.84      0.84    0.84      0.34 5.2    0.013 0.011  0.31
## statanxiety22-        0.84      0.84    0.84      0.35 5.3    0.012 0.012  0.32
## 
##  Item statistics 
##                    n raw.r std.r r.cor r.drop mean   sd
## statanxiety23_1  333  0.73  0.73  0.71   0.66  2.8 0.77
## statanxiety25_1  333  0.74  0.74  0.71   0.66  2.7 0.86
## statanxiety4_1   333  0.79  0.78  0.78   0.72  2.1 0.93
## statanxiety26_1  333  0.48  0.49  0.40   0.37  3.0 0.74
## statanxiety27    333  0.55  0.57  0.50   0.46  2.9 0.74
## statanxiety3_1   333  0.71  0.68  0.65   0.60  2.9 0.97
## statanxiety28_1  333  0.57  0.57  0.50   0.46  2.7 0.82
## statanxiety9_1   333  0.62  0.62  0.56   0.52  2.3 0.78
## statanxiety24_1- 333  0.52  0.54  0.47   0.43  3.1 0.72
## statanxiety2_1   333  0.66  0.64  0.60   0.56  2.3 0.86
## statanxiety22-   333  0.59  0.60  0.55   0.50  2.8 0.78
## 
## Non missing response frequency for each item
##                    1    2    3    4 miss
## statanxiety23_1 0.03 0.32 0.46 0.19    0
## statanxiety25_1 0.06 0.35 0.38 0.21    0
## statanxiety4_1  0.29 0.41 0.21 0.09    0
## statanxiety26_1 0.04 0.18 0.56 0.22    0
## statanxiety27   0.04 0.21 0.55 0.20    0
## statanxiety3_1  0.08 0.28 0.29 0.34    0
## statanxiety28_1 0.06 0.35 0.42 0.17    0
## statanxiety9_1  0.14 0.54 0.25 0.07    0
## statanxiety24_1 0.29 0.53 0.16 0.02    0
## statanxiety2_1  0.15 0.45 0.29 0.10    0
## statanxiety22   0.20 0.47 0.29 0.04    0

Cronbach’s alpha is 0.8517994, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

NAME OF THE SCALE: Difficulty

stat_MR2<- as.data.frame(stat_fa [c("statanxiety21_1", "statanxiety19_1", "statanxiety16_1", "statanxiety13_1", "statanxiety17", "statanxiety18_1", "statanxiety15_1", "statanxiety20_1")])
psych::alpha(stat_MR2,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = stat_MR2, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.83      0.83    0.82      0.38 4.8 0.014  1.9 0.55     0.37
## 
##  lower alpha upper     95% confidence boundaries
## 0.8 0.83 0.85 
## 
##  Reliability if an item is dropped:
##                  raw_alpha std.alpha G6(smc) average_r S/N alpha se  var.r
## statanxiety21_1       0.80      0.80    0.78      0.36 4.0    0.017 0.0037
## statanxiety19_1       0.80      0.81    0.79      0.37 4.2    0.016 0.0049
## statanxiety16_1       0.80      0.80    0.78      0.36 4.0    0.017 0.0045
## statanxiety13_1       0.80      0.80    0.78      0.37 4.1    0.016 0.0050
## statanxiety17         0.81      0.82    0.80      0.39 4.4    0.016 0.0049
## statanxiety18_1-      0.81      0.81    0.79      0.38 4.2    0.016 0.0053
## statanxiety15_1-      0.82      0.82    0.80      0.40 4.6    0.015 0.0038
## statanxiety20_1       0.82      0.82    0.80      0.39 4.5    0.015 0.0051
##                  med.r
## statanxiety21_1   0.37
## statanxiety19_1   0.37
## statanxiety16_1   0.36
## statanxiety13_1   0.37
## statanxiety17     0.39
## statanxiety18_1-  0.37
## statanxiety15_1-  0.39
## statanxiety20_1   0.39
## 
##  Item statistics 
##                    n raw.r std.r r.cor r.drop mean   sd
## statanxiety21_1  333  0.73  0.73  0.69   0.62  2.0 0.82
## statanxiety19_1  333  0.70  0.69  0.63   0.57  1.8 0.86
## statanxiety16_1  333  0.73  0.74  0.69   0.63  1.7 0.80
## statanxiety13_1  333  0.69  0.71  0.67   0.60  1.5 0.69
## statanxiety17    333  0.62  0.63  0.55   0.50  1.7 0.75
## statanxiety18_1- 333  0.69  0.67  0.61   0.55  2.8 0.94
## statanxiety15_1- 333  0.60  0.60  0.51   0.46  1.9 0.82
## statanxiety20_1  333  0.63  0.62  0.53   0.49  1.9 0.86
## 
## Non missing response frequency for each item
##                    1    2    3    4 miss
## statanxiety21_1 0.30 0.51 0.13 0.06    0
## statanxiety19_1 0.41 0.41 0.12 0.06    0
## statanxiety16_1 0.47 0.40 0.09 0.04    0
## statanxiety13_1 0.55 0.37 0.06 0.02    0
## statanxiety17   0.44 0.44 0.10 0.03    0
## statanxiety18_1 0.24 0.39 0.26 0.11    0
## statanxiety15_1 0.05 0.16 0.47 0.33    0
## statanxiety20_1 0.41 0.36 0.20 0.04    0

Cronbach’s alpha is 0.8296787, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

NAME OF THE SCALE: Value

stat_MR3<- as.data.frame(stat_fa [c("statanxiety12_1", "statanxiety7_1", "statanxiety8_1", "statanxiety6_1")])
psych::alpha(stat_MR3,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = stat_MR3, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.83      0.83     0.8      0.55   5 0.015    2 0.72     0.56
## 
##  lower alpha upper     95% confidence boundaries
## 0.8 0.83 0.86 
## 
##  Reliability if an item is dropped:
##                 raw_alpha std.alpha G6(smc) average_r S/N alpha se  var.r med.r
## statanxiety12_1      0.77      0.77    0.70      0.53 3.4    0.022 0.0034  0.53
## statanxiety7_1       0.80      0.80    0.73      0.57 4.0    0.019 0.0064  0.59
## statanxiety8_1       0.81      0.81    0.75      0.59 4.3    0.018 0.0033  0.61
## statanxiety6_1       0.77      0.77    0.69      0.52 3.3    0.022 0.0058  0.48
## 
##  Item statistics 
##                   n raw.r std.r r.cor r.drop mean   sd
## statanxiety12_1 333  0.83  0.84  0.77   0.70  2.2 0.85
## statanxiety7_1  333  0.80  0.80  0.70   0.64  2.0 0.90
## statanxiety8_1  333  0.78  0.78  0.67   0.61  1.9 0.85
## statanxiety6_1  333  0.85  0.84  0.78   0.71  2.1 0.93
## 
## Non missing response frequency for each item
##                    1    2    3    4 miss
## statanxiety12_1 0.21 0.49 0.22 0.08    0
## statanxiety7_1  0.35 0.40 0.18 0.07    0
## statanxiety8_1  0.37 0.44 0.13 0.06    0
## statanxiety6_1  0.26 0.43 0.20 0.11    0

Cronbach’s alpha is 0.8315706, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

NAME OF THE SCALE: Cognitive competences

stat_MR4<- as.data.frame(stat_fa [c("statanxiety1_1", "statanxiety5_1", "statanxiety10_1", "statanxiety14_1", "statanxiety11")])
psych::alpha(stat_MR4,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = stat_MR4, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.81      0.81     0.8      0.46 4.2 0.017  2.7 0.64     0.47
## 
##  lower alpha upper     95% confidence boundaries
## 0.78 0.81 0.84 
## 
##  Reliability if an item is dropped:
##                 raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## statanxiety1_1       0.72      0.73    0.69      0.40 2.6    0.025 0.014  0.42
## statanxiety5_1       0.72      0.73    0.69      0.40 2.7    0.025 0.015  0.43
## statanxiety10_1      0.78      0.77    0.76      0.46 3.4    0.020 0.039  0.45
## statanxiety14_1      0.80      0.80    0.79      0.50 3.9    0.018 0.022  0.47
## statanxiety11        0.81      0.81    0.79      0.52 4.3    0.016 0.021  0.50
## 
##  Item statistics 
##                   n raw.r std.r r.cor r.drop mean   sd
## statanxiety1_1  333  0.85  0.84  0.84   0.74  2.6 0.88
## statanxiety5_1  333  0.85  0.84  0.83   0.73  2.4 0.89
## statanxiety10_1 333  0.72  0.74  0.64   0.57  2.8 0.75
## statanxiety14_1 333  0.70  0.69  0.56   0.51  2.9 0.91
## statanxiety11   333  0.63  0.65  0.51   0.44  2.6 0.80
## 
## Non missing response frequency for each item
##                    1    2    3    4 miss
## statanxiety1_1  0.13 0.30 0.44 0.13    0
## statanxiety5_1  0.16 0.37 0.36 0.11    0
## statanxiety10_1 0.06 0.25 0.56 0.13    0
## statanxiety14_1 0.08 0.19 0.42 0.30    0
## statanxiety11   0.08 0.33 0.47 0.12    0

Cronbach’s alpha is 0.806576, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

NAME OF THE SCALE: Affect

Adding factors to the data set:

fascores<-as.data.frame(fa1$scores)
data_reg1<-cbind(stat_reg,fascores)

names(data_reg1)[names(data_reg1) == "MR1"] <- "stat_difficulty"
names(data_reg1)[names(data_reg1) == "MR2"] <- "stat_value"
names(data_reg1)[names(data_reg1) == "MR3"] <- "stat_cognitivecomp"
names(data_reg1)[names(data_reg1) == "MR4"] <- "stat_affect"
names(data_reg1)
##  [1] "statanxiety16_1"                 "statanxiety6_1"                 
##  [3] "statanxiety8_1"                  "statanxiety5_1"                 
##  [5] "statanxiety12_1"                 "statanxiety7_1"                 
##  [7] "statanxiety18_1"                 "statanxiety1_1"                 
##  [9] "statanxiety14_1"                 "statanxiety9_1"                 
## [11] "statanxiety3_1"                  "statanxiety15_1"                
## [13] "statanxiety21_1"                 "statanxiety23_1"                
## [15] "statanxiety22"                   "statanxiety24_1"                
## [17] "statanxiety10_1"                 "statanxiety17"                  
## [19] "statanxiety28_1"                 "statanxiety25_1"                
## [21] "statanxiety11"                   "statanxiety19_1"                
## [23] "statanxiety26_1"                 "statanxiety4_1"                 
## [25] "statanxiety2_1"                  "statanxiety20_1"                
## [27] "statanxiety13_1"                 "statanxiety27"                  
## [29] "math_scores"                     "social_studies_scores"          
## [31] "russian_language_scores"         "foreign_language_scores"        
## [33] "certificate_mathgrade"           "certificate_social_studiesgrade"
## [35] "certificate_russianlanggrade"    "certificate_foreign_langgrade"  
## [37] "gpa"                             "subject_mark"                   
## [39] "stat_difficulty"                 "stat_value"                     
## [41] "stat_cognitivecomp"              "stat_affect"

MSLQ scales

mslq_save1<-c("extrgoal14", "extrgoal12", "extrgoal13", "extrgoal11", "intrgoal14", "intrgoal12", "intrgoal13", "intrgoal11", "efficacy18", "efficacy17", "efficacy15", "efficacy12", "efficacy13", "testanxiety2", "testanxiety4", "testanxiety1", "testanxiety3", "testanxiety5")

mslq_fa <- df_imp[mslq_save1] 
mslq_save2<-c("extrgoal14", "extrgoal12", "extrgoal13", "extrgoal11", "intrgoal14", "intrgoal12", "intrgoal13", "intrgoal11", "efficacy18", "efficacy17", "efficacy15", "efficacy12", "efficacy13", "testanxiety2", "testanxiety4", "testanxiety1", "testanxiety3", "testanxiety5", "math_scores", "social_studies_scores", "russian_language_scores", "foreign_language_scores", "certificate_mathgrade", "certificate_social_studiesgrade", "certificate_russianlanggrade", "certificate_foreign_langgrade", "gpa", "subject_mark")

mslq_reg <- df_imp[mslq_save2] 

Building a factor model with 4 factors

fa2<-fa(mslq_fa, 4, cor = "mixed")
fa2
## Factor Analysis using method =  minres
## Call: fa(r = mslq_fa, nfactors = 4, cor = "mixed")
## Standardized loadings (pattern matrix) based upon correlation matrix
##                MR1   MR3   MR2   MR4   h2   u2 com
## extrgoal14   -0.03  0.31  0.09  0.49 0.42 0.58 1.8
## extrgoal12   -0.14 -0.03 -0.08  0.84 0.68 0.32 1.1
## extrgoal13    0.29 -0.08  0.10  0.53 0.37 0.63 1.7
## extrgoal11    0.12  0.01  0.09  0.79 0.70 0.30 1.1
## intrgoal14    0.05  0.76 -0.08  0.02 0.63 0.37 1.0
## intrgoal12    0.04  0.87 -0.03  0.02 0.81 0.19 1.0
## intrgoal13    0.09  0.63 -0.01 -0.01 0.46 0.54 1.0
## intrgoal11    0.28  0.61  0.00 -0.04 0.63 0.37 1.4
## efficacy18    0.60  0.22 -0.08 -0.05 0.57 0.43 1.3
## efficacy17    0.75  0.20  0.03  0.01 0.75 0.25 1.1
## efficacy15    0.87 -0.03 -0.08  0.00 0.78 0.22 1.0
## efficacy12    0.71  0.17  0.06  0.02 0.63 0.37 1.1
## efficacy13    0.65  0.10  0.07  0.03 0.49 0.51 1.1
## testanxiety2 -0.22  0.22  0.30  0.03 0.19 0.81 2.8
## testanxiety4  0.07 -0.09  0.87  0.06 0.77 0.23 1.0
## testanxiety1 -0.43  0.18  0.54  0.01 0.57 0.43 2.2
## testanxiety3 -0.29  0.17  0.58  0.13 0.58 0.42 1.8
## testanxiety5  0.06 -0.10  0.79 -0.03 0.59 0.41 1.0
## 
##                        MR1  MR3  MR2  MR4
## SS loadings           3.50 2.75 2.34 2.00
## Proportion Var        0.19 0.15 0.13 0.11
## Cumulative Var        0.19 0.35 0.48 0.59
## Proportion Explained  0.33 0.26 0.22 0.19
## Cumulative Proportion 0.33 0.59 0.81 1.00
## 
##  With factor correlations of 
##       MR1  MR3   MR2   MR4
## MR1  1.00 0.51 -0.28 -0.02
## MR3  0.51 1.00  0.01  0.16
## MR2 -0.28 0.01  1.00  0.44
## MR4 -0.02 0.16  0.44  1.00
## 
## Mean item complexity =  1.4
## Test of the hypothesis that 4 factors are sufficient.
## 
## The degrees of freedom for the null model are  153  and the objective function was  10.02 with Chi Square of  3258.38
## The degrees of freedom for the model are 87  and the objective function was  0.7 
## 
## The root mean square of the residuals (RMSR) is  0.03 
## The df corrected root mean square of the residuals is  0.04 
## 
## The harmonic number of observations is  333 with the empirical chi square  72.42  with prob <  0.87 
## The total number of observations was  333  with Likelihood Chi Square =  227.27  with prob <  1.8e-14 
## 
## Tucker Lewis Index of factoring reliability =  0.92
## RMSEA index =  0.07  and the 90 % confidence intervals are  0.059 0.081
## BIC =  -278.03
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy             
##                                                    MR1  MR3  MR2  MR4
## Correlation of (regression) scores with factors   0.95 0.95 0.93 0.92
## Multiple R square of scores with factors          0.91 0.89 0.87 0.85
## Minimum correlation of possible factor scores     0.82 0.79 0.75 0.69
fa.diagram(fa2)

Description of the model fit:

  • First of all, looking at the factor loadings it can be seen that almost all variables belong to only one factor, this is also proved by the low complexity values.

  • Proportion explained: the explained variance should be evenly distributed among factors.In this case the first factor explain the largest proportion of variance which is 33% but still more or less clode to all the other factors.

  • Proportion variance: A factor should explain at least 10% of the variance. In this model it can be seen that all the factors meet this criterion.

  • Cumulative Variance: looking at this parameter we can see that all in all our model explains 100% of variance

  • Also Chi Square of 3249.21 tells us that observed and expected data aren’t significantly different, which is good

  • Tucker Lewis Index of factoring reliability = 0.919, which is very good measure of model fit (it should be >0.9)

  • RMSR index = 0.03 , which is somewhat good, as it should be <0,05

Scale relaibility:

mslq_MR1<- as.data.frame(mslq_fa [c("efficacy18", "efficacy17", "efficacy15", "efficacy12", "efficacy13")])
psych::alpha(mslq_MR1,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = mslq_MR1, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.85      0.86    0.83      0.54 5.9 0.012  2.7 0.71     0.54
## 
##  lower alpha upper     95% confidence boundaries
## 0.83 0.85 0.88 
## 
##  Reliability if an item is dropped:
##            raw_alpha std.alpha G6(smc) average_r S/N alpha se  var.r med.r
## efficacy18      0.83      0.83    0.80      0.56 5.0    0.015 0.0069  0.55
## efficacy17      0.81      0.81    0.77      0.51 4.2    0.017 0.0046  0.48
## efficacy15      0.81      0.81    0.78      0.52 4.4    0.017 0.0054  0.50
## efficacy12      0.82      0.82    0.78      0.54 4.6    0.016 0.0063  0.54
## efficacy13      0.85      0.85    0.82      0.59 5.7    0.014 0.0043  0.60
## 
##  Item statistics 
##              n raw.r std.r r.cor r.drop mean   sd
## efficacy18 333  0.77  0.78  0.69   0.64  2.7 0.85
## efficacy17 333  0.84  0.85  0.81   0.75  2.9 0.84
## efficacy15 333  0.83  0.83  0.78   0.72  2.3 0.92
## efficacy12 333  0.82  0.80  0.74   0.68  2.4 1.01
## efficacy13 333  0.72  0.73  0.61   0.57  3.1 0.85
## 
## Non missing response frequency for each item
##               1    2    3    4 miss
## efficacy18 0.10 0.28 0.46 0.16    0
## efficacy17 0.06 0.21 0.46 0.27    0
## efficacy15 0.23 0.38 0.30 0.10    0
## efficacy12 0.22 0.31 0.30 0.17    0
## efficacy13 0.05 0.18 0.43 0.34    0

Cronbach’s alpha is 0.8553633, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

mslq_MR4<- as.data.frame(mslq_fa [c("intrgoal14", "intrgoal12", "intrgoal13", "intrgoal11")])
psych::alpha(mslq_MR4,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = mslq_MR4, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.83      0.83    0.79      0.54 4.8 0.016  2.3 0.76     0.53
## 
##  lower alpha upper     95% confidence boundaries
## 0.8 0.83 0.86 
## 
##  Reliability if an item is dropped:
##            raw_alpha std.alpha G6(smc) average_r S/N alpha se  var.r med.r
## intrgoal14      0.77      0.77    0.70      0.53 3.3    0.022 0.0103  0.51
## intrgoal12      0.74      0.74    0.66      0.48 2.8    0.025 0.0032  0.47
## intrgoal13      0.83      0.83    0.77      0.61 4.8    0.016 0.0035  0.64
## intrgoal11      0.78      0.78    0.72      0.55 3.6    0.021 0.0097  0.51
## 
##  Item statistics 
##              n raw.r std.r r.cor r.drop mean   sd
## intrgoal14 333  0.82  0.83  0.75   0.68  2.1 0.91
## intrgoal12 333  0.87  0.87  0.82   0.74  2.3 0.95
## intrgoal13 333  0.75  0.75  0.60   0.55  2.5 0.95
## intrgoal11 333  0.80  0.81  0.71   0.65  2.2 0.91
## 
## Non missing response frequency for each item
##               1    2    3    4 miss
## intrgoal14 0.27 0.44 0.20 0.10    0
## intrgoal12 0.21 0.42 0.24 0.14    0
## intrgoal13 0.17 0.32 0.36 0.15    0
## intrgoal11 0.26 0.43 0.22 0.09    0

Cronbach’s alpha is 0.8243069, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

mslq_MR2<- as.data.frame(mslq_fa [c("testanxiety4", "testanxiety1", "testanxiety3", "testanxiety5")])
psych::alpha(mslq_MR2,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = mslq_MR2, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.79      0.79    0.76      0.49 3.8 0.019  2.9 0.77     0.48
## 
##  lower alpha upper     95% confidence boundaries
## 0.75 0.79 0.83 
## 
##  Reliability if an item is dropped:
##              raw_alpha std.alpha G6(smc) average_r S/N alpha se  var.r med.r
## testanxiety4      0.71      0.71    0.63      0.45 2.5    0.027 0.0047  0.42
## testanxiety1      0.75      0.76    0.69      0.51 3.1    0.024 0.0110  0.49
## testanxiety3      0.74      0.75    0.68      0.50 3.0    0.025 0.0124  0.47
## testanxiety5      0.75      0.75    0.66      0.50 3.0    0.024 0.0011  0.49
## 
##  Item statistics 
##                n raw.r std.r r.cor r.drop mean   sd
## testanxiety4 333  0.81  0.82  0.75   0.66  3.2 0.89
## testanxiety1 333  0.77  0.77  0.64   0.57  2.8 1.00
## testanxiety3 333  0.79  0.78  0.66   0.59  2.8 1.06
## testanxiety5 333  0.77  0.78  0.68   0.58  3.0 0.98
## 
## Non missing response frequency for each item
##                 1    2    3    4 miss
## testanxiety4 0.05 0.17 0.31 0.47    0
## testanxiety1 0.11 0.28 0.29 0.33    0
## testanxiety3 0.15 0.23 0.30 0.32    0
## testanxiety5 0.10 0.20 0.35 0.36    0

Cronbach’s alpha is 0.7941098, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

mslq_MR3<- as.data.frame(mslq_fa [c("extrgoal14", "extrgoal12", "extrgoal13", "extrgoal11")])
psych::alpha(mslq_MR3,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = mslq_MR3, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.72      0.72    0.67      0.39 2.6 0.025  2.8 0.71     0.38
## 
##  lower alpha upper     95% confidence boundaries
## 0.67 0.72 0.77 
## 
##  Reliability if an item is dropped:
##            raw_alpha std.alpha G6(smc) average_r S/N alpha se  var.r med.r
## extrgoal14      0.69      0.70    0.63      0.43 2.3    0.028 0.0157  0.44
## extrgoal12      0.62      0.63    0.54      0.36 1.7    0.036 0.0068  0.37
## extrgoal13      0.70      0.70    0.62      0.44 2.4    0.029 0.0101  0.39
## extrgoal11      0.59      0.59    0.49      0.32 1.4    0.038 0.0037  0.31
## 
##  Item statistics 
##              n raw.r std.r r.cor r.drop mean   sd
## extrgoal14 333  0.71  0.69  0.51   0.44  2.1 1.05
## extrgoal12 333  0.79  0.76  0.66   0.55  2.6 1.07
## extrgoal13 333  0.65  0.69  0.51   0.42  3.4 0.83
## extrgoal11 333  0.79  0.80  0.73   0.61  3.1 0.92
## 
## Non missing response frequency for each item
##               1    2    3    4 miss
## extrgoal14 0.35 0.29 0.22 0.14    0
## extrgoal12 0.18 0.26 0.29 0.27    0
## extrgoal13 0.04 0.09 0.28 0.58    0
## extrgoal11 0.08 0.14 0.36 0.42    0

Cronbach’s alpha is 0.7190665, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

Adding factors to the data set:

fascores2<-as.data.frame(fa2$scores)
data_reg2<-cbind(mslq_reg,fascores2)

names(data_reg2)[names(data_reg2) == "MR1"] <- "efficacy"
names(data_reg2)[names(data_reg2) == "MR2"] <- "testanxiety"
names(data_reg2)[names(data_reg2) == "MR3"] <- "extrgoal"
names(data_reg2)[names(data_reg2) == "MR4"] <- "intrgoal"
names(data_reg2)
##  [1] "extrgoal14"                      "extrgoal12"                     
##  [3] "extrgoal13"                      "extrgoal11"                     
##  [5] "intrgoal14"                      "intrgoal12"                     
##  [7] "intrgoal13"                      "intrgoal11"                     
##  [9] "efficacy18"                      "efficacy17"                     
## [11] "efficacy15"                      "efficacy12"                     
## [13] "efficacy13"                      "testanxiety2"                   
## [15] "testanxiety4"                    "testanxiety1"                   
## [17] "testanxiety3"                    "testanxiety5"                   
## [19] "math_scores"                     "social_studies_scores"          
## [21] "russian_language_scores"         "foreign_language_scores"        
## [23] "certificate_mathgrade"           "certificate_social_studiesgrade"
## [25] "certificate_russianlanggrade"    "certificate_foreign_langgrade"  
## [27] "gpa"                             "subject_mark"                   
## [29] "efficacy"                        "extrgoal"                       
## [31] "testanxiety"                     "intrgoal"

MATH

math_save1<-c("mathanxiety2", "mathanxiety3", "mathanxiety4", "mathanxiety5", "mathanxiety6", "mathanxiety7", "mathanxiety8", "mathanxiety9")

math_fa <- df_imp[math_save1] 
math_save2<-c("mathanxiety2", "mathanxiety3", "mathanxiety4", "mathanxiety5", "mathanxiety6", "mathanxiety7", "mathanxiety8", "mathanxiety9", "math_scores", "social_studies_scores", "russian_language_scores", "foreign_language_scores", "certificate_mathgrade", "certificate_social_studiesgrade", "certificate_russianlanggrade", "certificate_foreign_langgrade", "gpa", "subject_mark")

math_reg <- df_imp[math_save2] 

Building a factor model with 1 factor

fa3<-fa(math_fa, 1, cor = "mixed")
fa3
## Factor Analysis using method =  minres
## Call: fa(r = math_fa, nfactors = 1, cor = "mixed")
## Standardized loadings (pattern matrix) based upon correlation matrix
##               MR1   h2   u2 com
## mathanxiety2 0.71 0.51 0.49   1
## mathanxiety3 0.79 0.62 0.38   1
## mathanxiety4 0.74 0.54 0.46   1
## mathanxiety5 0.70 0.48 0.52   1
## mathanxiety6 0.81 0.66 0.34   1
## mathanxiety7 0.78 0.61 0.39   1
## mathanxiety8 0.75 0.56 0.44   1
## mathanxiety9 0.82 0.68 0.32   1
## 
##                 MR1
## SS loadings    4.66
## Proportion Var 0.58
## 
## Mean item complexity =  1
## Test of the hypothesis that 1 factor is sufficient.
## 
## The degrees of freedom for the null model are  28  and the objective function was  6.02 with Chi Square of  1978.99
## The degrees of freedom for the model are 20  and the objective function was  1.45 
## 
## The root mean square of the residuals (RMSR) is  0.11 
## The df corrected root mean square of the residuals is  0.13 
## 
## The harmonic number of observations is  333 with the empirical chi square  220.25  with prob <  1.1e-35 
## The total number of observations was  333  with Likelihood Chi Square =  475.34  with prob <  4.2e-88 
## 
## Tucker Lewis Index of factoring reliability =  0.673
## RMSEA index =  0.261  and the 90 % confidence intervals are  0.242 0.283
## BIC =  359.17
## Fit based upon off diagonal values = 0.97
## Measures of factor score adequacy             
##                                                    MR1
## Correlation of (regression) scores with factors   0.96
## Multiple R square of scores with factors          0.92
## Minimum correlation of possible factor scores     0.84
fa.diagram(fa3)

Description of the model fit:

  • Proportion Var 0.58

  • Also Chi Square of 474.78 tells us that observed and expected data aren’t significantly different, which is good

  • Tucker Lewis Index of factoring reliability = 0.673, which is not very good measure of model fit (it should be >0.9)

  • RMSR index = 0.11 , which is also not very good, as it should be <0,05

Scale relaibility:

math_MR1<- as.data.frame(math_fa [c("mathanxiety2", "mathanxiety3", "mathanxiety4", "mathanxiety5", "mathanxiety6", "mathanxiety7", "mathanxiety8", "mathanxiety9")])
psych::alpha(math_MR1,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = math_MR1, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N  ase mean   sd median_r
##       0.88      0.88    0.89      0.47 7.2 0.01  2.3 0.67     0.46
## 
##  lower alpha upper     95% confidence boundaries
## 0.86 0.88 0.9 
## 
##  Reliability if an item is dropped:
##              raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## mathanxiety2      0.87      0.87    0.87      0.48 6.5    0.011 0.013  0.47
## mathanxiety3      0.86      0.86    0.88      0.47 6.1    0.012 0.020  0.42
## mathanxiety4      0.86      0.86    0.87      0.48 6.3    0.011 0.016  0.47
## mathanxiety5      0.87      0.87    0.88      0.49 6.7    0.011 0.017  0.51
## mathanxiety6      0.86      0.86    0.87      0.46 6.0    0.012 0.015  0.46
## mathanxiety7      0.86      0.86    0.87      0.47 6.2    0.012 0.013  0.47
## mathanxiety8      0.87      0.87    0.88      0.49 6.6    0.011 0.013  0.46
## mathanxiety9      0.86      0.86    0.87      0.47 6.1    0.012 0.018  0.46
## 
##  Item statistics 
##                n raw.r std.r r.cor r.drop mean   sd
## mathanxiety2 333  0.71  0.71  0.68   0.61  3.1 0.89
## mathanxiety3 333  0.77  0.77  0.72   0.68  2.6 0.97
## mathanxiety4 333  0.73  0.73  0.69   0.64  2.9 0.92
## mathanxiety5 333  0.68  0.68  0.61   0.57  3.2 0.88
## mathanxiety6 333  0.79  0.78  0.76   0.70  2.0 0.96
## mathanxiety7 333  0.75  0.75  0.72   0.66  1.8 0.92
## mathanxiety8 333  0.69  0.69  0.64   0.59  1.5 0.83
## mathanxiety9 333  0.77  0.77  0.73   0.68  1.7 0.91
## 
## Non missing response frequency for each item
##                 1    2    3    4 miss
## mathanxiety2 0.06 0.18 0.37 0.39    0
## mathanxiety3 0.16 0.31 0.35 0.18    0
## mathanxiety4 0.08 0.24 0.38 0.30    0
## mathanxiety5 0.06 0.13 0.36 0.45    0
## mathanxiety6 0.38 0.32 0.23 0.08    0
## mathanxiety7 0.50 0.31 0.12 0.07    0
## mathanxiety8 0.63 0.24 0.08 0.05    0
## mathanxiety9 0.52 0.30 0.11 0.07    0

Cronbach’s alpha is 0.878703, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

Adding factors to the data set:

fascores3<-as.data.frame(fa3$scores)
data_reg3<-cbind(math_reg,fascores3)

names(data_reg3)[names(data_reg3) == "MR1"] <- "mathanxiety"
names(data_reg3)
##  [1] "mathanxiety2"                    "mathanxiety3"                   
##  [3] "mathanxiety4"                    "mathanxiety5"                   
##  [5] "mathanxiety6"                    "mathanxiety7"                   
##  [7] "mathanxiety8"                    "mathanxiety9"                   
##  [9] "math_scores"                     "social_studies_scores"          
## [11] "russian_language_scores"         "foreign_language_scores"        
## [13] "certificate_mathgrade"           "certificate_social_studiesgrade"
## [15] "certificate_russianlanggrade"    "certificate_foreign_langgrade"  
## [17] "gpa"                             "subject_mark"                   
## [19] "mathanxiety"

Interest

interest_save1<-c("inter1_2", "inter1_5", "inter1_6", "inter1_3", "inter1_1", "inter1_4")

interest_fa <- df_imp[interest_save1] 
interest_save2<-c("inter1_2", "inter1_5", "inter1_6", "inter1_3", "inter1_1", "inter1_4", "math_scores", "social_studies_scores", "russian_language_scores", "foreign_language_scores", "certificate_mathgrade", "certificate_social_studiesgrade", "certificate_russianlanggrade", "certificate_foreign_langgrade", "gpa", "subject_mark")

interest_reg <- df_imp[interest_save2] 

Building a factor model with 1 factor

fa4<-fa(interest_fa, 1, cor = "mixed")
fa4
## Factor Analysis using method =  minres
## Call: fa(r = interest_fa, nfactors = 1, cor = "mixed")
## Standardized loadings (pattern matrix) based upon correlation matrix
##            MR1   h2   u2 com
## inter1_2 -0.82 0.67 0.33   1
## inter1_5  0.83 0.69 0.31   1
## inter1_6  0.86 0.74 0.26   1
## inter1_3  0.93 0.87 0.13   1
## inter1_1  0.92 0.84 0.16   1
## inter1_4  0.84 0.70 0.30   1
## 
##                 MR1
## SS loadings    4.51
## Proportion Var 0.75
## 
## Mean item complexity =  1
## Test of the hypothesis that 1 factor is sufficient.
## 
## The degrees of freedom for the null model are  15  and the objective function was  5.73 with Chi Square of  1886.06
## The degrees of freedom for the model are 9  and the objective function was  0.14 
## 
## The root mean square of the residuals (RMSR) is  0.02 
## The df corrected root mean square of the residuals is  0.03 
## 
## The harmonic number of observations is  333 with the empirical chi square  5.24  with prob <  0.81 
## The total number of observations was  333  with Likelihood Chi Square =  46.64  with prob <  4.6e-07 
## 
## Tucker Lewis Index of factoring reliability =  0.966
## RMSEA index =  0.112  and the 90 % confidence intervals are  0.082 0.145
## BIC =  -5.64
## Fit based upon off diagonal values = 1
## Measures of factor score adequacy             
##                                                    MR1
## Correlation of (regression) scores with factors   0.98
## Multiple R square of scores with factors          0.96
## Minimum correlation of possible factor scores     0.91
fa.diagram(fa4)

Description of the model fit:

  • Proportion Var 0.75

  • Also Chi Square of 1887.07 tells us that observed and expected data aren’t significantly different, which is good

  • Tucker Lewis Index of factoring reliability = 0.967, which is very good measure of model fit (it should be >0.9)

  • RMSR index = 0.02 , which is also very good, as it should be <0,05

Scale relaibility:

interest_MR1<- as.data.frame(interest_fa [c("inter1_2", "inter1_5", "inter1_6", "inter1_3", "inter1_1", "inter1_4")])
psych::alpha(interest_MR1,check.keys = TRUE)
## 
## Reliability analysis   
## Call: psych::alpha(x = interest_MR1, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N    ase mean   sd median_r
##       0.92      0.92    0.91      0.67  12 0.0066  2.5 0.82     0.67
## 
##  lower alpha upper     95% confidence boundaries
## 0.91 0.92 0.94 
## 
##  Reliability if an item is dropped:
##           raw_alpha std.alpha G6(smc) average_r  S/N alpha se  var.r med.r
## inter1_2-      0.91      0.91    0.90      0.68 10.7   0.0074 0.0026  0.70
## inter1_5       0.91      0.91    0.90      0.68 10.7   0.0074 0.0028  0.70
## inter1_6       0.91      0.91    0.90      0.67 10.2   0.0078 0.0039  0.69
## inter1_3       0.90      0.90    0.88      0.64  8.9   0.0088 0.0026  0.63
## inter1_1       0.90      0.90    0.89      0.65  9.2   0.0085 0.0031  0.63
## inter1_4       0.91      0.91    0.90      0.67 10.3   0.0077 0.0032  0.69
## 
##  Item statistics 
##             n raw.r std.r r.cor r.drop mean   sd
## inter1_2- 333  0.82  0.82  0.77   0.74  2.7 0.99
## inter1_5  333  0.82  0.82  0.77   0.73  2.8 0.96
## inter1_6  333  0.84  0.84  0.80   0.76  2.1 0.95
## inter1_3  333  0.90  0.90  0.89   0.85  2.6 0.96
## inter1_1  333  0.88  0.88  0.86   0.83  2.3 0.97
## inter1_4  333  0.84  0.84  0.79   0.76  2.5 0.96
## 
## Non missing response frequency for each item
##             1    2    3    4 miss
## inter1_2 0.24 0.36 0.26 0.15    0
## inter1_5 0.13 0.21 0.41 0.25    0
## inter1_6 0.32 0.38 0.20 0.10    0
## inter1_3 0.15 0.29 0.37 0.19    0
## inter1_1 0.24 0.39 0.24 0.13    0
## inter1_4 0.16 0.32 0.35 0.18    0

Cronbach’s alpha is 0.9229752, which indicates good scale reliability. Which means that if we use this scale to measure this construct multiple times we will get the same results showing very good internal consistency.

Adding factors to the data set:

fascores4<-as.data.frame(fa4$scores)
data_reg4<-cbind(interest_reg,fascores4)

names(data_reg4)[names(data_reg4) == "MR1"] <- "interest"
names(data_reg4)
##  [1] "inter1_2"                        "inter1_5"                       
##  [3] "inter1_6"                        "inter1_3"                       
##  [5] "inter1_1"                        "inter1_4"                       
##  [7] "math_scores"                     "social_studies_scores"          
##  [9] "russian_language_scores"         "foreign_language_scores"        
## [11] "certificate_mathgrade"           "certificate_social_studiesgrade"
## [13] "certificate_russianlanggrade"    "certificate_foreign_langgrade"  
## [15] "gpa"                             "subject_mark"                   
## [17] "interest"

Final dataset with factor scores for further analysis:

reg_save2<-c("math_scores", "social_studies_scores", "russian_language_scores", "foreign_language_scores", "certificate_mathgrade", "certificate_social_studiesgrade", "certificate_russianlanggrade", "certificate_foreign_langgrade", "gpa", "subject_mark", "gender", "father_ISCO", "mother_ISCO")

reg_reg <- df_imp[reg_save2] 
final_reg<-cbind(reg_reg, data_reg1$stat_affect, data_reg1$stat_cognitivecomp, data_reg1$stat_difficulty, data_reg1$stat_value, data_reg2$efficacy, data_reg2$extrgoal, data_reg2$intrgoal, data_reg2$testanxiety, data_reg3$mathanxiety, data_reg4$interest, df_imp$course)

names(final_reg)[names(final_reg) == "data_reg1$stat_affect"] <- "stat_affect"
names(final_reg)[names(final_reg) == "data_reg1$stat_cognitivecomp"] <- "stat_cognitivecomp"
names(final_reg)[names(final_reg) == "data_reg1$stat_difficulty"] <- "stat_difficulty"
names(final_reg)[names(final_reg) == "data_reg1$stat_value"] <- "stat_value"
names(final_reg)[names(final_reg) == "data_reg2$efficacy"] <- "efficacy"
names(final_reg)[names(final_reg) == "data_reg2$extrgoal"] <- "extrgoal"
names(final_reg)[names(final_reg) == "data_reg2$intrgoal"] <- "intrgoal"
names(final_reg)[names(final_reg) == "data_reg2$testanxiety"] <- "testanxiety"
names(final_reg)[names(final_reg) == "data_reg3$mathanxiety"] <- "mathanxiety"
names(final_reg)[names(final_reg) == "data_reg4$interest"] <- "interest"
names(final_reg)[names(final_reg) == "df_imp$course"] <- "course"

names(final_reg)
##  [1] "math_scores"                     "social_studies_scores"          
##  [3] "russian_language_scores"         "foreign_language_scores"        
##  [5] "certificate_mathgrade"           "certificate_social_studiesgrade"
##  [7] "certificate_russianlanggrade"    "certificate_foreign_langgrade"  
##  [9] "gpa"                             "subject_mark"                   
## [11] "gender"                          "father_ISCO"                    
## [13] "mother_ISCO"                     "stat_affect"                    
## [15] "stat_cognitivecomp"              "stat_difficulty"                
## [17] "stat_value"                      "efficacy"                       
## [19] "extrgoal"                        "intrgoal"                       
## [21] "testanxiety"                     "mathanxiety"                    
## [23] "interest"                        "course"

Checking hypotheses H1-H3

Correlation analysis

library(polycor)
library(corrplot)
dat.cor <- hetcor(final_reg)
dat.cor<- dat.cor$correlations
dat.cor
##                                 math_scores social_studies_scores
## math_scores                      1.00000000           0.327192422
## social_studies_scores            0.32719242           1.000000000
## russian_language_scores          0.23984168           0.394356726
## foreign_language_scores          0.35776048           0.512822092
## certificate_mathgrade            0.27227228           0.373012807
## certificate_social_studiesgrade  0.07155964           0.271478846
## certificate_russianlanggrade     0.12216889           0.306673614
## certificate_foreign_langgrade    0.02761848           0.264999465
## gpa                              0.42578919           0.469967643
## subject_mark                     0.23376424           0.308346718
## gender                           0.06851771          -0.281730060
## father_ISCO                      0.17269341           0.139912622
## mother_ISCO                      0.02501915           0.051257475
## stat_affect                      0.14089273           0.037435695
## stat_cognitivecomp              -0.32968437          -0.015940253
## stat_difficulty                 -0.21515514          -0.001475602
## stat_value                      -0.10605834          -0.110049510
## efficacy                         0.30324127           0.120022659
## extrgoal                         0.22104347          -0.003693572
## intrgoal                        -0.09766743          -0.075450373
## testanxiety                     -0.25057675          -0.030548788
## mathanxiety                     -0.20185990           0.009554514
## interest                         0.27471106           0.058476316
## course                          -0.17121426          -0.073175646
##                                 russian_language_scores foreign_language_scores
## math_scores                                0.2398416849             0.357760475
## social_studies_scores                      0.3943567262             0.512822092
## russian_language_scores                    1.0000000000             0.380804573
## foreign_language_scores                    0.3808045734             1.000000000
## certificate_mathgrade                      0.3474007961             0.379777902
## certificate_social_studiesgrade            0.1768063822             0.216928181
## certificate_russianlanggrade               0.3001720599             0.316025547
## certificate_foreign_langgrade              0.2851410394             0.305181109
## gpa                                        0.3683844021             0.468904187
## subject_mark                               0.1834082120             0.184988308
## gender                                    -0.3043190630            -0.165096545
## father_ISCO                                0.1852142718             0.184217531
## mother_ISCO                                0.0873357203             0.008453903
## stat_affect                                0.0839230764             0.053409115
## stat_cognitivecomp                        -0.0116732417            -0.133089641
## stat_difficulty                           -0.0270903996            -0.112489113
## stat_value                                -0.0861946654            -0.112381313
## efficacy                                   0.0264562878             0.099657882
## extrgoal                                   0.0188051588            -0.057142789
## intrgoal                                   0.0001241272            -0.117438120
## testanxiety                                0.0552634845            -0.091988386
## mathanxiety                                0.0472796919            -0.052767832
## interest                                   0.0107073489             0.046834696
## course                                    -0.0840393535            -0.014617822
##                                 certificate_mathgrade
## math_scores                               0.272272283
## social_studies_scores                     0.373012807
## russian_language_scores                   0.347400796
## foreign_language_scores                   0.379777902
## certificate_mathgrade                     1.000000000
## certificate_social_studiesgrade           0.525399537
## certificate_russianlanggrade              0.628299631
## certificate_foreign_langgrade             0.498284640
## gpa                                       0.442735729
## subject_mark                              0.242680206
## gender                                   -0.438517343
## father_ISCO                               0.227788070
## mother_ISCO                               0.005202136
## stat_affect                               0.037917029
## stat_cognitivecomp                       -0.045608957
## stat_difficulty                           0.023980111
## stat_value                               -0.014001819
## efficacy                                  0.095729787
## extrgoal                                  0.010094366
## intrgoal                                 -0.064134628
## testanxiety                              -0.022944634
## mathanxiety                              -0.023254805
## interest                                  0.054564167
## course                                    0.153095698
##                                 certificate_social_studiesgrade
## math_scores                                         0.071559641
## social_studies_scores                               0.271478846
## russian_language_scores                             0.176806382
## foreign_language_scores                             0.216928181
## certificate_mathgrade                               0.525399537
## certificate_social_studiesgrade                     1.000000000
## certificate_russianlanggrade                        0.488838172
## certificate_foreign_langgrade                       0.467877902
## gpa                                                 0.267007084
## subject_mark                                        0.074224882
## gender                                             -0.332739691
## father_ISCO                                         0.178329198
## mother_ISCO                                         0.045637275
## stat_affect                                         0.032495187
## stat_cognitivecomp                                  0.001571909
## stat_difficulty                                     0.064889609
## stat_value                                         -0.041065281
## efficacy                                            0.011240682
## extrgoal                                           -0.018137106
## intrgoal                                            0.039594975
## testanxiety                                         0.063261876
## mathanxiety                                         0.032790097
## interest                                           -0.056984503
## course                                              0.044305478
##                                 certificate_russianlanggrade
## math_scores                                       0.12216889
## social_studies_scores                             0.30667361
## russian_language_scores                           0.30017206
## foreign_language_scores                           0.31602555
## certificate_mathgrade                             0.62829963
## certificate_social_studiesgrade                   0.48883817
## certificate_russianlanggrade                      1.00000000
## certificate_foreign_langgrade                     0.52134613
## gpa                                               0.40422486
## subject_mark                                      0.17195549
## gender                                           -0.43607037
## father_ISCO                                       0.19589556
## mother_ISCO                                       0.12458614
## stat_affect                                       0.06258597
## stat_cognitivecomp                               -0.01666650
## stat_difficulty                                   0.09180853
## stat_value                                       -0.05732558
## efficacy                                         -0.01138230
## extrgoal                                         -0.04498487
## intrgoal                                          0.01406144
## testanxiety                                       0.08158489
## mathanxiety                                       0.07087570
## interest                                         -0.06623677
## course                                            0.14806940
##                                 certificate_foreign_langgrade         gpa
## math_scores                                       0.027618482  0.42578919
## social_studies_scores                             0.264999465  0.46996764
## russian_language_scores                           0.285141039  0.36838440
## foreign_language_scores                           0.305181109  0.46890419
## certificate_mathgrade                             0.498284640  0.44273573
## certificate_social_studiesgrade                   0.467877902  0.26700708
## certificate_russianlanggrade                      0.521346126  0.40422486
## certificate_foreign_langgrade                     1.000000000  0.28507351
## gpa                                               0.285073510  1.00000000
## subject_mark                                      0.108331373  0.61366468
## gender                                           -0.430774161 -0.23738074
## father_ISCO                                       0.093182330  0.15261746
## mother_ISCO                                       0.013238875  0.06455866
## stat_affect                                      -0.009050429  0.23639481
## stat_cognitivecomp                                0.058506110 -0.17263675
## stat_difficulty                                   0.036706123 -0.08603657
## stat_value                                       -0.034976368 -0.21375725
## efficacy                                          0.001648678  0.33855523
## extrgoal                                         -0.100210369  0.11751354
## intrgoal                                          0.032475900 -0.04408093
## testanxiety                                       0.068240689 -0.07438839
## mathanxiety                                       0.116524802 -0.07841520
## interest                                         -0.057168045  0.19211190
## course                                            0.120485972  0.05161812
##                                 subject_mark      gender   father_ISCO
## math_scores                      0.233764237  0.06851771  0.1726934134
## social_studies_scores            0.308346718 -0.28173006  0.1399126223
## russian_language_scores          0.183408212 -0.30431906  0.1852142718
## foreign_language_scores          0.184988308 -0.16509654  0.1842175305
## certificate_mathgrade            0.242680206 -0.43851734  0.2277880701
## certificate_social_studiesgrade  0.074224882 -0.33273969  0.1783291984
## certificate_russianlanggrade     0.171955486 -0.43607037  0.1958955649
## certificate_foreign_langgrade    0.108331373 -0.43077416  0.0931823296
## gpa                              0.613664678 -0.23738074  0.1526174596
## subject_mark                     1.000000000 -0.13037432 -0.0187772372
## gender                          -0.130374323  1.00000000 -0.0869173168
## father_ISCO                     -0.018777237 -0.08691732  1.0000000000
## mother_ISCO                      0.048254456  0.02542340  0.1347947400
## stat_affect                      0.160946617  0.07553418 -0.0250099422
## stat_cognitivecomp              -0.035464550 -0.18643381  0.0001300256
## stat_difficulty                  0.014186818 -0.18327079 -0.0010580062
## stat_value                      -0.109365270 -0.06879662  0.0675691250
## efficacy                         0.389094480  0.14351317 -0.0108078430
## extrgoal                         0.184238422  0.26527072 -0.0417487490
## intrgoal                        -0.129005953 -0.12979057 -0.0991381621
## testanxiety                     -0.109512208 -0.28348584 -0.0810379319
## mathanxiety                     -0.001112895 -0.25134357 -0.0452578069
## interest                         0.203617424  0.18789659  0.0115353915
## course                           0.251836503 -0.19031277  0.0298446856
##                                  mother_ISCO  stat_affect stat_cognitivecomp
## math_scores                      0.025019155  0.140892730      -0.3296843717
## social_studies_scores            0.051257475  0.037435695      -0.0159402535
## russian_language_scores          0.087335720  0.083923076      -0.0116732417
## foreign_language_scores          0.008453903  0.053409115      -0.1330896414
## certificate_mathgrade            0.005202136  0.037917029      -0.0456089569
## certificate_social_studiesgrade  0.045637275  0.032495187       0.0015719089
## certificate_russianlanggrade     0.124586142  0.062585973      -0.0166664951
## certificate_foreign_langgrade    0.013238875 -0.009050429       0.0585061100
## gpa                              0.064558660  0.236394815      -0.1726367488
## subject_mark                     0.048254456  0.160946617      -0.0354645503
## gender                           0.025423404  0.075534176      -0.1864338060
## father_ISCO                      0.134794740 -0.025009942       0.0001300256
## mother_ISCO                      1.000000000  0.034265985      -0.1100934085
## stat_affect                      0.034265985  1.000000000      -0.3788558347
## stat_cognitivecomp              -0.110093409 -0.378855835       1.0000000000
## stat_difficulty                 -0.029756007 -0.268428753       0.6310888372
## stat_value                      -0.074694986 -0.651758207       0.3131288770
## efficacy                        -0.102124331  0.355070912      -0.4117984310
## extrgoal                        -0.093866430  0.352975290      -0.1906013382
## intrgoal                        -0.110720249  0.071766081       0.2099710010
## testanxiety                     -0.036959686 -0.063414836       0.4550563804
## mathanxiety                     -0.047689285 -0.086447877       0.4754442074
## interest                        -0.054391629  0.394764461      -0.1997396780
## course                           0.023851480 -0.034172936       0.0411119507
##                                 stat_difficulty  stat_value     efficacy
## math_scores                        -0.215155145 -0.10605834  0.303241268
## social_studies_scores              -0.001475602 -0.11004951  0.120022659
## russian_language_scores            -0.027090400 -0.08619467  0.026456288
## foreign_language_scores            -0.112489113 -0.11238131  0.099657882
## certificate_mathgrade               0.023980111 -0.01400182  0.095729787
## certificate_social_studiesgrade     0.064889609 -0.04106528  0.011240682
## certificate_russianlanggrade        0.091808532 -0.05732558 -0.011382297
## certificate_foreign_langgrade       0.036706123 -0.03497637  0.001648678
## gpa                                -0.086036569 -0.21375725  0.338555233
## subject_mark                        0.014186818 -0.10936527  0.389094480
## gender                             -0.183270785 -0.06879662  0.143513168
## father_ISCO                        -0.001058006  0.06756912 -0.010807843
## mother_ISCO                        -0.029756007 -0.07469499 -0.102124331
## stat_affect                        -0.268428753 -0.65175821  0.355070912
## stat_cognitivecomp                  0.631088837  0.31312888 -0.411798431
## stat_difficulty                     1.000000000  0.20997479 -0.322758773
## stat_value                          0.209974787  1.00000000 -0.265824022
## efficacy                           -0.322758773 -0.26582402  1.000000000
## extrgoal                           -0.070325832 -0.28243474  0.600829413
## intrgoal                            0.281992290  0.02817709 -0.025566348
## testanxiety                         0.489843786  0.13048589 -0.342588799
## mathanxiety                         0.411240563  0.18497722 -0.379012534
## interest                           -0.154394875 -0.36688530  0.644978388
## course                              0.191141331  0.12853089  0.002406911
##                                     extrgoal      intrgoal  testanxiety
## math_scores                      0.221043474 -0.0976674290 -0.250576749
## social_studies_scores           -0.003693572 -0.0754503730 -0.030548788
## russian_language_scores          0.018805159  0.0001241272  0.055263485
## foreign_language_scores         -0.057142789 -0.1174381197 -0.091988386
## certificate_mathgrade            0.010094366 -0.0641346281 -0.022944634
## certificate_social_studiesgrade -0.018137106  0.0395949745  0.063261876
## certificate_russianlanggrade    -0.044984868  0.0140614440  0.081584886
## certificate_foreign_langgrade   -0.100210369  0.0324758997  0.068240689
## gpa                              0.117513535 -0.0440809344 -0.074388393
## subject_mark                     0.184238422 -0.1290059529 -0.109512208
## gender                           0.265270723 -0.1297905714 -0.283485840
## father_ISCO                     -0.041748749 -0.0991381621 -0.081037932
## mother_ISCO                     -0.093866430 -0.1107202486 -0.036959686
## stat_affect                      0.352975290  0.0717660812 -0.063414836
## stat_cognitivecomp              -0.190601338  0.2099710010  0.455056380
## stat_difficulty                 -0.070325832  0.2819922903  0.489843786
## stat_value                      -0.282434736  0.0281770917  0.130485888
## efficacy                         0.600829413 -0.0255663479 -0.342588799
## extrgoal                         1.000000000  0.2066146701  0.001397036
## intrgoal                         0.206614670  1.0000000000  0.547747406
## testanxiety                      0.001397036  0.5477474060  1.000000000
## mathanxiety                     -0.136183499  0.3651534709  0.603877188
## interest                         0.710018920  0.1339214778 -0.064338242
## course                          -0.145016300 -0.2543210132 -0.063924831
##                                  mathanxiety    interest       course
## math_scores                     -0.201859899  0.27471106 -0.171214255
## social_studies_scores            0.009554514  0.05847632 -0.073175646
## russian_language_scores          0.047279692  0.01070735 -0.084039354
## foreign_language_scores         -0.052767832  0.04683470 -0.014617822
## certificate_mathgrade           -0.023254805  0.05456417  0.153095698
## certificate_social_studiesgrade  0.032790097 -0.05698450  0.044305478
## certificate_russianlanggrade     0.070875698 -0.06623677  0.148069404
## certificate_foreign_langgrade    0.116524802 -0.05716804  0.120485972
## gpa                             -0.078415204  0.19211190  0.051618119
## subject_mark                    -0.001112895  0.20361742  0.251836503
## gender                          -0.251343566  0.18789659 -0.190312767
## father_ISCO                     -0.045257807  0.01153539  0.029844686
## mother_ISCO                     -0.047689285 -0.05439163  0.023851480
## stat_affect                     -0.086447877  0.39476446 -0.034172936
## stat_cognitivecomp               0.475444207 -0.19973968  0.041111951
## stat_difficulty                  0.411240563 -0.15439487  0.191141331
## stat_value                       0.184977219 -0.36688530  0.128530892
## efficacy                        -0.379012534  0.64497839  0.002406911
## extrgoal                        -0.136183499  0.71001892 -0.145016300
## intrgoal                         0.365153471  0.13392148 -0.254321013
## testanxiety                      0.603877188 -0.06433824 -0.063924831
## mathanxiety                      1.000000000 -0.24948765  0.012440510
## interest                        -0.249487653  1.00000000 -0.147356099
## course                           0.012440510 -0.14735610  1.000000000
corrplot(dat.cor, method = "circle", type="upper")

Correlations (H1:Both USE scores and school grades for four core subjects are assumed to be positively related to academic achievement):

  • Math USE scores and subject grade: ~0.23

  • Math USE scores and gpa: ~ 0.42

  • Math school grade and subject grade: ~0.24

  • Math school grade and gpa: ~ 0.44

  • Social Studies USE scores and subject grade: ~0.31

  • Social Studies USE scores and gpa: ~0.38

  • Social Studies school grade and subject grade: ~0.07

  • Social Studies school grade and gpa: ~0.26

  • Russian language USE scores and subject grade: ~0.17

  • Russian language USE scores and gpa: ~0.36

  • Russian language school grade and subject grade: ~0.17

  • Russian language school grade and gpa: ~0.40

  • Foreign language USE scores and subject grade: ~0.19

  • Foreign language USE scores and gpa: ~0.47

  • Foreign language school grade and subject grade: ~0.11

  • Foreign language school grade and gpa: ~0.28

Correlation analysis showed that USE scores and school grades are both positively correlated with college gpa and subject grades. Nevertheless, USE scores and school grades turned out to be higher correlated with student’s gpa than with subject grade. Furthemore, the highest correlation can be observed between foreign language USE scores and gpa (0.47). Math USE score and school grade also have relatively high correlation coefficients with student’s gpa in college (>0.40). Other predictors have rather low correlation coefficients (<0.30).

Correlations (H2:both performance and learning goal orientations will be positively related to academic achievement. Though, learning goal orientation is hypothesized to have higher correlation coefficients.):

  • Intrinsic goal orientation and subject grade: ~0.19

  • Intrinsic goal orientation and gpa: ~0.12

  • Extrinsic goal orientation and subject grade: ~-0.12

  • Extrinsic goal orientation and gpa: ~ -0.04

According to correlation analysis it can be seen that correlation coefficients are rather small. Though there exists a certain pattern, which indicates that intrinsic goal orientation is positively associated with academic performance (both gpa and subject grades) while extrinsic goal orientation has negative correlation with both outcome variables. This support the hypothesis only parrtly. Nevertheless, intrinsic goal orientation has higher correlation coefficients with subject grades, meaning that students who are eager to gain knowledge and develop competences in certain subjects (have high intrinsic goal orientations) get higher grades in this subjects. While extrinsic goal orientation has higher correlation coefficients with gpa.

Correlations (H3:Both self-efficacy beliefs and individual interest are also assumed to have positive relation to the outcome variable. While anxiety is hypothesized to have direct negative relation to academic achievement.):

  • Self-efficacy and subject grade: ~0.39

  • Self-efficacy and gpa: ~0.33

Correlation coefficents arer the highest among all motivational vaianles and also support the hypothesis since they indicate that increrased self-efficacy beliefs (beliefs in the ability to perform a certain task) are associated with higher subject grades and gpa in general. Moreover, compared to the gpa, subject grdaes have higher correlation coefficients with the outcome varibale

  • Interest and subject grade: ~0.20

  • Interest and gpa: ~0.19

coefficients are rather small but still support the hypothesis about higher interest in the subject being associated with higher academic performance.

  • Affective states towards statistics and subject grade: ~0.15

  • Affective states towards statistics and gpa: ~0.23

  • Beliefs about cognitive competences to statistics and subject grade: ~ -0.03

  • Beliefs about cognitive competences to statistics statistics and gpa: ~ -0.17

  • Beliefs about difficulty of statistics and subject grade: ~ 0.01

  • Beliefs about difficulty of statistics and gpa: ~ -0.08

  • Statistics value and subject grade: ~ -0.21

  • Statistics value and subject grade: ~ -0.11

All 4 domains of SATS (survey of attitudes towards statistics) indicate very small correlation coefficients. Though the highest correlations with gpa and subject grades can be observed in case of affective states, which means that students who likes statistics perform better. The second highest correlation coefficients are with belifs of statistics value. They indicate that the more a student believes that statistics is useless the lower his or her grades are.

  • Math anxiety and subject grade: ~ 0.00016

  • Math anxiety and subject grade: ~ -0.07

  • Test anxiety and subject grade: ~ -0.1

  • Test anxiety and subject grade: ~ -0.07

Math and test anxieties have very small correlations with the outcome variables.

Regression analysis

model1<-lm(subject_mark ~ math_scores, data = final_reg) 
summary(model1)
## 
## Call:
## lm(formula = subject_mark ~ math_scores, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3570 -1.3570 -0.1217  0.9875  4.4245 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.64268    0.97586   1.683   0.0933 .  
## math_scores  0.05462    0.01249   4.374 1.64e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.693 on 331 degrees of freedom
## Multiple R-squared:  0.05465,    Adjusted R-squared:  0.05179 
## F-statistic: 19.13 on 1 and 331 DF,  p-value: 1.635e-05

Explains only 5% of variance (Adjusted R-squared: 0.05229)

model2<-lm(subject_mark ~ math_scores+social_studies_scores, data = final_reg) 
summary(model2)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores, 
##     data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8840 -1.2335 -0.2378  0.8723  4.2403 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -0.607283   1.058250  -0.574  0.56646    
## math_scores            0.034771   0.012806   2.715  0.00697 ** 
## social_studies_scores  0.044924   0.009482   4.738 3.22e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.641 on 330 degrees of freedom
## Multiple R-squared:  0.1149, Adjusted R-squared:  0.1095 
## F-statistic: 21.41 on 2 and 330 DF,  p-value: 1.81e-09

Social sciences USE scores add additional 5% of explained variance (now this model explains 10% of variance)

anova(model1,model2)

Model comparison with anova also proves that the second model is better than the first one

model3<-lm(subject_mark ~ math_scores+social_studies_scores+russian_language_scores, data = final_reg) 
summary(model3)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     russian_language_scores, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8607 -1.2491 -0.2154  0.8764  4.1915 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -1.15740    1.20356  -0.962   0.3369    
## math_scores              0.03319    0.01291   2.570   0.0106 *  
## social_studies_scores    0.04159    0.01010   4.117 4.86e-05 ***
## russian_language_scores  0.01064    0.01108   0.960   0.3378    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.641 on 329 degrees of freedom
## Multiple R-squared:  0.1173, Adjusted R-squared:  0.1093 
## F-statistic: 14.58 on 3 and 329 DF,  p-value: 6.169e-09

With addition of russian language USE scores Adjusted R-squared has become smaller nad the coefficient for this variable is statistically insignificant

anova(model2,model3)

Model comparison with anova also indicate that adding USE scores for russian language does not improve the model.

model4<-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores, data = final_reg) 
summary(model4)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8841 -1.2334 -0.2388  0.8734  4.2445 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -0.5937489  1.1387059  -0.521  0.60242    
## math_scores              0.0348710  0.0131927   2.643  0.00861 ** 
## social_studies_scores    0.0450792  0.0106254   4.243 2.88e-05 ***
## foreign_language_scores -0.0004029  0.0123949  -0.033  0.97409    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.644 on 329 degrees of freedom
## Multiple R-squared:  0.1149, Adjusted R-squared:  0.1068 
## F-statistic: 14.23 on 3 and 329 DF,  p-value: 9.669e-09
anova(model2,model4)

The same can be observed with the USE scores for foreign language

model5<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade, data = final_reg) 
summary(model5)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8774 -1.2412 -0.2594  0.8476  4.2773 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -1.574583   1.137227  -1.385 0.167119    
## math_scores            0.029816   0.012920   2.308 0.021638 *  
## social_studies_scores  0.037991   0.009921   3.829 0.000154 ***
## certificate_mathgrade  0.415613   0.185717   2.238 0.025897 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.631 on 329 degrees of freedom
## Multiple R-squared:  0.1281, Adjusted R-squared:  0.1202 
## F-statistic: 16.12 on 3 and 329 DF,  p-value: 8.491e-10

Adding math school grade has increased Adjusted R-squared from 11% in the second model to 12%. Regression coefficient is also statistically significant in ths model

anova(model2,model5)

Model comparison with anova indicated that model5 is better

model6<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+certificate_social_studiesgrade, data = final_reg) 
summary(model6)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + certificate_social_studiesgrade, 
##     data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8477 -1.2290 -0.3081  0.8865  4.5730 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     -0.426457   1.399189  -0.305  0.76072    
## math_scores                      0.027704   0.012989   2.133  0.03367 *  
## social_studies_scores            0.039703   0.009981   3.978 8.57e-05 ***
## certificate_mathgrade            0.560247   0.212118   2.641  0.00866 ** 
## certificate_social_studiesgrade -0.372678   0.265348  -1.404  0.16112    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.629 on 328 degrees of freedom
## Multiple R-squared:  0.1333, Adjusted R-squared:  0.1228 
## F-statistic: 12.62 on 4 and 328 DF,  p-value: 1.468e-09

Adjusted R-squared has only slightly increased and the coefficient is not statistically significant

anova(model5,model6)

Model comparison with anova indicates that model5 is better

model7<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+certificate_russianlanggrade, data = final_reg) 
summary(model7)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + certificate_russianlanggrade, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8856 -1.2289 -0.2244  0.8488  4.2611 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  -1.68109    1.21731  -1.381 0.168224    
## math_scores                   0.03012    0.01300   2.317 0.021094 *  
## social_studies_scores         0.03769    0.01001   3.766 0.000197 ***
## certificate_mathgrade         0.38224    0.22964   1.664 0.096969 .  
## certificate_russianlanggrade  0.05625    0.22709   0.248 0.804508    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.634 on 328 degrees of freedom
## Multiple R-squared:  0.1283, Adjusted R-squared:  0.1177 
## F-statistic: 12.07 on 4 and 328 DF,  p-value: 3.669e-09

Adjusted R-squared has become smaller comparing to the model5 and regression coefficient is also statistically insigniificant

anova(model7,model5)

model5 is still better

model8<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+certificate_foreign_langgrade, data = final_reg) 
summary(model8)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + certificate_foreign_langgrade, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8647 -1.2649 -0.2672  0.8549  4.3516 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   -1.25152    1.43697  -0.871 0.384420    
## math_scores                    0.02904    0.01311   2.216 0.027397 *  
## social_studies_scores          0.03850    0.01003   3.839 0.000148 ***
## certificate_mathgrade          0.45166    0.21011   2.150 0.032312 *  
## certificate_foreign_langgrade -0.09813    0.26623  -0.369 0.712666    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.633 on 328 degrees of freedom
## Multiple R-squared:  0.1285, Adjusted R-squared:  0.1179 
## F-statistic: 12.09 on 4 and 328 DF,  p-value: 3.54e-09
anova(model8,model5)

Same as with model8. Model5 is still the best one

model9<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy, data = final_reg) 
summary(model9)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3924 -1.0550 -0.3122  0.9809  4.6198 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           0.410440   1.106028   0.371   0.7108    
## math_scores           0.006176   0.012609   0.490   0.6246    
## social_studies_scores 0.036754   0.009307   3.949 9.61e-05 ***
## certificate_mathgrade 0.406726   0.174189   2.335   0.0201 *  
## efficacy              0.593844   0.087551   6.783 5.50e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.53 on 328 degrees of freedom
## Multiple R-squared:  0.2354, Adjusted R-squared:  0.226 
## F-statistic: 25.24 on 4 and 328 DF,  p-value: < 2.2e-16

Adding self-efficacy beliefs to the model has substantially increased Adjusted R-squared (from 12% in the model5 to 22% in this one). Also regrerssion coefficient for this variable is statistically significant

anova(model5,model9)

model9 is better

model10<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal, data = final_reg) 
summary(model10)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.5509 -1.0582 -0.3043  0.9577  4.6239 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.427162   1.106999   0.386  0.69984    
## math_scores            0.007032   0.012670   0.555  0.57926    
## social_studies_scores  0.036063   0.009359   3.853  0.00014 ***
## certificate_mathgrade  0.401366   0.174454   2.301  0.02204 *  
## efficacy               0.640346   0.107444   5.960 6.53e-09 ***
## extrgoal              -0.080412   0.107555  -0.748  0.45522    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.531 on 327 degrees of freedom
## Multiple R-squared:  0.2367, Adjusted R-squared:  0.225 
## F-statistic: 20.28 on 5 and 327 DF,  p-value: < 2.2e-16

Explained variance has increased from 22% in the model9 to 23% in this one. the regeression coefficient is also statistically significant

anova(model9, model10)

model10 is slightly better

model11<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+intrgoal, data = final_reg) 
summary(model11)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + intrgoal, data = final_reg)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.292 -1.071 -0.271  0.892  4.528 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.640345   1.109294   0.577 0.564166    
## math_scores            0.004736   0.012688   0.373 0.709187    
## social_studies_scores  0.035919   0.009326   3.851 0.000141 ***
## certificate_mathgrade  0.396550   0.173860   2.281 0.023201 *  
## efficacy               0.608308   0.108501   5.606  4.4e-08 ***
## extrgoal              -0.023423   0.111652  -0.210 0.833964    
## intrgoal              -0.165119   0.090675  -1.821 0.069522 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.526 on 326 degrees of freedom
## Multiple R-squared:  0.2444, Adjusted R-squared:  0.2305 
## F-statistic: 17.57 on 6 and 326 DF,  p-value: < 2.2e-16
anova(model10,model11)

model10 is still better

model12<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+interest, data = final_reg) 
summary(model12)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + interest, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.5225 -1.0608 -0.2963  0.9458  4.6812 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.340385   1.110736   0.306 0.759458    
## math_scores            0.008142   0.012723   0.640 0.522672    
## social_studies_scores  0.036059   0.009360   3.852 0.000141 ***
## certificate_mathgrade  0.401539   0.174471   2.301 0.021996 *  
## efficacy               0.680867   0.115330   5.904 8.92e-09 ***
## extrgoal              -0.016523   0.126224  -0.131 0.895936    
## interest              -0.123148   0.127305  -0.967 0.334090    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.531 on 326 degrees of freedom
## Multiple R-squared:  0.2389, Adjusted R-squared:  0.2249 
## F-statistic: 17.05 on 6 and 326 DF,  p-value: < 2.2e-16
anova(model10,model12)

model10 is still better

model13<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+mathanxiety, data = final_reg) 
summary(model13)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + mathanxiety, 
##     data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.4252 -0.9645 -0.2163  0.9144  4.9940 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.295945   1.091991   0.271 0.786552    
## math_scores            0.012630   0.012608   1.002 0.317222    
## social_studies_scores  0.033013   0.009274   3.560 0.000426 ***
## certificate_mathgrade  0.391355   0.171999   2.275 0.023534 *  
## efficacy               0.772614   0.113499   6.807 4.79e-11 ***
## extrgoal              -0.130065   0.107125  -1.214 0.225572    
## mathanxiety            0.285031   0.087912   3.242 0.001309 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.509 on 326 degrees of freedom
## Multiple R-squared:  0.2605, Adjusted R-squared:  0.2469 
## F-statistic: 19.14 on 6 and 326 DF,  p-value: < 2.2e-16

Explained variance is 4% higher compared to the model10.

anova(model10,model13)

model13 is better

model14<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal++mathanxiety+testanxiety, data = final_reg) 
summary(model14)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + +mathanxiety + 
##     testanxiety, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3230 -0.9762 -0.2111  0.8551  5.1005 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.398108   1.096381   0.363 0.716758    
## math_scores            0.010416   0.012789   0.814 0.415972    
## social_studies_scores  0.033362   0.009279   3.595 0.000374 ***
## certificate_mathgrade  0.400054   0.172189   2.323 0.020778 *  
## efficacy               0.741682   0.117392   6.318 8.72e-10 ***
## extrgoal              -0.099309   0.111196  -0.893 0.372462    
## mathanxiety            0.340546   0.103102   3.303 0.001063 ** 
## testanxiety           -0.115693   0.112284  -1.030 0.303609    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.509 on 325 degrees of freedom
## Multiple R-squared:  0.2629, Adjusted R-squared:  0.2471 
## F-statistic: 16.56 on 7 and 325 DF,  p-value: < 2.2e-16

Adjusted R-squared decreased

anova(model13,model14)

model13 is better

model15<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+mathanxiety+stat_affect, data = final_reg) 
summary(model15)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + mathanxiety + 
##     stat_affect, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.4189 -1.0103 -0.2441  0.8805  5.0357 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.313287   1.093651   0.286  0.77471    
## math_scores            0.012434   0.012627   0.985  0.32551    
## social_studies_scores  0.033025   0.009284   3.557  0.00043 ***
## certificate_mathgrade  0.390691   0.172190   2.269  0.02393 *  
## efficacy               0.761349   0.115521   6.591 1.77e-10 ***
## extrgoal              -0.140545   0.108982  -1.290  0.19810    
## mathanxiety            0.283307   0.088066   3.217  0.00143 ** 
## stat_affect            0.049352   0.091372   0.540  0.58948    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.511 on 325 degrees of freedom
## Multiple R-squared:  0.2612, Adjusted R-squared:  0.2453 
## F-statistic: 16.41 on 7 and 325 DF,  p-value: < 2.2e-16
anova(model13,model15)

model13 is still better

model16<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+mathanxiety+stat_value, data = final_reg) 
summary(model16)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + mathanxiety + 
##     stat_value, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.4336 -0.9734 -0.2284  0.9037  5.0410 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.308968   1.094246   0.282 0.777849    
## math_scores            0.012721   0.012629   1.007 0.314530    
## social_studies_scores  0.032659   0.009352   3.492 0.000545 ***
## certificate_mathgrade  0.393451   0.172359   2.283 0.023091 *  
## efficacy               0.770446   0.113855   6.767 6.14e-11 ***
## extrgoal              -0.136530   0.109141  -1.251 0.211851    
## mathanxiety            0.288648   0.088750   3.252 0.001265 ** 
## stat_value            -0.027851   0.086620  -0.322 0.748019    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.511 on 325 degrees of freedom
## Multiple R-squared:  0.2608, Adjusted R-squared:  0.2448 
## F-statistic: 16.38 on 7 and 325 DF,  p-value: < 2.2e-16
anova(model13, model16)

model13 is better

model17<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+mathanxiety+stat_difficulty, data = final_reg) 
summary(model17)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + mathanxiety + 
##     stat_difficulty, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.6499 -1.0011 -0.1826  0.9071  4.6717 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.208829   1.086083   0.192 0.847645    
## math_scores            0.016691   0.012663   1.318 0.188402    
## social_studies_scores  0.032005   0.009229   3.468 0.000595 ***
## certificate_mathgrade  0.360552   0.171513   2.102 0.036307 *  
## efficacy               0.831262   0.115831   7.176 4.88e-12 ***
## extrgoal              -0.166414   0.107714  -1.545 0.123329    
## mathanxiety            0.224289   0.091519   2.451 0.014783 *  
## stat_difficulty        0.208484   0.093399   2.232 0.026284 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.5 on 325 degrees of freedom
## Multiple R-squared:  0.2717, Adjusted R-squared:  0.256 
## F-statistic: 17.32 on 7 and 325 DF,  p-value: < 2.2e-16
anova(model13,model17)

model17 is better

model18<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+mathanxiety+stat_difficulty+stat_cognitivecomp, data = final_reg) 
summary(model18)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + mathanxiety + 
##     stat_difficulty + stat_cognitivecomp, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.7183 -1.0149 -0.2204  0.9536  4.4886 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.04008    1.09686   0.037 0.970876    
## math_scores            0.01939    0.01290   1.503 0.133851    
## social_studies_scores  0.03128    0.00925   3.382 0.000808 ***
## certificate_mathgrade  0.36480    0.17151   2.127 0.034177 *  
## efficacy               0.84795    0.11682   7.259 2.91e-12 ***
## extrgoal              -0.16443    0.10770  -1.527 0.127802    
## mathanxiety            0.20048    0.09409   2.131 0.033862 *  
## stat_difficulty        0.14908    0.10823   1.377 0.169324    
## stat_cognitivecomp     0.12785    0.11777   1.086 0.278467    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.5 on 324 degrees of freedom
## Multiple R-squared:  0.2743, Adjusted R-squared:  0.2564 
## F-statistic: 15.31 on 8 and 324 DF,  p-value: < 2.2e-16
anova(model17,model18)

model 17 seem to be the best

library(car)
vif(model17)
##           math_scores social_studies_scores certificate_mathgrade 
##              1.310620              1.269651              1.207055 
##              efficacy              extrgoal           mathanxiety 
##              2.006437              1.664783              1.332843 
##       stat_difficulty 
##              1.307058

Values are less than 5. Therefore, it can be concluded that we do not have multicollinearity.

par(mfrow = c(2,2))
plot(model17)

  • Residuals VS Fitted (we can see that dots are not quite evenly dispersed around zero, whihch means that we face the problem of heteroscedasticity)

  • Normal Q-Q plot shows that our data is normally distributed

  • Also we do not have any leverages or influential cases, as Cook’s distance line is not present on the last plot

Checking for heteroscedasticity again:

library(lmtest)
bptest(model17)
## 
##  studentized Breusch-Pagan test
## 
## data:  model17
## BP = 14.02, df = 7, p-value = 0.05083
ncvTest(model17)
## Non-constant Variance Score Test 
## Variance formula: ~ fitted.values 
## Chisquare = 6.178397, Df = 1, p = 0.012932

One of the tests is statistically significant the other is not. The first one proves the presence of heterscedasticity, the pther does not prove its presence

Fianal regression model

model17<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+mathanxiety+stat_difficulty, data = final_reg) 
summary(model17)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + mathanxiety + 
##     stat_difficulty, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.6499 -1.0011 -0.1826  0.9071  4.6717 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.208829   1.086083   0.192 0.847645    
## math_scores            0.016691   0.012663   1.318 0.188402    
## social_studies_scores  0.032005   0.009229   3.468 0.000595 ***
## certificate_mathgrade  0.360552   0.171513   2.102 0.036307 *  
## efficacy               0.831262   0.115831   7.176 4.88e-12 ***
## extrgoal              -0.166414   0.107714  -1.545 0.123329    
## mathanxiety            0.224289   0.091519   2.451 0.014783 *  
## stat_difficulty        0.208484   0.093399   2.232 0.026284 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.5 on 325 degrees of freedom
## Multiple R-squared:  0.2717, Adjusted R-squared:  0.256 
## F-statistic: 17.32 on 7 and 325 DF,  p-value: < 2.2e-16
final_reg$father_ISCO <- as.numeric(final_reg$father_ISCO)
model30<-lm(subject_mark ~ math_scores+social_studies_scores+certificate_mathgrade+efficacy+extrgoal+mathanxiety*gender+stat_difficulty+course, data = final_reg) 
summary(model30)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     certificate_mathgrade + efficacy + extrgoal + mathanxiety * 
##     gender + stat_difficulty + course, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.7306 -0.8969 -0.0515  0.9452  3.8814 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            -1.190488   1.124316  -1.059 0.290460    
## math_scores             0.026316   0.012353   2.130 0.033900 *  
## social_studies_scores   0.038392   0.008971   4.280 2.47e-05 ***
## certificate_mathgrade   0.176024   0.178127   0.988 0.323800    
## efficacy                0.701807   0.113213   6.199 1.74e-09 ***
## extrgoal               -0.055931   0.106987  -0.523 0.601486    
## mathanxiety             0.406921   0.113645   3.581 0.000396 ***
## gendermale             -0.037852   0.188168  -0.201 0.840699    
## stat_difficulty         0.090015   0.091736   0.981 0.327215    
## course                  0.559498   0.109557   5.107 5.62e-07 ***
## mathanxiety:gendermale -0.359673   0.157033  -2.290 0.022642 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.434 on 322 degrees of freedom
## Multiple R-squared:  0.3403, Adjusted R-squared:  0.3199 
## F-statistic: 16.61 on 10 and 322 DF,  p-value: < 2.2e-16
library(sjPlot)
## Warning: package 'sjPlot' was built under R version 4.0.2
## Registered S3 methods overwritten by 'lme4':
##   method                          from
##   cooks.distance.influence.merMod car 
##   influence.merMod                car 
##   dfbeta.influence.merMod         car 
##   dfbetas.influence.merMod        car
## Learn more about sjPlot with 'browseVignettes("sjPlot")'.
plot_model(model30, type = "int")

vif(model30)
##           math_scores social_studies_scores certificate_mathgrade 
##              1.364261              1.312265              1.424159 
##              efficacy              extrgoal           mathanxiety 
##              2.096695              1.796543              2.248111 
##                gender       stat_difficulty                course 
##              1.325939              1.379304              1.192467 
##    mathanxiety:gender 
##              1.944120

Cheking H4: school grades for four core subjects are assumed to be positively correlated with USE scores since USE is supposed to cover main topics studied at school

library(polycor)
library(corrplot)
dat.cor <- hetcor(final_reg)
dat.cor<- dat.cor$correlations
dat.cor
##                                 math_scores social_studies_scores
## math_scores                      1.00000000           0.327192422
## social_studies_scores            0.32719242           1.000000000
## russian_language_scores          0.23984168           0.394356726
## foreign_language_scores          0.35776048           0.512822092
## certificate_mathgrade            0.27227228           0.373012807
## certificate_social_studiesgrade  0.07155964           0.271478846
## certificate_russianlanggrade     0.12216889           0.306673614
## certificate_foreign_langgrade    0.02761848           0.264999465
## gpa                              0.42578919           0.469967643
## subject_mark                     0.23376424           0.308346718
## gender                           0.06851771          -0.281730060
## father_ISCO                      0.12076766           0.124883489
## mother_ISCO                      0.02501915           0.051257475
## stat_affect                      0.14089273           0.037435695
## stat_cognitivecomp              -0.32968437          -0.015940253
## stat_difficulty                 -0.21515514          -0.001475602
## stat_value                      -0.10605834          -0.110049510
## efficacy                         0.30324127           0.120022659
## extrgoal                         0.22104347          -0.003693572
## intrgoal                        -0.09766743          -0.075450373
## testanxiety                     -0.25057675          -0.030548788
## mathanxiety                     -0.20185990           0.009554514
## interest                         0.27471106           0.058476316
## course                          -0.17121426          -0.073175646
##                                 russian_language_scores foreign_language_scores
## math_scores                                0.2398416849             0.357760475
## social_studies_scores                      0.3943567262             0.512822092
## russian_language_scores                    1.0000000000             0.380804573
## foreign_language_scores                    0.3808045734             1.000000000
## certificate_mathgrade                      0.3474007961             0.379777902
## certificate_social_studiesgrade            0.1768063822             0.216928181
## certificate_russianlanggrade               0.3001720599             0.316025547
## certificate_foreign_langgrade              0.2851410394             0.305181109
## gpa                                        0.3683844021             0.468904187
## subject_mark                               0.1834082120             0.184988308
## gender                                    -0.3043190630            -0.165096545
## father_ISCO                                0.1163169421             0.149751939
## mother_ISCO                                0.0873357203             0.008453903
## stat_affect                                0.0839230764             0.053409115
## stat_cognitivecomp                        -0.0116732417            -0.133089641
## stat_difficulty                           -0.0270903996            -0.112489113
## stat_value                                -0.0861946654            -0.112381313
## efficacy                                   0.0264562878             0.099657882
## extrgoal                                   0.0188051588            -0.057142789
## intrgoal                                   0.0001241272            -0.117438120
## testanxiety                                0.0552634845            -0.091988386
## mathanxiety                                0.0472796919            -0.052767832
## interest                                   0.0107073489             0.046834696
## course                                    -0.0840393535            -0.014617822
##                                 certificate_mathgrade
## math_scores                               0.272272283
## social_studies_scores                     0.373012807
## russian_language_scores                   0.347400796
## foreign_language_scores                   0.379777902
## certificate_mathgrade                     1.000000000
## certificate_social_studiesgrade           0.525399537
## certificate_russianlanggrade              0.628299631
## certificate_foreign_langgrade             0.498284640
## gpa                                       0.442735729
## subject_mark                              0.242680206
## gender                                   -0.438517343
## father_ISCO                               0.154887669
## mother_ISCO                               0.005202136
## stat_affect                               0.037917029
## stat_cognitivecomp                       -0.045608957
## stat_difficulty                           0.023980111
## stat_value                               -0.014001819
## efficacy                                  0.095729787
## extrgoal                                  0.010094366
## intrgoal                                 -0.064134628
## testanxiety                              -0.022944634
## mathanxiety                              -0.023254805
## interest                                  0.054564167
## course                                    0.153095698
##                                 certificate_social_studiesgrade
## math_scores                                         0.071559641
## social_studies_scores                               0.271478846
## russian_language_scores                             0.176806382
## foreign_language_scores                             0.216928181
## certificate_mathgrade                               0.525399537
## certificate_social_studiesgrade                     1.000000000
## certificate_russianlanggrade                        0.488838172
## certificate_foreign_langgrade                       0.467877902
## gpa                                                 0.267007084
## subject_mark                                        0.074224882
## gender                                             -0.332739691
## father_ISCO                                         0.101509834
## mother_ISCO                                         0.045637275
## stat_affect                                         0.032495187
## stat_cognitivecomp                                  0.001571909
## stat_difficulty                                     0.064889609
## stat_value                                         -0.041065281
## efficacy                                            0.011240682
## extrgoal                                           -0.018137106
## intrgoal                                            0.039594975
## testanxiety                                         0.063261876
## mathanxiety                                         0.032790097
## interest                                           -0.056984503
## course                                              0.044305478
##                                 certificate_russianlanggrade
## math_scores                                       0.12216889
## social_studies_scores                             0.30667361
## russian_language_scores                           0.30017206
## foreign_language_scores                           0.31602555
## certificate_mathgrade                             0.62829963
## certificate_social_studiesgrade                   0.48883817
## certificate_russianlanggrade                      1.00000000
## certificate_foreign_langgrade                     0.52134613
## gpa                                               0.40422486
## subject_mark                                      0.17195549
## gender                                           -0.43607037
## father_ISCO                                       0.15447927
## mother_ISCO                                       0.12458614
## stat_affect                                       0.06258597
## stat_cognitivecomp                               -0.01666650
## stat_difficulty                                   0.09180853
## stat_value                                       -0.05732558
## efficacy                                         -0.01138230
## extrgoal                                         -0.04498487
## intrgoal                                          0.01406144
## testanxiety                                       0.08158489
## mathanxiety                                       0.07087570
## interest                                         -0.06623677
## course                                            0.14806940
##                                 certificate_foreign_langgrade         gpa
## math_scores                                       0.027618482  0.42578919
## social_studies_scores                             0.264999465  0.46996764
## russian_language_scores                           0.285141039  0.36838440
## foreign_language_scores                           0.305181109  0.46890419
## certificate_mathgrade                             0.498284640  0.44273573
## certificate_social_studiesgrade                   0.467877902  0.26700708
## certificate_russianlanggrade                      0.521346126  0.40422486
## certificate_foreign_langgrade                     1.000000000  0.28507351
## gpa                                               0.285073510  1.00000000
## subject_mark                                      0.108331373  0.61366468
## gender                                           -0.430774161 -0.23738074
## father_ISCO                                       0.085878926  0.08180342
## mother_ISCO                                       0.013238875  0.06455866
## stat_affect                                      -0.009050429  0.23639481
## stat_cognitivecomp                                0.058506110 -0.17263675
## stat_difficulty                                   0.036706123 -0.08603657
## stat_value                                       -0.034976368 -0.21375725
## efficacy                                          0.001648678  0.33855523
## extrgoal                                         -0.100210369  0.11751354
## intrgoal                                          0.032475900 -0.04408093
## testanxiety                                       0.068240689 -0.07438839
## mathanxiety                                       0.116524802 -0.07841520
## interest                                         -0.057168045  0.19211190
## course                                            0.120485972  0.05161812
##                                 subject_mark      gender father_ISCO
## math_scores                      0.233764237  0.06851771  0.12076766
## social_studies_scores            0.308346718 -0.28173006  0.12488349
## russian_language_scores          0.183408212 -0.30431906  0.11631694
## foreign_language_scores          0.184988308 -0.16509654  0.14975194
## certificate_mathgrade            0.242680206 -0.43851734  0.15488767
## certificate_social_studiesgrade  0.074224882 -0.33273969  0.10150983
## certificate_russianlanggrade     0.171955486 -0.43607037  0.15447927
## certificate_foreign_langgrade    0.108331373 -0.43077416  0.08587893
## gpa                              0.613664678 -0.23738074  0.08180342
## subject_mark                     1.000000000 -0.13037432 -0.03953584
## gender                          -0.130374323  1.00000000 -0.09590236
## father_ISCO                     -0.039535845 -0.09590236  1.00000000
## mother_ISCO                      0.048254456  0.02542340  0.09997725
## stat_affect                      0.160946617  0.07553418  0.01931649
## stat_cognitivecomp              -0.035464550 -0.18643381 -0.02319954
## stat_difficulty                  0.014186818 -0.18327079 -0.03685497
## stat_value                      -0.109365270 -0.06879662  0.03228279
## efficacy                         0.389094480  0.14351317 -0.02604902
## extrgoal                         0.184238422  0.26527072 -0.07009105
## intrgoal                        -0.129005953 -0.12979057 -0.11069757
## testanxiety                     -0.109512208 -0.28348584 -0.10694320
## mathanxiety                     -0.001112895 -0.25134357 -0.04004357
## interest                         0.203617424  0.18789659 -0.01666801
## course                           0.251836503 -0.19031277  0.02656832
##                                  mother_ISCO  stat_affect stat_cognitivecomp
## math_scores                      0.025019155  0.140892730       -0.329684372
## social_studies_scores            0.051257475  0.037435695       -0.015940253
## russian_language_scores          0.087335720  0.083923076       -0.011673242
## foreign_language_scores          0.008453903  0.053409115       -0.133089641
## certificate_mathgrade            0.005202136  0.037917029       -0.045608957
## certificate_social_studiesgrade  0.045637275  0.032495187        0.001571909
## certificate_russianlanggrade     0.124586142  0.062585973       -0.016666495
## certificate_foreign_langgrade    0.013238875 -0.009050429        0.058506110
## gpa                              0.064558660  0.236394815       -0.172636749
## subject_mark                     0.048254456  0.160946617       -0.035464550
## gender                           0.025423404  0.075534176       -0.186433806
## father_ISCO                      0.099977246  0.019316491       -0.023199541
## mother_ISCO                      1.000000000  0.034265985       -0.110093409
## stat_affect                      0.034265985  1.000000000       -0.378855835
## stat_cognitivecomp              -0.110093409 -0.378855835        1.000000000
## stat_difficulty                 -0.029756007 -0.268428753        0.631088837
## stat_value                      -0.074694986 -0.651758207        0.313128877
## efficacy                        -0.102124331  0.355070912       -0.411798431
## extrgoal                        -0.093866430  0.352975290       -0.190601338
## intrgoal                        -0.110720249  0.071766081        0.209971001
## testanxiety                     -0.036959686 -0.063414836        0.455056380
## mathanxiety                     -0.047689285 -0.086447877        0.475444207
## interest                        -0.054391629  0.394764461       -0.199739678
## course                           0.023851480 -0.034172936        0.041111951
##                                 stat_difficulty  stat_value     efficacy
## math_scores                        -0.215155145 -0.10605834  0.303241268
## social_studies_scores              -0.001475602 -0.11004951  0.120022659
## russian_language_scores            -0.027090400 -0.08619467  0.026456288
## foreign_language_scores            -0.112489113 -0.11238131  0.099657882
## certificate_mathgrade               0.023980111 -0.01400182  0.095729787
## certificate_social_studiesgrade     0.064889609 -0.04106528  0.011240682
## certificate_russianlanggrade        0.091808532 -0.05732558 -0.011382297
## certificate_foreign_langgrade       0.036706123 -0.03497637  0.001648678
## gpa                                -0.086036569 -0.21375725  0.338555233
## subject_mark                        0.014186818 -0.10936527  0.389094480
## gender                             -0.183270785 -0.06879662  0.143513168
## father_ISCO                        -0.036854974  0.03228279 -0.026049016
## mother_ISCO                        -0.029756007 -0.07469499 -0.102124331
## stat_affect                        -0.268428753 -0.65175821  0.355070912
## stat_cognitivecomp                  0.631088837  0.31312888 -0.411798431
## stat_difficulty                     1.000000000  0.20997479 -0.322758773
## stat_value                          0.209974787  1.00000000 -0.265824022
## efficacy                           -0.322758773 -0.26582402  1.000000000
## extrgoal                           -0.070325832 -0.28243474  0.600829413
## intrgoal                            0.281992290  0.02817709 -0.025566348
## testanxiety                         0.489843786  0.13048589 -0.342588799
## mathanxiety                         0.411240563  0.18497722 -0.379012534
## interest                           -0.154394875 -0.36688530  0.644978388
## course                              0.191141331  0.12853089  0.002406911
##                                     extrgoal      intrgoal  testanxiety
## math_scores                      0.221043474 -0.0976674290 -0.250576749
## social_studies_scores           -0.003693572 -0.0754503730 -0.030548788
## russian_language_scores          0.018805159  0.0001241272  0.055263485
## foreign_language_scores         -0.057142789 -0.1174381197 -0.091988386
## certificate_mathgrade            0.010094366 -0.0641346281 -0.022944634
## certificate_social_studiesgrade -0.018137106  0.0395949745  0.063261876
## certificate_russianlanggrade    -0.044984868  0.0140614440  0.081584886
## certificate_foreign_langgrade   -0.100210369  0.0324758997  0.068240689
## gpa                              0.117513535 -0.0440809344 -0.074388393
## subject_mark                     0.184238422 -0.1290059529 -0.109512208
## gender                           0.265270723 -0.1297905714 -0.283485840
## father_ISCO                     -0.070091050 -0.1106975713 -0.106943204
## mother_ISCO                     -0.093866430 -0.1107202486 -0.036959686
## stat_affect                      0.352975290  0.0717660812 -0.063414836
## stat_cognitivecomp              -0.190601338  0.2099710010  0.455056380
## stat_difficulty                 -0.070325832  0.2819922903  0.489843786
## stat_value                      -0.282434736  0.0281770917  0.130485888
## efficacy                         0.600829413 -0.0255663479 -0.342588799
## extrgoal                         1.000000000  0.2066146701  0.001397036
## intrgoal                         0.206614670  1.0000000000  0.547747406
## testanxiety                      0.001397036  0.5477474060  1.000000000
## mathanxiety                     -0.136183499  0.3651534709  0.603877188
## interest                         0.710018920  0.1339214778 -0.064338242
## course                          -0.145016300 -0.2543210132 -0.063924831
##                                  mathanxiety    interest       course
## math_scores                     -0.201859899  0.27471106 -0.171214255
## social_studies_scores            0.009554514  0.05847632 -0.073175646
## russian_language_scores          0.047279692  0.01070735 -0.084039354
## foreign_language_scores         -0.052767832  0.04683470 -0.014617822
## certificate_mathgrade           -0.023254805  0.05456417  0.153095698
## certificate_social_studiesgrade  0.032790097 -0.05698450  0.044305478
## certificate_russianlanggrade     0.070875698 -0.06623677  0.148069404
## certificate_foreign_langgrade    0.116524802 -0.05716804  0.120485972
## gpa                             -0.078415204  0.19211190  0.051618119
## subject_mark                    -0.001112895  0.20361742  0.251836503
## gender                          -0.251343566  0.18789659 -0.190312767
## father_ISCO                     -0.040043574 -0.01666801  0.026568322
## mother_ISCO                     -0.047689285 -0.05439163  0.023851480
## stat_affect                     -0.086447877  0.39476446 -0.034172936
## stat_cognitivecomp               0.475444207 -0.19973968  0.041111951
## stat_difficulty                  0.411240563 -0.15439487  0.191141331
## stat_value                       0.184977219 -0.36688530  0.128530892
## efficacy                        -0.379012534  0.64497839  0.002406911
## extrgoal                        -0.136183499  0.71001892 -0.145016300
## intrgoal                         0.365153471  0.13392148 -0.254321013
## testanxiety                      0.603877188 -0.06433824 -0.063924831
## mathanxiety                      1.000000000 -0.24948765  0.012440510
## interest                        -0.249487653  1.00000000 -0.147356099
## course                           0.012440510 -0.14735610  1.000000000
corrplot(dat.cor, method = "circle", type="upper")

Correlation coefficients

  • Math USE scores and math school grade: ~ 0.27

  • Social sciences USE scores and Social sciences school grade: ~ 0.26

  • Russian language USE scores and Russian language school grade: ~ 0.30

  • Foreign language USE scores and Foreign language school grade: ~ 0.31

model21<-lm(math_scores~certificate_mathgrade, data = final_reg) 
summary(model21)
## 
## Call:
## lm(formula = math_scores ~ certificate_mathgrade, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -24.243  -5.085  -1.085   2.915  24.757 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            59.8720     3.5032  17.091  < 2e-16 ***
## certificate_mathgrade   3.8426     0.7464   5.148 4.52e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.172 on 331 degrees of freedom
## Multiple R-squared:  0.07413,    Adjusted R-squared:  0.07134 
## F-statistic:  26.5 on 1 and 331 DF,  p-value: 4.524e-07
model22<-lm(social_studies_scores~certificate_social_studiesgrade, data = final_reg) 
summary(model22)
## 
## Call:
## lm(formula = social_studies_scores ~ certificate_social_studiesgrade, 
##     data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -29.564  -5.564   1.435   7.436  21.250 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       51.493      6.446   7.989 2.28e-14 ***
## certificate_social_studiesgrade    6.814      1.328   5.132 4.90e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.689 on 331 degrees of freedom
## Multiple R-squared:  0.0737, Adjusted R-squared:  0.0709 
## F-statistic: 26.34 on 1 and 331 DF,  p-value: 4.9e-07
model23<-lm(russian_language_scores~certificate_russianlanggrade, data = final_reg) 
summary(model23)
## 
## Call:
## lm(formula = russian_language_scores ~ certificate_russianlanggrade, 
##     data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -82.406  -4.406   2.594   4.594  13.819 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   65.2790     4.3066  15.158  < 2e-16 ***
## certificate_russianlanggrade   5.2254     0.9127   5.725 2.32e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.52 on 331 degrees of freedom
## Multiple R-squared:  0.0901, Adjusted R-squared:  0.08735 
## F-statistic: 32.78 on 1 and 331 DF,  p-value: 2.319e-08
model24<-lm(foreign_language_scores~certificate_foreign_langgrade, data = final_reg) 
summary(model24)
## 
## Call:
## lm(formula = foreign_language_scores ~ certificate_foreign_langgrade, 
##     data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -30.626  -4.626   2.374   5.374  20.105 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     52.973      5.589   9.477  < 2e-16 ***
## certificate_foreign_langgrade    6.731      1.154   5.830 1.31e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.316 on 331 degrees of freedom
## Multiple R-squared:  0.09314,    Adjusted R-squared:  0.0904 
## F-statistic: 33.99 on 1 and 331 DF,  p-value: 1.314e-08

Cheking H5: performance goal orientation will positively predict anxiety while self-efficacy beliefs will have negative correlation with it.

Correlation

library(polycor)
library(corrplot)
dat.cor <- hetcor(final_reg)
dat.cor<- dat.cor$correlations
dat.cor
##                                 math_scores social_studies_scores
## math_scores                      1.00000000           0.327192422
## social_studies_scores            0.32719242           1.000000000
## russian_language_scores          0.23984168           0.394356726
## foreign_language_scores          0.35776048           0.512822092
## certificate_mathgrade            0.27227228           0.373012807
## certificate_social_studiesgrade  0.07155964           0.271478846
## certificate_russianlanggrade     0.12216889           0.306673614
## certificate_foreign_langgrade    0.02761848           0.264999465
## gpa                              0.42578919           0.469967643
## subject_mark                     0.23376424           0.308346718
## gender                           0.06851771          -0.281730060
## father_ISCO                      0.12076766           0.124883489
## mother_ISCO                      0.02501915           0.051257475
## stat_affect                      0.14089273           0.037435695
## stat_cognitivecomp              -0.32968437          -0.015940253
## stat_difficulty                 -0.21515514          -0.001475602
## stat_value                      -0.10605834          -0.110049510
## efficacy                         0.30324127           0.120022659
## extrgoal                         0.22104347          -0.003693572
## intrgoal                        -0.09766743          -0.075450373
## testanxiety                     -0.25057675          -0.030548788
## mathanxiety                     -0.20185990           0.009554514
## interest                         0.27471106           0.058476316
## course                          -0.17121426          -0.073175646
##                                 russian_language_scores foreign_language_scores
## math_scores                                0.2398416849             0.357760475
## social_studies_scores                      0.3943567262             0.512822092
## russian_language_scores                    1.0000000000             0.380804573
## foreign_language_scores                    0.3808045734             1.000000000
## certificate_mathgrade                      0.3474007961             0.379777902
## certificate_social_studiesgrade            0.1768063822             0.216928181
## certificate_russianlanggrade               0.3001720599             0.316025547
## certificate_foreign_langgrade              0.2851410394             0.305181109
## gpa                                        0.3683844021             0.468904187
## subject_mark                               0.1834082120             0.184988308
## gender                                    -0.3043190630            -0.165096545
## father_ISCO                                0.1163169421             0.149751939
## mother_ISCO                                0.0873357203             0.008453903
## stat_affect                                0.0839230764             0.053409115
## stat_cognitivecomp                        -0.0116732417            -0.133089641
## stat_difficulty                           -0.0270903996            -0.112489113
## stat_value                                -0.0861946654            -0.112381313
## efficacy                                   0.0264562878             0.099657882
## extrgoal                                   0.0188051588            -0.057142789
## intrgoal                                   0.0001241272            -0.117438120
## testanxiety                                0.0552634845            -0.091988386
## mathanxiety                                0.0472796919            -0.052767832
## interest                                   0.0107073489             0.046834696
## course                                    -0.0840393535            -0.014617822
##                                 certificate_mathgrade
## math_scores                               0.272272283
## social_studies_scores                     0.373012807
## russian_language_scores                   0.347400796
## foreign_language_scores                   0.379777902
## certificate_mathgrade                     1.000000000
## certificate_social_studiesgrade           0.525399537
## certificate_russianlanggrade              0.628299631
## certificate_foreign_langgrade             0.498284640
## gpa                                       0.442735729
## subject_mark                              0.242680206
## gender                                   -0.438517343
## father_ISCO                               0.154887669
## mother_ISCO                               0.005202136
## stat_affect                               0.037917029
## stat_cognitivecomp                       -0.045608957
## stat_difficulty                           0.023980111
## stat_value                               -0.014001819
## efficacy                                  0.095729787
## extrgoal                                  0.010094366
## intrgoal                                 -0.064134628
## testanxiety                              -0.022944634
## mathanxiety                              -0.023254805
## interest                                  0.054564167
## course                                    0.153095698
##                                 certificate_social_studiesgrade
## math_scores                                         0.071559641
## social_studies_scores                               0.271478846
## russian_language_scores                             0.176806382
## foreign_language_scores                             0.216928181
## certificate_mathgrade                               0.525399537
## certificate_social_studiesgrade                     1.000000000
## certificate_russianlanggrade                        0.488838172
## certificate_foreign_langgrade                       0.467877902
## gpa                                                 0.267007084
## subject_mark                                        0.074224882
## gender                                             -0.332739691
## father_ISCO                                         0.101509834
## mother_ISCO                                         0.045637275
## stat_affect                                         0.032495187
## stat_cognitivecomp                                  0.001571909
## stat_difficulty                                     0.064889609
## stat_value                                         -0.041065281
## efficacy                                            0.011240682
## extrgoal                                           -0.018137106
## intrgoal                                            0.039594975
## testanxiety                                         0.063261876
## mathanxiety                                         0.032790097
## interest                                           -0.056984503
## course                                              0.044305478
##                                 certificate_russianlanggrade
## math_scores                                       0.12216889
## social_studies_scores                             0.30667361
## russian_language_scores                           0.30017206
## foreign_language_scores                           0.31602555
## certificate_mathgrade                             0.62829963
## certificate_social_studiesgrade                   0.48883817
## certificate_russianlanggrade                      1.00000000
## certificate_foreign_langgrade                     0.52134613
## gpa                                               0.40422486
## subject_mark                                      0.17195549
## gender                                           -0.43607037
## father_ISCO                                       0.15447927
## mother_ISCO                                       0.12458614
## stat_affect                                       0.06258597
## stat_cognitivecomp                               -0.01666650
## stat_difficulty                                   0.09180853
## stat_value                                       -0.05732558
## efficacy                                         -0.01138230
## extrgoal                                         -0.04498487
## intrgoal                                          0.01406144
## testanxiety                                       0.08158489
## mathanxiety                                       0.07087570
## interest                                         -0.06623677
## course                                            0.14806940
##                                 certificate_foreign_langgrade         gpa
## math_scores                                       0.027618482  0.42578919
## social_studies_scores                             0.264999465  0.46996764
## russian_language_scores                           0.285141039  0.36838440
## foreign_language_scores                           0.305181109  0.46890419
## certificate_mathgrade                             0.498284640  0.44273573
## certificate_social_studiesgrade                   0.467877902  0.26700708
## certificate_russianlanggrade                      0.521346126  0.40422486
## certificate_foreign_langgrade                     1.000000000  0.28507351
## gpa                                               0.285073510  1.00000000
## subject_mark                                      0.108331373  0.61366468
## gender                                           -0.430774161 -0.23738074
## father_ISCO                                       0.085878926  0.08180342
## mother_ISCO                                       0.013238875  0.06455866
## stat_affect                                      -0.009050429  0.23639481
## stat_cognitivecomp                                0.058506110 -0.17263675
## stat_difficulty                                   0.036706123 -0.08603657
## stat_value                                       -0.034976368 -0.21375725
## efficacy                                          0.001648678  0.33855523
## extrgoal                                         -0.100210369  0.11751354
## intrgoal                                          0.032475900 -0.04408093
## testanxiety                                       0.068240689 -0.07438839
## mathanxiety                                       0.116524802 -0.07841520
## interest                                         -0.057168045  0.19211190
## course                                            0.120485972  0.05161812
##                                 subject_mark      gender father_ISCO
## math_scores                      0.233764237  0.06851771  0.12076766
## social_studies_scores            0.308346718 -0.28173006  0.12488349
## russian_language_scores          0.183408212 -0.30431906  0.11631694
## foreign_language_scores          0.184988308 -0.16509654  0.14975194
## certificate_mathgrade            0.242680206 -0.43851734  0.15488767
## certificate_social_studiesgrade  0.074224882 -0.33273969  0.10150983
## certificate_russianlanggrade     0.171955486 -0.43607037  0.15447927
## certificate_foreign_langgrade    0.108331373 -0.43077416  0.08587893
## gpa                              0.613664678 -0.23738074  0.08180342
## subject_mark                     1.000000000 -0.13037432 -0.03953584
## gender                          -0.130374323  1.00000000 -0.09590236
## father_ISCO                     -0.039535845 -0.09590236  1.00000000
## mother_ISCO                      0.048254456  0.02542340  0.09997725
## stat_affect                      0.160946617  0.07553418  0.01931649
## stat_cognitivecomp              -0.035464550 -0.18643381 -0.02319954
## stat_difficulty                  0.014186818 -0.18327079 -0.03685497
## stat_value                      -0.109365270 -0.06879662  0.03228279
## efficacy                         0.389094480  0.14351317 -0.02604902
## extrgoal                         0.184238422  0.26527072 -0.07009105
## intrgoal                        -0.129005953 -0.12979057 -0.11069757
## testanxiety                     -0.109512208 -0.28348584 -0.10694320
## mathanxiety                     -0.001112895 -0.25134357 -0.04004357
## interest                         0.203617424  0.18789659 -0.01666801
## course                           0.251836503 -0.19031277  0.02656832
##                                  mother_ISCO  stat_affect stat_cognitivecomp
## math_scores                      0.025019155  0.140892730       -0.329684372
## social_studies_scores            0.051257475  0.037435695       -0.015940253
## russian_language_scores          0.087335720  0.083923076       -0.011673242
## foreign_language_scores          0.008453903  0.053409115       -0.133089641
## certificate_mathgrade            0.005202136  0.037917029       -0.045608957
## certificate_social_studiesgrade  0.045637275  0.032495187        0.001571909
## certificate_russianlanggrade     0.124586142  0.062585973       -0.016666495
## certificate_foreign_langgrade    0.013238875 -0.009050429        0.058506110
## gpa                              0.064558660  0.236394815       -0.172636749
## subject_mark                     0.048254456  0.160946617       -0.035464550
## gender                           0.025423404  0.075534176       -0.186433806
## father_ISCO                      0.099977246  0.019316491       -0.023199541
## mother_ISCO                      1.000000000  0.034265985       -0.110093409
## stat_affect                      0.034265985  1.000000000       -0.378855835
## stat_cognitivecomp              -0.110093409 -0.378855835        1.000000000
## stat_difficulty                 -0.029756007 -0.268428753        0.631088837
## stat_value                      -0.074694986 -0.651758207        0.313128877
## efficacy                        -0.102124331  0.355070912       -0.411798431
## extrgoal                        -0.093866430  0.352975290       -0.190601338
## intrgoal                        -0.110720249  0.071766081        0.209971001
## testanxiety                     -0.036959686 -0.063414836        0.455056380
## mathanxiety                     -0.047689285 -0.086447877        0.475444207
## interest                        -0.054391629  0.394764461       -0.199739678
## course                           0.023851480 -0.034172936        0.041111951
##                                 stat_difficulty  stat_value     efficacy
## math_scores                        -0.215155145 -0.10605834  0.303241268
## social_studies_scores              -0.001475602 -0.11004951  0.120022659
## russian_language_scores            -0.027090400 -0.08619467  0.026456288
## foreign_language_scores            -0.112489113 -0.11238131  0.099657882
## certificate_mathgrade               0.023980111 -0.01400182  0.095729787
## certificate_social_studiesgrade     0.064889609 -0.04106528  0.011240682
## certificate_russianlanggrade        0.091808532 -0.05732558 -0.011382297
## certificate_foreign_langgrade       0.036706123 -0.03497637  0.001648678
## gpa                                -0.086036569 -0.21375725  0.338555233
## subject_mark                        0.014186818 -0.10936527  0.389094480
## gender                             -0.183270785 -0.06879662  0.143513168
## father_ISCO                        -0.036854974  0.03228279 -0.026049016
## mother_ISCO                        -0.029756007 -0.07469499 -0.102124331
## stat_affect                        -0.268428753 -0.65175821  0.355070912
## stat_cognitivecomp                  0.631088837  0.31312888 -0.411798431
## stat_difficulty                     1.000000000  0.20997479 -0.322758773
## stat_value                          0.209974787  1.00000000 -0.265824022
## efficacy                           -0.322758773 -0.26582402  1.000000000
## extrgoal                           -0.070325832 -0.28243474  0.600829413
## intrgoal                            0.281992290  0.02817709 -0.025566348
## testanxiety                         0.489843786  0.13048589 -0.342588799
## mathanxiety                         0.411240563  0.18497722 -0.379012534
## interest                           -0.154394875 -0.36688530  0.644978388
## course                              0.191141331  0.12853089  0.002406911
##                                     extrgoal      intrgoal  testanxiety
## math_scores                      0.221043474 -0.0976674290 -0.250576749
## social_studies_scores           -0.003693572 -0.0754503730 -0.030548788
## russian_language_scores          0.018805159  0.0001241272  0.055263485
## foreign_language_scores         -0.057142789 -0.1174381197 -0.091988386
## certificate_mathgrade            0.010094366 -0.0641346281 -0.022944634
## certificate_social_studiesgrade -0.018137106  0.0395949745  0.063261876
## certificate_russianlanggrade    -0.044984868  0.0140614440  0.081584886
## certificate_foreign_langgrade   -0.100210369  0.0324758997  0.068240689
## gpa                              0.117513535 -0.0440809344 -0.074388393
## subject_mark                     0.184238422 -0.1290059529 -0.109512208
## gender                           0.265270723 -0.1297905714 -0.283485840
## father_ISCO                     -0.070091050 -0.1106975713 -0.106943204
## mother_ISCO                     -0.093866430 -0.1107202486 -0.036959686
## stat_affect                      0.352975290  0.0717660812 -0.063414836
## stat_cognitivecomp              -0.190601338  0.2099710010  0.455056380
## stat_difficulty                 -0.070325832  0.2819922903  0.489843786
## stat_value                      -0.282434736  0.0281770917  0.130485888
## efficacy                         0.600829413 -0.0255663479 -0.342588799
## extrgoal                         1.000000000  0.2066146701  0.001397036
## intrgoal                         0.206614670  1.0000000000  0.547747406
## testanxiety                      0.001397036  0.5477474060  1.000000000
## mathanxiety                     -0.136183499  0.3651534709  0.603877188
## interest                         0.710018920  0.1339214778 -0.064338242
## course                          -0.145016300 -0.2543210132 -0.063924831
##                                  mathanxiety    interest       course
## math_scores                     -0.201859899  0.27471106 -0.171214255
## social_studies_scores            0.009554514  0.05847632 -0.073175646
## russian_language_scores          0.047279692  0.01070735 -0.084039354
## foreign_language_scores         -0.052767832  0.04683470 -0.014617822
## certificate_mathgrade           -0.023254805  0.05456417  0.153095698
## certificate_social_studiesgrade  0.032790097 -0.05698450  0.044305478
## certificate_russianlanggrade     0.070875698 -0.06623677  0.148069404
## certificate_foreign_langgrade    0.116524802 -0.05716804  0.120485972
## gpa                             -0.078415204  0.19211190  0.051618119
## subject_mark                    -0.001112895  0.20361742  0.251836503
## gender                          -0.251343566  0.18789659 -0.190312767
## father_ISCO                     -0.040043574 -0.01666801  0.026568322
## mother_ISCO                     -0.047689285 -0.05439163  0.023851480
## stat_affect                     -0.086447877  0.39476446 -0.034172936
## stat_cognitivecomp               0.475444207 -0.19973968  0.041111951
## stat_difficulty                  0.411240563 -0.15439487  0.191141331
## stat_value                       0.184977219 -0.36688530  0.128530892
## efficacy                        -0.379012534  0.64497839  0.002406911
## extrgoal                        -0.136183499  0.71001892 -0.145016300
## intrgoal                         0.365153471  0.13392148 -0.254321013
## testanxiety                      0.603877188 -0.06433824 -0.063924831
## mathanxiety                      1.000000000 -0.24948765  0.012440510
## interest                        -0.249487653  1.00000000 -0.147356099
## course                           0.012440510 -0.14735610  1.000000000
corrplot(dat.cor, method = "circle", type="upper")

Correlation coefficients

  • Test anxiety and extrinsic goal orientation: 0.545

  • Test anxiety and self-efficacy: -0.34

  • Math anxiety and extrinsic goal orientation: 0.36

  • Math anxiety and self-efficacy: -0.37

Hypothesis is supported

Regression with outcome: test anxiety

model19<-lm(testanxiety~extrgoal+efficacy, data = final_reg) 
summary(model19)
## 
## Call:
## lm(formula = testanxiety ~ extrgoal + efficacy, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0411 -0.5743  0.1295  0.7039  1.7785 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -4.497e-17  4.872e-02   0.000        1    
## extrgoal     3.228e-01  6.190e-02   5.215 3.25e-07 ***
## efficacy    -5.240e-01  6.063e-02  -8.643 2.41e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8891 on 330 degrees of freedom
## Multiple R-squared:  0.1846, Adjusted R-squared:  0.1796 
## F-statistic: 37.35 on 2 and 330 DF,  p-value: 2.39e-15

The hypothesis seem to be supported by the regression model since the coefficients are statistically significant and indicate that:

  • extrgoal: students whose main goal is to get better grades (high performance goal orientation) have higher test anxiety

  • efficacy: students who are confident in their ability to perform a task have lower test anxiety

Regression with outcome: math anxiety

model20<-lm(mathanxiety~extrgoal+efficacy, data = final_reg) 
summary(model20)
## 
## Call:
## lm(formula = mathanxiety ~ extrgoal + efficacy, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.8968 -0.6750 -0.1177  0.5578  2.8162 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.543e-16  5.242e-02   0.000   1.0000    
## extrgoal     1.509e-01  6.659e-02   2.265   0.0241 *  
## efficacy    -4.798e-01  6.523e-02  -7.355 1.53e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9565 on 330 degrees of freedom
## Multiple R-squared:  0.1568, Adjusted R-squared:  0.1517 
## F-statistic: 30.67 on 2 and 330 DF,  p-value: 6.049e-13

The proportion of the explained variance in this case is almost twice lower, but the trend is the same as with test anxiety

Cheking H6: interest will predict adoption of learning goal orientation which in turn will end up in the increased self-efficacy beliefs

library(polycor)
dat.cor <- hetcor(final_reg)
dat.cor<- dat.cor$correlations
dat.cor
##                                 math_scores social_studies_scores
## math_scores                      1.00000000           0.327192422
## social_studies_scores            0.32719242           1.000000000
## russian_language_scores          0.23984168           0.394356726
## foreign_language_scores          0.35776048           0.512822092
## certificate_mathgrade            0.27227228           0.373012807
## certificate_social_studiesgrade  0.07155964           0.271478846
## certificate_russianlanggrade     0.12216889           0.306673614
## certificate_foreign_langgrade    0.02761848           0.264999465
## gpa                              0.42578919           0.469967643
## subject_mark                     0.23376424           0.308346718
## gender                           0.06851771          -0.281730060
## father_ISCO                      0.12076766           0.124883489
## mother_ISCO                      0.02501915           0.051257475
## stat_affect                      0.14089273           0.037435695
## stat_cognitivecomp              -0.32968437          -0.015940253
## stat_difficulty                 -0.21515514          -0.001475602
## stat_value                      -0.10605834          -0.110049510
## efficacy                         0.30324127           0.120022659
## extrgoal                         0.22104347          -0.003693572
## intrgoal                        -0.09766743          -0.075450373
## testanxiety                     -0.25057675          -0.030548788
## mathanxiety                     -0.20185990           0.009554514
## interest                         0.27471106           0.058476316
## course                          -0.17121426          -0.073175646
##                                 russian_language_scores foreign_language_scores
## math_scores                                0.2398416849             0.357760475
## social_studies_scores                      0.3943567262             0.512822092
## russian_language_scores                    1.0000000000             0.380804573
## foreign_language_scores                    0.3808045734             1.000000000
## certificate_mathgrade                      0.3474007961             0.379777902
## certificate_social_studiesgrade            0.1768063822             0.216928181
## certificate_russianlanggrade               0.3001720599             0.316025547
## certificate_foreign_langgrade              0.2851410394             0.305181109
## gpa                                        0.3683844021             0.468904187
## subject_mark                               0.1834082120             0.184988308
## gender                                    -0.3043190630            -0.165096545
## father_ISCO                                0.1163169421             0.149751939
## mother_ISCO                                0.0873357203             0.008453903
## stat_affect                                0.0839230764             0.053409115
## stat_cognitivecomp                        -0.0116732417            -0.133089641
## stat_difficulty                           -0.0270903996            -0.112489113
## stat_value                                -0.0861946654            -0.112381313
## efficacy                                   0.0264562878             0.099657882
## extrgoal                                   0.0188051588            -0.057142789
## intrgoal                                   0.0001241272            -0.117438120
## testanxiety                                0.0552634845            -0.091988386
## mathanxiety                                0.0472796919            -0.052767832
## interest                                   0.0107073489             0.046834696
## course                                    -0.0840393535            -0.014617822
##                                 certificate_mathgrade
## math_scores                               0.272272283
## social_studies_scores                     0.373012807
## russian_language_scores                   0.347400796
## foreign_language_scores                   0.379777902
## certificate_mathgrade                     1.000000000
## certificate_social_studiesgrade           0.525399537
## certificate_russianlanggrade              0.628299631
## certificate_foreign_langgrade             0.498284640
## gpa                                       0.442735729
## subject_mark                              0.242680206
## gender                                   -0.438517343
## father_ISCO                               0.154887669
## mother_ISCO                               0.005202136
## stat_affect                               0.037917029
## stat_cognitivecomp                       -0.045608957
## stat_difficulty                           0.023980111
## stat_value                               -0.014001819
## efficacy                                  0.095729787
## extrgoal                                  0.010094366
## intrgoal                                 -0.064134628
## testanxiety                              -0.022944634
## mathanxiety                              -0.023254805
## interest                                  0.054564167
## course                                    0.153095698
##                                 certificate_social_studiesgrade
## math_scores                                         0.071559641
## social_studies_scores                               0.271478846
## russian_language_scores                             0.176806382
## foreign_language_scores                             0.216928181
## certificate_mathgrade                               0.525399537
## certificate_social_studiesgrade                     1.000000000
## certificate_russianlanggrade                        0.488838172
## certificate_foreign_langgrade                       0.467877902
## gpa                                                 0.267007084
## subject_mark                                        0.074224882
## gender                                             -0.332739691
## father_ISCO                                         0.101509834
## mother_ISCO                                         0.045637275
## stat_affect                                         0.032495187
## stat_cognitivecomp                                  0.001571909
## stat_difficulty                                     0.064889609
## stat_value                                         -0.041065281
## efficacy                                            0.011240682
## extrgoal                                           -0.018137106
## intrgoal                                            0.039594975
## testanxiety                                         0.063261876
## mathanxiety                                         0.032790097
## interest                                           -0.056984503
## course                                              0.044305478
##                                 certificate_russianlanggrade
## math_scores                                       0.12216889
## social_studies_scores                             0.30667361
## russian_language_scores                           0.30017206
## foreign_language_scores                           0.31602555
## certificate_mathgrade                             0.62829963
## certificate_social_studiesgrade                   0.48883817
## certificate_russianlanggrade                      1.00000000
## certificate_foreign_langgrade                     0.52134613
## gpa                                               0.40422486
## subject_mark                                      0.17195549
## gender                                           -0.43607037
## father_ISCO                                       0.15447927
## mother_ISCO                                       0.12458614
## stat_affect                                       0.06258597
## stat_cognitivecomp                               -0.01666650
## stat_difficulty                                   0.09180853
## stat_value                                       -0.05732558
## efficacy                                         -0.01138230
## extrgoal                                         -0.04498487
## intrgoal                                          0.01406144
## testanxiety                                       0.08158489
## mathanxiety                                       0.07087570
## interest                                         -0.06623677
## course                                            0.14806940
##                                 certificate_foreign_langgrade         gpa
## math_scores                                       0.027618482  0.42578919
## social_studies_scores                             0.264999465  0.46996764
## russian_language_scores                           0.285141039  0.36838440
## foreign_language_scores                           0.305181109  0.46890419
## certificate_mathgrade                             0.498284640  0.44273573
## certificate_social_studiesgrade                   0.467877902  0.26700708
## certificate_russianlanggrade                      0.521346126  0.40422486
## certificate_foreign_langgrade                     1.000000000  0.28507351
## gpa                                               0.285073510  1.00000000
## subject_mark                                      0.108331373  0.61366468
## gender                                           -0.430774161 -0.23738074
## father_ISCO                                       0.085878926  0.08180342
## mother_ISCO                                       0.013238875  0.06455866
## stat_affect                                      -0.009050429  0.23639481
## stat_cognitivecomp                                0.058506110 -0.17263675
## stat_difficulty                                   0.036706123 -0.08603657
## stat_value                                       -0.034976368 -0.21375725
## efficacy                                          0.001648678  0.33855523
## extrgoal                                         -0.100210369  0.11751354
## intrgoal                                          0.032475900 -0.04408093
## testanxiety                                       0.068240689 -0.07438839
## mathanxiety                                       0.116524802 -0.07841520
## interest                                         -0.057168045  0.19211190
## course                                            0.120485972  0.05161812
##                                 subject_mark      gender father_ISCO
## math_scores                      0.233764237  0.06851771  0.12076766
## social_studies_scores            0.308346718 -0.28173006  0.12488349
## russian_language_scores          0.183408212 -0.30431906  0.11631694
## foreign_language_scores          0.184988308 -0.16509654  0.14975194
## certificate_mathgrade            0.242680206 -0.43851734  0.15488767
## certificate_social_studiesgrade  0.074224882 -0.33273969  0.10150983
## certificate_russianlanggrade     0.171955486 -0.43607037  0.15447927
## certificate_foreign_langgrade    0.108331373 -0.43077416  0.08587893
## gpa                              0.613664678 -0.23738074  0.08180342
## subject_mark                     1.000000000 -0.13037432 -0.03953584
## gender                          -0.130374323  1.00000000 -0.09590236
## father_ISCO                     -0.039535845 -0.09590236  1.00000000
## mother_ISCO                      0.048254456  0.02542340  0.09997725
## stat_affect                      0.160946617  0.07553418  0.01931649
## stat_cognitivecomp              -0.035464550 -0.18643381 -0.02319954
## stat_difficulty                  0.014186818 -0.18327079 -0.03685497
## stat_value                      -0.109365270 -0.06879662  0.03228279
## efficacy                         0.389094480  0.14351317 -0.02604902
## extrgoal                         0.184238422  0.26527072 -0.07009105
## intrgoal                        -0.129005953 -0.12979057 -0.11069757
## testanxiety                     -0.109512208 -0.28348584 -0.10694320
## mathanxiety                     -0.001112895 -0.25134357 -0.04004357
## interest                         0.203617424  0.18789659 -0.01666801
## course                           0.251836503 -0.19031277  0.02656832
##                                  mother_ISCO  stat_affect stat_cognitivecomp
## math_scores                      0.025019155  0.140892730       -0.329684372
## social_studies_scores            0.051257475  0.037435695       -0.015940253
## russian_language_scores          0.087335720  0.083923076       -0.011673242
## foreign_language_scores          0.008453903  0.053409115       -0.133089641
## certificate_mathgrade            0.005202136  0.037917029       -0.045608957
## certificate_social_studiesgrade  0.045637275  0.032495187        0.001571909
## certificate_russianlanggrade     0.124586142  0.062585973       -0.016666495
## certificate_foreign_langgrade    0.013238875 -0.009050429        0.058506110
## gpa                              0.064558660  0.236394815       -0.172636749
## subject_mark                     0.048254456  0.160946617       -0.035464550
## gender                           0.025423404  0.075534176       -0.186433806
## father_ISCO                      0.099977246  0.019316491       -0.023199541
## mother_ISCO                      1.000000000  0.034265985       -0.110093409
## stat_affect                      0.034265985  1.000000000       -0.378855835
## stat_cognitivecomp              -0.110093409 -0.378855835        1.000000000
## stat_difficulty                 -0.029756007 -0.268428753        0.631088837
## stat_value                      -0.074694986 -0.651758207        0.313128877
## efficacy                        -0.102124331  0.355070912       -0.411798431
## extrgoal                        -0.093866430  0.352975290       -0.190601338
## intrgoal                        -0.110720249  0.071766081        0.209971001
## testanxiety                     -0.036959686 -0.063414836        0.455056380
## mathanxiety                     -0.047689285 -0.086447877        0.475444207
## interest                        -0.054391629  0.394764461       -0.199739678
## course                           0.023851480 -0.034172936        0.041111951
##                                 stat_difficulty  stat_value     efficacy
## math_scores                        -0.215155145 -0.10605834  0.303241268
## social_studies_scores              -0.001475602 -0.11004951  0.120022659
## russian_language_scores            -0.027090400 -0.08619467  0.026456288
## foreign_language_scores            -0.112489113 -0.11238131  0.099657882
## certificate_mathgrade               0.023980111 -0.01400182  0.095729787
## certificate_social_studiesgrade     0.064889609 -0.04106528  0.011240682
## certificate_russianlanggrade        0.091808532 -0.05732558 -0.011382297
## certificate_foreign_langgrade       0.036706123 -0.03497637  0.001648678
## gpa                                -0.086036569 -0.21375725  0.338555233
## subject_mark                        0.014186818 -0.10936527  0.389094480
## gender                             -0.183270785 -0.06879662  0.143513168
## father_ISCO                        -0.036854974  0.03228279 -0.026049016
## mother_ISCO                        -0.029756007 -0.07469499 -0.102124331
## stat_affect                        -0.268428753 -0.65175821  0.355070912
## stat_cognitivecomp                  0.631088837  0.31312888 -0.411798431
## stat_difficulty                     1.000000000  0.20997479 -0.322758773
## stat_value                          0.209974787  1.00000000 -0.265824022
## efficacy                           -0.322758773 -0.26582402  1.000000000
## extrgoal                           -0.070325832 -0.28243474  0.600829413
## intrgoal                            0.281992290  0.02817709 -0.025566348
## testanxiety                         0.489843786  0.13048589 -0.342588799
## mathanxiety                         0.411240563  0.18497722 -0.379012534
## interest                           -0.154394875 -0.36688530  0.644978388
## course                              0.191141331  0.12853089  0.002406911
##                                     extrgoal      intrgoal  testanxiety
## math_scores                      0.221043474 -0.0976674290 -0.250576749
## social_studies_scores           -0.003693572 -0.0754503730 -0.030548788
## russian_language_scores          0.018805159  0.0001241272  0.055263485
## foreign_language_scores         -0.057142789 -0.1174381197 -0.091988386
## certificate_mathgrade            0.010094366 -0.0641346281 -0.022944634
## certificate_social_studiesgrade -0.018137106  0.0395949745  0.063261876
## certificate_russianlanggrade    -0.044984868  0.0140614440  0.081584886
## certificate_foreign_langgrade   -0.100210369  0.0324758997  0.068240689
## gpa                              0.117513535 -0.0440809344 -0.074388393
## subject_mark                     0.184238422 -0.1290059529 -0.109512208
## gender                           0.265270723 -0.1297905714 -0.283485840
## father_ISCO                     -0.070091050 -0.1106975713 -0.106943204
## mother_ISCO                     -0.093866430 -0.1107202486 -0.036959686
## stat_affect                      0.352975290  0.0717660812 -0.063414836
## stat_cognitivecomp              -0.190601338  0.2099710010  0.455056380
## stat_difficulty                 -0.070325832  0.2819922903  0.489843786
## stat_value                      -0.282434736  0.0281770917  0.130485888
## efficacy                         0.600829413 -0.0255663479 -0.342588799
## extrgoal                         1.000000000  0.2066146701  0.001397036
## intrgoal                         0.206614670  1.0000000000  0.547747406
## testanxiety                      0.001397036  0.5477474060  1.000000000
## mathanxiety                     -0.136183499  0.3651534709  0.603877188
## interest                         0.710018920  0.1339214778 -0.064338242
## course                          -0.145016300 -0.2543210132 -0.063924831
##                                  mathanxiety    interest       course
## math_scores                     -0.201859899  0.27471106 -0.171214255
## social_studies_scores            0.009554514  0.05847632 -0.073175646
## russian_language_scores          0.047279692  0.01070735 -0.084039354
## foreign_language_scores         -0.052767832  0.04683470 -0.014617822
## certificate_mathgrade           -0.023254805  0.05456417  0.153095698
## certificate_social_studiesgrade  0.032790097 -0.05698450  0.044305478
## certificate_russianlanggrade     0.070875698 -0.06623677  0.148069404
## certificate_foreign_langgrade    0.116524802 -0.05716804  0.120485972
## gpa                             -0.078415204  0.19211190  0.051618119
## subject_mark                    -0.001112895  0.20361742  0.251836503
## gender                          -0.251343566  0.18789659 -0.190312767
## father_ISCO                     -0.040043574 -0.01666801  0.026568322
## mother_ISCO                     -0.047689285 -0.05439163  0.023851480
## stat_affect                     -0.086447877  0.39476446 -0.034172936
## stat_cognitivecomp               0.475444207 -0.19973968  0.041111951
## stat_difficulty                  0.411240563 -0.15439487  0.191141331
## stat_value                       0.184977219 -0.36688530  0.128530892
## efficacy                        -0.379012534  0.64497839  0.002406911
## extrgoal                        -0.136183499  0.71001892 -0.145016300
## intrgoal                         0.365153471  0.13392148 -0.254321013
## testanxiety                      0.603877188 -0.06433824 -0.063924831
## mathanxiety                      1.000000000 -0.24948765  0.012440510
## interest                        -0.249487653  1.00000000 -0.147356099
## course                           0.012440510 -0.14735610  1.000000000

Correlation coefficients:

Interest and learning goal orientation: ~0.71

Learning goal orientation and self-efficacy beliefs: ~0.6

model25<-lm(intrgoal~interest, data = final_reg) 
summary(model25)
## 
## Call:
## lm(formula = intrgoal ~ interest, data = final_reg)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.48477 -0.51602 -0.00628  0.79478  1.76534 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept) 1.443e-16  5.264e-02   0.000   1.0000  
## interest    1.269e-01  5.160e-02   2.459   0.0145 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9607 on 331 degrees of freedom
## Multiple R-squared:  0.01793,    Adjusted R-squared:  0.01497 
## F-statistic: 6.045 on 1 and 331 DF,  p-value: 0.01446
model26<-lm(efficacy~intrgoal, data = final_reg) 
summary(model26)
## 
## Call:
## lm(formula = efficacy ~ intrgoal, data = final_reg)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.38767 -0.62803  0.00452  0.68146  2.16999 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)
## (Intercept)  2.854e-17  5.524e-02   0.000    1.000
## intrgoal    -2.659e-02  5.715e-02  -0.465    0.642
## 
## Residual standard error: 1.008 on 331 degrees of freedom
## Multiple R-squared:  0.0006536,  Adjusted R-squared:  -0.002366 
## F-statistic: 0.2165 on 1 and 331 DF,  p-value: 0.642

Sem model

library(lavaan)
myModel <- '
  subject_mark ~ certificate_mathgrade+efficacy + mathanxiety+intrgoal
  math_scores ~ certificate_mathgrade+extrgoal
  mathanxiety ~ efficacy+extrgoal
  intrgoal ~ interest+efficacy
  efficacy ~ interest+math_scores+extrgoal'
  
fit <- sem(model = myModel,
           data  = final_reg)
summary(fit, fit.measures = TRUE)
## lavaan 0.6-6 ended normally after 41 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of free parameters                         18
##                                                       
##   Number of observations                           333
##                                                       
## Model Test User Model:
##                                                       
##   Test statistic                                87.905
##   Degrees of freedom                                12
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                               510.317
##   Degrees of freedom                                25
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.844
##   Tucker-Lewis Index (TLI)                       0.674
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)              -3005.479
##   Loglikelihood unrestricted model (H1)      -2961.527
##                                                       
##   Akaike (AIC)                                6046.959
##   Bayesian (BIC)                              6115.505
##   Sample-size adjusted Bayesian (BIC)         6058.408
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.138
##   90 Percent confidence interval - lower         0.112
##   90 Percent confidence interval - upper         0.166
##   P-value RMSEA <= 0.05                          0.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.075
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|)
##   subject_mark ~                                      
##     certfct_mthgrd    0.633    0.157    4.037    0.000
##     efficacy          0.795    0.089    8.923    0.000
##     mathanxiety       0.418    0.086    4.863    0.000
##     intrgoal         -0.352    0.085   -4.131    0.000
##   math_scores ~                                       
##     certfct_mthgrd    3.812    0.725    5.259    0.000
##     extrgoal          1.648    0.388    4.251    0.000
##   mathanxiety ~                                       
##     efficacy         -0.480    0.066   -7.324    0.000
##     extrgoal          0.151    0.067    2.268    0.023
##   intrgoal ~                                          
##     interest          0.244    0.066    3.704    0.000
##     efficacy         -0.184    0.067   -2.742    0.006
##   efficacy ~                                          
##     interest          0.404    0.056    7.250    0.000
##     math_scores       0.017    0.006    3.146    0.002
##     extrgoal          0.287    0.058    4.926    0.000
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)
##    .subject_mark      2.260    0.175   12.903    0.000
##    .math_scores      48.501    3.759   12.903    0.000
##    .mathanxiety       0.907    0.070   12.903    0.000
##    .intrgoal          0.897    0.070   12.903    0.000
##    .efficacy          0.533    0.041   12.903    0.000
library(tidySEM)
library(lavaan)
library(ggplot2)
library(dplyr)
get_layout(fit)
##      [,1]       [,2]          [,3]                    [,4]         
## [1,] NA         NA            "certificate_mathgrade" NA           
## [2,] "extrgoal" NA            "interest"              "math_scores"
## [3,] "efficacy" "mathanxiety" "intrgoal"              NA           
##      [,5]          
## [1,] NA            
## [2,] "subject_mark"
## [3,] NA            
## attr(,"class")
## [1] "layout_matrix" "matrix"        "array"
lay <- get_layout("", "math_scores", "","certificate_mathgrade","",
                  "", "","","","",
                  "mathanxiety","","subject_mark","","intrgoal",
                  "extrgoal","","efficacy","","interest", rows = 4)
graph_sem(fit, layout = lay)

Subsetting courses

firstcourse <- subset(final_reg, course == 1)
firstcourse$father_ISCO <- as.numeric(firstcourse$father_ISCO)
secondcourse <- subset(final_reg, course == 2)
secondcourse$father_ISCO <- as.numeric(secondcourse$father_ISCO)
thirdcourse <- subset(final_reg, course == 3)
thirdcourse$father_ISCO <- as.numeric(thirdcourse$father_ISCO)

For the first course

firstmodel <-lm(subject_mark ~ math_scores, data = firstcourse) 
summary(firstmodel)
## 
## Call:
## lm(formula = subject_mark ~ math_scores, data = firstcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0684 -0.8807 -0.0684  0.7439  3.9316 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -1.44058    0.94261  -1.528    0.128    
## math_scores  0.09386    0.01192   7.871 4.31e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.245 on 166 degrees of freedom
## Multiple R-squared:  0.2718, Adjusted R-squared:  0.2674 
## F-statistic: 61.96 on 1 and 166 DF,  p-value: 4.307e-13
firstmodel1 <-lm(subject_mark ~ math_scores+social_studies_scores, data = firstcourse) 
summary(firstmodel1)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores, 
##     data = firstcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.1823 -0.7683  0.0062  0.6431  3.6365 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -3.42770    1.09493  -3.131  0.00206 ** 
## math_scores            0.08255    0.01208   6.836 1.51e-10 ***
## social_studies_scores  0.03355    0.01014   3.309  0.00115 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.209 on 165 degrees of freedom
## Multiple R-squared:  0.3171, Adjusted R-squared:  0.3088 
## F-statistic: 38.31 on 2 and 165 DF,  p-value: 2.155e-14
anova(firstmodel,firstmodel1)
firstmodel2 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores, data = firstcourse) 
summary(firstmodel2)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores, data = firstcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3281 -0.6783 -0.0400  0.6536  3.6619 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -4.70217    1.20931  -3.888 0.000146 ***
## math_scores              0.07375    0.01249   5.904 1.99e-08 ***
## social_studies_scores    0.02337    0.01091   2.143 0.033618 *  
## foreign_language_scores  0.03319    0.01415   2.345 0.020228 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.193 on 164 degrees of freedom
## Multiple R-squared:  0.3393, Adjusted R-squared:  0.3272 
## F-statistic: 28.07 on 3 and 164 DF,  p-value: 1.055e-14
anova(firstmodel1, firstmodel2)
firstmodel3 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+russian_language_scores, data = firstcourse) 
summary(firstmodel3)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + russian_language_scores, data = firstcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.2884 -0.7668 -0.0128  0.6751  3.6100 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -5.41528    1.29737  -4.174 4.86e-05 ***
## math_scores              0.06957    0.01276   5.452 1.81e-07 ***
## social_studies_scores    0.01897    0.01126   1.685   0.0939 .  
## foreign_language_scores  0.02726    0.01466   1.860   0.0647 .  
## russian_language_scores  0.02123    0.01432   1.483   0.1401    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.189 on 163 degrees of freedom
## Multiple R-squared:  0.3481, Adjusted R-squared:  0.3321 
## F-statistic: 21.76 on 4 and 163 DF,  p-value: 2.116e-14
anova(firstmodel2, firstmodel3)
firstmodel4 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade, data = firstcourse) 
summary(firstmodel4)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade, data = firstcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0066 -0.7404 -0.0847  0.6878  3.5710 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -5.44461    1.24167  -4.385 2.07e-05 ***
## math_scores              0.07032    0.01244   5.650 6.99e-08 ***
## social_studies_scores    0.01737    0.01112   1.563   0.1200    
## foreign_language_scores  0.02942    0.01409   2.087   0.0384 *  
## certificate_mathgrade    0.40190    0.18202   2.208   0.0286 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.179 on 163 degrees of freedom
## Multiple R-squared:  0.3585, Adjusted R-squared:  0.3427 
## F-statistic: 22.77 on 4 and 163 DF,  p-value: 5.873e-15
anova(firstmodel2, firstmodel4)
firstmodel5 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+certificate_social_studiesgrade, data = firstcourse) 
summary(firstmodel5)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + certificate_social_studiesgrade, 
##     data = firstcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0024 -0.7477 -0.0843  0.6835  3.5701 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     -5.33812    1.46297  -3.649 0.000355 ***
## math_scores                      0.07005    0.01263   5.549 1.15e-07 ***
## social_studies_scores            0.01756    0.01123   1.563 0.119908    
## foreign_language_scores          0.02945    0.01414   2.083 0.038799 *  
## certificate_mathgrade            0.41647    0.21064   1.977 0.049720 *  
## certificate_social_studiesgrade -0.03572    0.25753  -0.139 0.889841    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.183 on 162 degrees of freedom
## Multiple R-squared:  0.3585, Adjusted R-squared:  0.3387 
## F-statistic: 18.11 on 5 and 162 DF,  p-value: 2.991e-14
anova(firstmodel4, firstmodel5)
firstmodel6 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+certificate_foreign_langgrade, data = firstcourse) 
summary(firstmodel6)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + certificate_foreign_langgrade, 
##     data = firstcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.9865 -0.7271 -0.0763  0.6973  3.5746 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   -4.98854    1.44450  -3.453 0.000706 ***
## math_scores                    0.06874    0.01272   5.403  2.3e-07 ***
## social_studies_scores          0.01769    0.01115   1.587 0.114458    
## foreign_language_scores        0.03036    0.01420   2.138 0.034046 *  
## certificate_mathgrade          0.46915    0.21208   2.212 0.028354 *  
## certificate_foreign_langgrade -0.15669    0.25225  -0.621 0.535347    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.182 on 162 degrees of freedom
## Multiple R-squared:   0.36,  Adjusted R-squared:  0.3402 
## F-statistic: 18.22 on 5 and 162 DF,  p-value: 2.505e-14
anova(firstmodel4, firstmodel6)
firstmodel7 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+certificate_russianlanggrade, data = firstcourse) 
summary(firstmodel7)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + certificate_russianlanggrade, 
##     data = firstcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0111 -0.7446 -0.0800  0.6826  3.5695 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  -5.47436    1.28249  -4.269 3.34e-05 ***
## math_scores                   0.07049    0.01260   5.593 9.32e-08 ***
## social_studies_scores         0.01724    0.01124   1.534   0.1270    
## foreign_language_scores       0.02926    0.01422   2.058   0.0412 *  
## certificate_mathgrade         0.38974    0.22126   1.761   0.0800 .  
## certificate_russianlanggrade  0.02093    0.21530   0.097   0.9227    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.183 on 162 degrees of freedom
## Multiple R-squared:  0.3585, Adjusted R-squared:  0.3387 
## F-statistic: 18.11 on 5 and 162 DF,  p-value: 3.005e-14
anova(firstmodel4, firstmodel7)
firstmodel8 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+efficacy, data = firstcourse) 
summary(firstmodel8)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy, 
##     data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.43920 -0.66142 -0.08868  0.63209  2.88725 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.55800    1.18605  -3.000 0.003128 ** 
## math_scores              0.04390    0.01233   3.561 0.000485 ***
## social_studies_scores    0.01962    0.01020   1.924 0.056123 .  
## foreign_language_scores  0.02688    0.01293   2.079 0.039174 *  
## certificate_mathgrade    0.44207    0.16700   2.647 0.008918 ** 
## efficacy                 0.49648    0.08778   5.656 6.86e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.081 on 162 degrees of freedom
## Multiple R-squared:  0.4643, Adjusted R-squared:  0.4477 
## F-statistic: 28.08 on 5 and 162 DF,  p-value: < 2.2e-16
anova(firstmodel4, firstmodel8)
firstmodel9 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+efficacy+extrgoal, data = firstcourse) 
summary(firstmodel9)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy + 
##     extrgoal, data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.41644 -0.65072 -0.08417  0.62269  2.95836 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.51071    1.18603  -2.960 0.003541 ** 
## math_scores              0.04630    0.01251   3.701 0.000294 ***
## social_studies_scores    0.01899    0.01021   1.861 0.064587 .  
## foreign_language_scores  0.02511    0.01302   1.929 0.055474 .  
## certificate_mathgrade    0.43924    0.16691   2.632 0.009323 ** 
## efficacy                 0.57538    0.11318   5.084 1.02e-06 ***
## extrgoal                -0.13108    0.11881  -1.103 0.271565    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.08 on 161 degrees of freedom
## Multiple R-squared:  0.4683, Adjusted R-squared:  0.4485 
## F-statistic: 23.63 on 6 and 161 DF,  p-value: < 2.2e-16
anova(firstmodel8, firstmodel9)
firstmodel10 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+efficacy+intrgoal, data = firstcourse) 
summary(firstmodel10)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy + 
##     intrgoal, data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.35803 -0.70090 -0.07449  0.65516  2.91066 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.43561    1.19967  -2.864 0.004744 ** 
## math_scores              0.04255    0.01248   3.409 0.000824 ***
## social_studies_scores    0.01969    0.01021   1.928 0.055556 .  
## foreign_language_scores  0.02634    0.01297   2.031 0.043862 *  
## certificate_mathgrade    0.44992    0.16759   2.685 0.008020 ** 
## efficacy                 0.49759    0.08792   5.659  6.8e-08 ***
## intrgoal                -0.07027    0.09671  -0.727 0.468568    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.083 on 161 degrees of freedom
## Multiple R-squared:  0.466,  Adjusted R-squared:  0.4461 
## F-statistic: 23.42 on 6 and 161 DF,  p-value: < 2.2e-16
anova(firstmodel8, firstmodel10)
firstmodel11 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+efficacy+mathanxiety, data = firstcourse) 
summary(firstmodel11)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy + 
##     mathanxiety, data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.30378 -0.67225 -0.09858  0.63817  2.94061 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.61085    1.19082  -3.032 0.002830 ** 
## math_scores              0.04390    0.01235   3.555 0.000496 ***
## social_studies_scores    0.02009    0.01024   1.962 0.051464 .  
## foreign_language_scores  0.02681    0.01295   2.070 0.040006 *  
## certificate_mathgrade    0.44690    0.16745   2.669 0.008390 ** 
## efficacy                 0.46513    0.09993   4.655 6.74e-06 ***
## mathanxiety             -0.06422    0.09726  -0.660 0.510000    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.083 on 161 degrees of freedom
## Multiple R-squared:  0.4657, Adjusted R-squared:  0.4458 
## F-statistic: 23.39 on 6 and 161 DF,  p-value: < 2.2e-16
anova(firstmodel8, firstmodel11)
firstmodel12 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+efficacy+testanxiety, data = firstcourse) 
summary(firstmodel12)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy + 
##     testanxiety, data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.41300 -0.67078 -0.08601  0.63437  2.86274 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.53667    1.19263  -2.965 0.003483 ** 
## math_scores              0.04348    0.01248   3.484 0.000636 ***
## social_studies_scores    0.01964    0.01023   1.921 0.056525 .  
## foreign_language_scores  0.02683    0.01297   2.070 0.040094 *  
## certificate_mathgrade    0.44541    0.16803   2.651 0.008832 ** 
## efficacy                 0.48994    0.09193   5.329 3.28e-07 ***
## testanxiety             -0.02488    0.10073  -0.247 0.805206    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.084 on 161 degrees of freedom
## Multiple R-squared:  0.4645, Adjusted R-squared:  0.4445 
## F-statistic: 23.27 on 6 and 161 DF,  p-value: < 2.2e-16
anova(firstmodel8, firstmodel12)
firstmodel13 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+efficacy+interest, data = firstcourse) 
summary(firstmodel13)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy + 
##     interest, data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.46221 -0.63957 -0.08184  0.63483  2.90523 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.56471    1.19004  -2.995 0.003174 ** 
## math_scores              0.04410    0.01240   3.556 0.000495 ***
## social_studies_scores    0.01957    0.01023   1.913 0.057504 .  
## foreign_language_scores  0.02681    0.01297   2.067 0.040314 *  
## certificate_mathgrade    0.44270    0.16752   2.643 0.009039 ** 
## efficacy                 0.51088    0.11300   4.521 1.19e-05 ***
## interest                -0.02170    0.10667  -0.203 0.839088    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.084 on 161 degrees of freedom
## Multiple R-squared:  0.4644, Adjusted R-squared:  0.4444 
## F-statistic: 23.27 on 6 and 161 DF,  p-value: < 2.2e-16
anova(firstmodel8, firstmodel13)
firstmodel14 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores+certificate_mathgrade+efficacy+stat_difficulty, data = firstcourse) 
summary(firstmodel14)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy + 
##     stat_difficulty, data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.52506 -0.66705 -0.08934  0.66450  2.93810 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.52015    1.19224  -2.953 0.003623 ** 
## math_scores              0.04441    0.01241   3.577 0.000459 ***
## social_studies_scores    0.01895    0.01034   1.833 0.068654 .  
## foreign_language_scores  0.02711    0.01297   2.091 0.038143 *  
## certificate_mathgrade    0.43437    0.16836   2.580 0.010773 *  
## efficacy                 0.50962    0.09309   5.475 1.65e-07 ***
## stat_difficulty          0.04593    0.10604   0.433 0.665458    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.084 on 161 degrees of freedom
## Multiple R-squared:  0.4649, Adjusted R-squared:  0.4449 
## F-statistic: 23.31 on 6 and 161 DF,  p-value: < 2.2e-16
anova(firstmodel8, firstmodel14)

FINAL:

summary(firstmodel8)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy, 
##     data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.43920 -0.66142 -0.08868  0.63209  2.88725 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.55800    1.18605  -3.000 0.003128 ** 
## math_scores              0.04390    0.01233   3.561 0.000485 ***
## social_studies_scores    0.01962    0.01020   1.924 0.056123 .  
## foreign_language_scores  0.02688    0.01293   2.079 0.039174 *  
## certificate_mathgrade    0.44207    0.16700   2.647 0.008918 ** 
## efficacy                 0.49648    0.08778   5.656 6.86e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.081 on 162 degrees of freedom
## Multiple R-squared:  0.4643, Adjusted R-squared:  0.4477 
## F-statistic: 28.08 on 5 and 162 DF,  p-value: < 2.2e-16
names(firstcourse)
##  [1] "math_scores"                     "social_studies_scores"          
##  [3] "russian_language_scores"         "foreign_language_scores"        
##  [5] "certificate_mathgrade"           "certificate_social_studiesgrade"
##  [7] "certificate_russianlanggrade"    "certificate_foreign_langgrade"  
##  [9] "gpa"                             "subject_mark"                   
## [11] "gender"                          "father_ISCO"                    
## [13] "mother_ISCO"                     "stat_affect"                    
## [15] "stat_cognitivecomp"              "stat_difficulty"                
## [17] "stat_value"                      "efficacy"                       
## [19] "extrgoal"                        "intrgoal"                       
## [21] "testanxiety"                     "mathanxiety"                    
## [23] "interest"                        "course"

For the second course

secondmodel <-lm(subject_mark ~ math_scores, data = secondcourse) 
summary(secondmodel)
## 
## Call:
## lm(formula = subject_mark ~ math_scores, data = secondcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.7975 -0.5400 -0.2430  0.3016  2.8660 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -1.25137    1.06131  -1.179    0.241    
## math_scores  0.07425    0.01351   5.498 3.17e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.917 on 96 degrees of freedom
## Multiple R-squared:  0.2395, Adjusted R-squared:  0.2315 
## F-statistic: 30.23 on 1 and 96 DF,  p-value: 3.169e-07
secondmodel1 <-lm(subject_mark ~ math_scores+social_studies_scores, data = secondcourse) 
summary(secondmodel1)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores, 
##     data = secondcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.73232 -0.69547 -0.03864  0.27085  3.01489 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -1.725069   1.062213  -1.624 0.107682    
## math_scores            0.059041   0.014917   3.958 0.000146 ***
## social_studies_scores  0.020293   0.009172   2.213 0.029323 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8989 on 95 degrees of freedom
## Multiple R-squared:  0.2767, Adjusted R-squared:  0.2615 
## F-statistic: 18.17 on 2 and 95 DF,  p-value: 2.074e-07
anova(secondmodel,secondmodel1)
secondmodel2 <-lm(subject_mark ~ math_scores+social_studies_scores+foreign_language_scores, data = secondcourse) 
summary(secondmodel2)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores, data = secondcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.74576 -0.67992 -0.04446  0.29453  3.00682 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -1.576873   1.115185  -1.414 0.160665    
## math_scores              0.060540   0.015337   3.947 0.000152 ***
## social_studies_scores    0.023162   0.011159   2.076 0.040651 *  
## foreign_language_scores -0.005864   0.012874  -0.455 0.649800    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9027 on 94 degrees of freedom
## Multiple R-squared:  0.2783, Adjusted R-squared:  0.2553 
## F-statistic: 12.08 on 3 and 94 DF,  p-value: 9.283e-07
anova(secondmodel1,secondmodel2)
secondmodel3 <-lm(subject_mark ~ math_scores+social_studies_scores+russian_language_scores, data = secondcourse) 
summary(secondmodel3)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     russian_language_scores, data = secondcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.73439 -0.66004 -0.09576  0.31214  2.82621 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -0.99002    1.31143  -0.755 0.452184    
## math_scores              0.05913    0.01492   3.962 0.000145 ***
## social_studies_scores    0.02487    0.01035   2.403 0.018218 *  
## russian_language_scores -0.01260    0.01318  -0.957 0.341268    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8993 on 94 degrees of freedom
## Multiple R-squared:  0.2837, Adjusted R-squared:  0.2608 
## F-statistic: 12.41 on 3 and 94 DF,  p-value: 6.589e-07
anova(secondmodel1,secondmodel3)
secondmodel4 <-lm(subject_mark ~ math_scores+social_studies_scores+interest, data = secondcourse) 
summary(secondmodel4)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     interest, data = secondcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.42793 -0.59349 -0.09622  0.30080  2.81585 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           -1.24120    1.06836  -1.162 0.248267    
## math_scores            0.05180    0.01505   3.442 0.000865 ***
## social_studies_scores  0.02156    0.00903   2.388 0.018941 *  
## interest               0.19443    0.09218   2.109 0.037588 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.883 on 94 degrees of freedom
## Multiple R-squared:  0.3094, Adjusted R-squared:  0.2874 
## F-statistic: 14.04 on 3 and 94 DF,  p-value: 1.231e-07
anova(secondmodel1,secondmodel4)
secondmodel5 <-lm(subject_mark ~ math_scores+social_studies_scores+interest+mother_ISCO, data = secondcourse) 
summary(secondmodel5)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     interest + mother_ISCO, data = secondcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.3327 -0.6557 -0.1173  0.3532  2.7139 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)   
## (Intercept)           -1.356e+00  1.051e+00  -1.290  0.20027   
## math_scores            4.979e-02  1.482e-02   3.360  0.00113 **
## social_studies_scores  1.969e-02  8.918e-03   2.208  0.02970 * 
## interest               2.116e-01  9.095e-02   2.326  0.02219 * 
## mother_ISCO            1.541e-04  7.385e-05   2.087  0.03961 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8677 on 93 degrees of freedom
## Multiple R-squared:  0.3403, Adjusted R-squared:  0.3119 
## F-statistic: 11.99 on 4 and 93 DF,  p-value: 6.686e-08
anova(secondmodel4,secondmodel5)

FINAL:

summary(secondmodel5)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     interest + mother_ISCO, data = secondcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.3327 -0.6557 -0.1173  0.3532  2.7139 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)   
## (Intercept)           -1.356e+00  1.051e+00  -1.290  0.20027   
## math_scores            4.979e-02  1.482e-02   3.360  0.00113 **
## social_studies_scores  1.969e-02  8.918e-03   2.208  0.02970 * 
## interest               2.116e-01  9.095e-02   2.326  0.02219 * 
## mother_ISCO            1.541e-04  7.385e-05   2.087  0.03961 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8677 on 93 degrees of freedom
## Multiple R-squared:  0.3403, Adjusted R-squared:  0.3119 
## F-statistic: 11.99 on 4 and 93 DF,  p-value: 6.686e-08

For the third course

thirdmodel <-lm(subject_mark ~ efficacy, data = thirdcourse) 
summary(thirdmodel)
## 
## Call:
## lm(formula = subject_mark ~ efficacy, data = thirdcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4918 -1.2880  0.2723  1.1571  2.5665 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   7.6491     0.1802  42.455   <2e-16 ***
## efficacy      0.4111     0.1862   2.208   0.0308 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.453 on 65 degrees of freedom
## Multiple R-squared:  0.06974,    Adjusted R-squared:  0.05543 
## F-statistic: 4.873 on 1 and 65 DF,  p-value: 0.03081
thirdmodel1 <-lm(subject_mark ~ efficacy+mathanxiety, data = thirdcourse) 
summary(thirdmodel1)
## 
## Call:
## lm(formula = subject_mark ~ efficacy + mathanxiety, data = thirdcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.5445 -1.2109  0.1307  1.1429  2.5045 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   7.5702     0.1772  42.719  < 2e-16 ***
## efficacy      0.5105     0.1847   2.763  0.00746 ** 
## mathanxiety   0.3879     0.1634   2.375  0.02057 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.404 on 64 degrees of freedom
## Multiple R-squared:  0.1451, Adjusted R-squared:  0.1184 
## F-statistic:  5.43 on 2 and 64 DF,  p-value: 0.006634
anova(thirdmodel,thirdmodel1)
thirdmodel2 <-lm(subject_mark ~ efficacy+mathanxiety+father_ISCO, data = thirdcourse) 
summary(thirdmodel2)
## 
## Call:
## lm(formula = subject_mark ~ efficacy + mathanxiety + father_ISCO, 
##     data = thirdcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.52570 -1.13408  0.03359  1.01670  2.65986 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  8.020e+00  2.738e-01  29.295  < 2e-16 ***
## efficacy     4.784e-01  1.805e-01   2.650  0.01016 *  
## mathanxiety  4.365e-01  1.607e-01   2.716  0.00852 ** 
## father_ISCO -2.115e-04  9.986e-05  -2.118  0.03810 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.367 on 63 degrees of freedom
## Multiple R-squared:  0.2019, Adjusted R-squared:  0.1639 
## F-statistic: 5.313 on 3 and 63 DF,  p-value: 0.002502
anova(thirdmodel1,thirdmodel2)

FINAL

summary(thirdmodel2)
## 
## Call:
## lm(formula = subject_mark ~ efficacy + mathanxiety + father_ISCO, 
##     data = thirdcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.52570 -1.13408  0.03359  1.01670  2.65986 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  8.020e+00  2.738e-01  29.295  < 2e-16 ***
## efficacy     4.784e-01  1.805e-01   2.650  0.01016 *  
## mathanxiety  4.365e-01  1.607e-01   2.716  0.00852 ** 
## father_ISCO -2.115e-04  9.986e-05  -2.118  0.03810 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.367 on 63 degrees of freedom
## Multiple R-squared:  0.2019, Adjusted R-squared:  0.1639 
## F-statistic: 5.313 on 3 and 63 DF,  p-value: 0.002502

Final regression models

All courses

allmodel10 <-lm(subject_mark ~ math_scores+social_studies_scores+efficacy+mathanxiety*gender+intrgoal+course+father_ISCO+mother_ISCO, data = final_reg) 
summary(allmodel10)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     efficacy + mathanxiety * gender + intrgoal + course + father_ISCO + 
##     mother_ISCO, data = final_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.8132 -0.9505 -0.0618  0.9347  3.8595 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            -6.622e-01  1.067e+00  -0.621   0.5352    
## math_scores             2.807e-02  1.188e-02   2.363   0.0187 *  
## social_studies_scores   4.003e-02  8.616e-03   4.646 4.94e-06 ***
## efficacy                6.878e-01  8.925e-02   7.707 1.61e-13 ***
## mathanxiety             4.974e-01  1.116e-01   4.459 1.14e-05 ***
## gendermale             -1.882e-01  1.744e-01  -1.079   0.2814    
## intrgoal               -1.849e-01  9.283e-02  -1.992   0.0472 *  
## course                  5.432e-01  1.078e-01   5.041 7.74e-07 ***
## father_ISCO            -9.234e-05  4.154e-05  -2.223   0.0269 *  
## mother_ISCO             1.109e-04  7.065e-05   1.570   0.1173    
## mathanxiety:gendermale -3.689e-01  1.554e-01  -2.373   0.0182 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.416 on 322 degrees of freedom
## Multiple R-squared:  0.3574, Adjusted R-squared:  0.3375 
## F-statistic: 17.91 on 10 and 322 DF,  p-value: < 2.2e-16
library(sjPlot)
plot_model(allmodel10, type = "int")

library(car)
vif(allmodel10)
##           math_scores social_studies_scores              efficacy 
##              1.294967              1.242882              1.337638 
##           mathanxiety                gender              intrgoal 
##              2.224140              1.169720              1.337651 
##                course           father_ISCO           mother_ISCO 
##              1.184290              1.056549              1.042306 
##    mathanxiety:gender 
##              1.955272

FIRST

summary(firstmodel8)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     foreign_language_scores + certificate_mathgrade + efficacy, 
##     data = firstcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.43920 -0.66142 -0.08868  0.63209  2.88725 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             -3.55800    1.18605  -3.000 0.003128 ** 
## math_scores              0.04390    0.01233   3.561 0.000485 ***
## social_studies_scores    0.01962    0.01020   1.924 0.056123 .  
## foreign_language_scores  0.02688    0.01293   2.079 0.039174 *  
## certificate_mathgrade    0.44207    0.16700   2.647 0.008918 ** 
## efficacy                 0.49648    0.08778   5.656 6.86e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.081 on 162 degrees of freedom
## Multiple R-squared:  0.4643, Adjusted R-squared:  0.4477 
## F-statistic: 28.08 on 5 and 162 DF,  p-value: < 2.2e-16
library(car)
vif(firstmodel8)
##             math_scores   social_studies_scores foreign_language_scores 
##                1.417459                1.376110                1.419524 
##   certificate_mathgrade                efficacy 
##                1.199764                1.200318

SECOND

summary(secondmodel5)
## 
## Call:
## lm(formula = subject_mark ~ math_scores + social_studies_scores + 
##     interest + mother_ISCO, data = secondcourse)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.3327 -0.6557 -0.1173  0.3532  2.7139 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)   
## (Intercept)           -1.356e+00  1.051e+00  -1.290  0.20027   
## math_scores            4.979e-02  1.482e-02   3.360  0.00113 **
## social_studies_scores  1.969e-02  8.918e-03   2.208  0.02970 * 
## interest               2.116e-01  9.095e-02   2.326  0.02219 * 
## mother_ISCO            1.541e-04  7.385e-05   2.087  0.03961 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8677 on 93 degrees of freedom
## Multiple R-squared:  0.3403, Adjusted R-squared:  0.3119 
## F-statistic: 11.99 on 4 and 93 DF,  p-value: 6.686e-08
library(car)
vif(secondmodel5)
##           math_scores social_studies_scores              interest 
##              1.344906              1.288200              1.065761 
##           mother_ISCO 
##              1.031168

THIRD

summary(thirdmodel2)
## 
## Call:
## lm(formula = subject_mark ~ efficacy + mathanxiety + father_ISCO, 
##     data = thirdcourse)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.52570 -1.13408  0.03359  1.01670  2.65986 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  8.020e+00  2.738e-01  29.295  < 2e-16 ***
## efficacy     4.784e-01  1.805e-01   2.650  0.01016 *  
## mathanxiety  4.365e-01  1.607e-01   2.716  0.00852 ** 
## father_ISCO -2.115e-04  9.986e-05  -2.118  0.03810 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.367 on 63 degrees of freedom
## Multiple R-squared:  0.2019, Adjusted R-squared:  0.1639 
## F-statistic: 5.313 on 3 and 63 DF,  p-value: 0.002502
library(car)
vif(thirdmodel2)
##    efficacy mathanxiety father_ISCO 
##    1.061549    1.076023    1.035212