Loading, setting up
library(tidyverse)
## Loading tidyverse: ggplot2
## Loading tidyverse: tibble
## Loading tidyverse: tidyr
## Loading tidyverse: readr
## Loading tidyverse: purrr
## Loading tidyverse: dplyr
## Conflicts with tidy packages ----------------------------------------------
## filter(): dplyr, stats
## lag(): dplyr, stats
library(lavaan)
## This is lavaan 0.5-23.1097
## lavaan is BETA software! Please report any bugs.
pre_survey <- read_csv("~/Google Drive/1_Research/STEM IE - JJP/STEM-IE/data/final/pre_survey_data_processed.csv")
## Parsed with column specification:
## cols(
## .default = col_integer(),
## participant_ID = col_double(),
## program_ID = col_character(),
## favorite_classes = col_character(),
## favorite_outside_school_activities = col_character(),
## what_will_study_comments = col_character(),
## job_30_years_old_comments = col_character(),
## expectancies_sci = col_double(),
## expectancies_math = col_double(),
## expectancies_build = col_double(),
## utility_value_sci = col_double(),
## utility_value_math = col_double(),
## utility_value_build = col_double(),
## interest_sci = col_double(),
## interest_math = col_double(),
## interest_build = col_double(),
## self_concept_sci = col_double(),
## self_concept_math = col_double(),
## self_concept_build = col_double(),
## prior_experience_STEM = col_double(),
## future_goals_aspirations = col_double()
## # ... with 7 more columns
## )
## See spec(...) for full column specifications.
Science
Model with all five utility value items
model <- '
int =~ sci_interest + sci_fun +sci_always_fascinated
comp =~ sci_good + sci_do_well + sci_good_learn_new
uv =~ sci_useful_to_know + sci_important_be_good + sci_important_college + sci_important_career + sci_applies_to_life
'
fit1a <- cfa(model, data = pre_survey)
summary(fit1a, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 36 iterations
##
## Used Total
## Number of observations 154 193
##
## Estimator ML
## Minimum Function Test Statistic 84.120
## Degrees of freedom 41
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 1133.904
## Degrees of freedom 55
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.960
## Tucker-Lewis Index (TLI) 0.946
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1952.329
## Loglikelihood unrestricted model (H1) -1910.269
##
## Number of free parameters 25
## Akaike (AIC) 3954.658
## Bayesian (BIC) 4030.582
## Sample-size adjusted Bayesian (BIC) 3951.453
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.083
## 90 Percent Confidence Interval 0.057 0.108
## P-value RMSEA <= 0.05 0.020
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.043
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## sci_interest 1.000 0.865 0.793
## sci_fun 0.962 0.091 10.602 0.000 0.832 0.786
## sc_lwys_fscntd 0.919 0.093 9.869 0.000 0.795 0.742
## comp =~
## sci_good 1.000 0.790 0.770
## sci_do_well 0.995 0.103 9.619 0.000 0.786 0.747
## sci_god_lrn_nw 1.062 0.092 11.493 0.000 0.839 0.871
## uv =~
## sci_usfl_t_knw 1.000 0.818 0.804
## sc_mprtnt_b_gd 1.036 0.091 11.332 0.000 0.847 0.818
## sc_mprtnt_cllg 0.956 0.092 10.365 0.000 0.781 0.764
## sci_mprtnt_crr 0.907 0.103 8.808 0.000 0.742 0.671
## sci_appls_t_lf 1.059 0.093 11.372 0.000 0.866 0.820
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.665 0.101 6.615 0.000 0.973 0.973
## uv 0.619 0.096 6.455 0.000 0.874 0.874
## comp ~~
## uv 0.550 0.087 6.293 0.000 0.852 0.852
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .sci_interest 0.442 0.062 7.150 0.000 0.442 0.371
## .sci_fun 0.429 0.059 7.241 0.000 0.429 0.383
## .sc_lwys_fscntd 0.516 0.067 7.656 0.000 0.516 0.449
## .sci_good 0.427 0.057 7.495 0.000 0.427 0.407
## .sci_do_well 0.488 0.064 7.673 0.000 0.488 0.441
## .sci_god_lrn_nw 0.223 0.039 5.785 0.000 0.223 0.241
## .sci_usfl_t_knw 0.364 0.051 7.186 0.000 0.364 0.353
## .sc_mprtnt_b_gd 0.354 0.050 7.018 0.000 0.354 0.331
## .sc_mprtnt_cllg 0.435 0.057 7.563 0.000 0.435 0.416
## .sci_mprtnt_crr 0.670 0.083 8.072 0.000 0.670 0.549
## .sci_appls_t_lf 0.364 0.052 6.988 0.000 0.364 0.327
## int 0.749 0.131 5.716 0.000 1.000 1.000
## comp 0.624 0.113 5.501 0.000 1.000 1.000
## uv 0.668 0.114 5.867 0.000 1.000 1.000
fitmeasures(fit1a, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.083 0.960 0.946 3954.658 4030.582
fm1a <- fitmeasures(fit1a, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with applies to life removed
model <- '
int =~ sci_interest + sci_fun +sci_always_fascinated
comp =~ sci_good + sci_do_well + sci_good_learn_new
uv =~ sci_useful_to_know + sci_important_be_good + sci_important_college + sci_important_career
'
fit1b <- cfa(model, data = pre_survey)
summary(fit1b, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 34 iterations
##
## Used Total
## Number of observations 157 193
##
## Estimator ML
## Minimum Function Test Statistic 77.951
## Degrees of freedom 32
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 1004.388
## Degrees of freedom 45
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.952
## Tucker-Lewis Index (TLI) 0.933
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1833.010
## Loglikelihood unrestricted model (H1) -1794.035
##
## Number of free parameters 23
## Akaike (AIC) 3712.020
## Bayesian (BIC) 3782.313
## Sample-size adjusted Bayesian (BIC) 3709.509
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.096
## 90 Percent Confidence Interval 0.069 0.123
## P-value RMSEA <= 0.05 0.004
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.046
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## sci_interest 1.000 0.871 0.799
## sci_fun 0.963 0.089 10.837 0.000 0.839 0.787
## sc_lwys_fscntd 0.922 0.091 10.103 0.000 0.803 0.745
## comp =~
## sci_good 1.000 0.794 0.774
## sci_do_well 0.973 0.101 9.682 0.000 0.773 0.740
## sci_god_lrn_nw 1.073 0.091 11.775 0.000 0.852 0.874
## uv =~
## sci_usfl_t_knw 1.000 0.802 0.786
## sc_mprtnt_b_gd 1.029 0.098 10.519 0.000 0.825 0.803
## sc_mprtnt_cllg 0.979 0.098 10.028 0.000 0.785 0.771
## sci_mprtnt_crr 0.928 0.109 8.543 0.000 0.744 0.672
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.676 0.100 6.738 0.000 0.977 0.977
## uv 0.617 0.096 6.459 0.000 0.883 0.883
## comp ~~
## uv 0.551 0.087 6.312 0.000 0.865 0.865
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .sci_interest 0.431 0.060 7.177 0.000 0.431 0.362
## .sci_fun 0.432 0.059 7.327 0.000 0.432 0.381
## .sc_lwys_fscntd 0.516 0.067 7.729 0.000 0.516 0.445
## .sci_good 0.421 0.056 7.564 0.000 0.421 0.400
## .sci_do_well 0.492 0.063 7.822 0.000 0.492 0.452
## .sci_god_lrn_nw 0.225 0.039 5.822 0.000 0.225 0.237
## .sci_usfl_t_knw 0.399 0.057 7.037 0.000 0.399 0.383
## .sc_mprtnt_b_gd 0.374 0.055 6.798 0.000 0.374 0.355
## .sc_mprtnt_cllg 0.421 0.058 7.210 0.000 0.421 0.406
## .sci_mprtnt_crr 0.674 0.085 7.947 0.000 0.674 0.549
## int 0.759 0.130 5.838 0.000 1.000 1.000
## comp 0.631 0.113 5.603 0.000 1.000 1.000
## uv 0.643 0.114 5.645 0.000 1.000 1.000
fitmeasures(fit1b, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.096 0.952 0.933 3712.020 3782.313
fm1b <- fitmeasures(fit1b, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with important to college and important to career removed
model <- '
int =~ sci_interest + sci_fun +sci_always_fascinated
comp =~ sci_good + sci_do_well + sci_good_learn_new
uv =~ sci_useful_to_know + sci_important_be_good + sci_applies_to_life
'
fit1c <- cfa(model, data = pre_survey)
summary(fit1c, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 34 iterations
##
## Used Total
## Number of observations 154 193
##
## Estimator ML
## Minimum Function Test Statistic 41.654
## Degrees of freedom 24
## P-value (Chi-square) 0.014
##
## Model test baseline model:
##
## Minimum Function Test Statistic 908.647
## Degrees of freedom 36
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.980
## Tucker-Lewis Index (TLI) 0.970
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1587.976
## Loglikelihood unrestricted model (H1) -1567.149
##
## Number of free parameters 21
## Akaike (AIC) 3217.952
## Bayesian (BIC) 3281.728
## Sample-size adjusted Bayesian (BIC) 3215.260
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.069
## 90 Percent Confidence Interval 0.031 0.104
## P-value RMSEA <= 0.05 0.175
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.035
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## sci_interest 1.000 0.868 0.795
## sci_fun 0.966 0.091 10.641 0.000 0.838 0.791
## sc_lwys_fscntd 0.907 0.094 9.695 0.000 0.787 0.734
## comp =~
## sci_good 1.000 0.791 0.771
## sci_do_well 1.005 0.103 9.786 0.000 0.795 0.756
## sci_god_lrn_nw 1.051 0.092 11.432 0.000 0.831 0.863
## uv =~
## sci_usfl_t_knw 1.000 0.841 0.827
## sc_mprtnt_b_gd 1.013 0.088 11.504 0.000 0.852 0.823
## sci_appls_t_lf 1.035 0.090 11.530 0.000 0.870 0.824
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.669 0.101 6.631 0.000 0.974 0.974
## uv 0.619 0.097 6.406 0.000 0.849 0.849
## comp ~~
## uv 0.569 0.089 6.355 0.000 0.855 0.855
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .sci_interest 0.438 0.062 7.037 0.000 0.438 0.368
## .sci_fun 0.421 0.059 7.095 0.000 0.421 0.375
## .sc_lwys_fscntd 0.529 0.069 7.650 0.000 0.529 0.461
## .sci_good 0.426 0.057 7.502 0.000 0.426 0.405
## .sci_do_well 0.473 0.062 7.623 0.000 0.473 0.428
## .sci_god_lrn_nw 0.236 0.039 6.031 0.000 0.236 0.255
## .sci_usfl_t_knw 0.326 0.051 6.409 0.000 0.326 0.316
## .sc_mprtnt_b_gd 0.346 0.053 6.487 0.000 0.346 0.323
## .sci_appls_t_lf 0.357 0.055 6.461 0.000 0.357 0.320
## int 0.753 0.132 5.722 0.000 1.000 1.000
## comp 0.626 0.113 5.515 0.000 1.000 1.000
## uv 0.707 0.117 6.043 0.000 1.000 1.000
fitmeasures(fit1c, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.069 0.980 0.970 3217.952 3281.728
fm1c <- fitmeasures(fit1c, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with important to career removed
model <- '
int =~ sci_interest + sci_fun +sci_always_fascinated
comp =~ sci_good + sci_do_well + sci_good_learn_new
uv =~ sci_useful_to_know + sci_important_be_good + sci_applies_to_life + sci_important_career
'
fit1d <- cfa(model, data = pre_survey)
summary(fit1d, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 37 iterations
##
## Used Total
## Number of observations 154 193
##
## Estimator ML
## Minimum Function Test Statistic 55.275
## Degrees of freedom 32
## P-value (Chi-square) 0.006
##
## Model test baseline model:
##
## Minimum Function Test Statistic 991.611
## Degrees of freedom 45
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.975
## Tucker-Lewis Index (TLI) 0.965
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1787.142
## Loglikelihood unrestricted model (H1) -1759.504
##
## Number of free parameters 23
## Akaike (AIC) 3620.284
## Bayesian (BIC) 3690.134
## Sample-size adjusted Bayesian (BIC) 3617.335
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.069
## 90 Percent Confidence Interval 0.036 0.099
## P-value RMSEA <= 0.05 0.151
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.039
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## sci_interest 1.000 0.866 0.793
## sci_fun 0.965 0.091 10.592 0.000 0.835 0.788
## sc_lwys_fscntd 0.914 0.094 9.765 0.000 0.792 0.739
## comp =~
## sci_good 1.000 0.790 0.771
## sci_do_well 1.001 0.103 9.719 0.000 0.791 0.753
## sci_god_lrn_nw 1.056 0.092 11.468 0.000 0.835 0.867
## uv =~
## sci_usfl_t_knw 1.000 0.831 0.817
## sc_mprtnt_b_gd 1.029 0.089 11.544 0.000 0.855 0.826
## sci_appls_t_lf 1.052 0.091 11.567 0.000 0.874 0.828
## sci_mprtnt_crr 0.848 0.102 8.290 0.000 0.704 0.638
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.666 0.101 6.620 0.000 0.974 0.974
## uv 0.615 0.096 6.408 0.000 0.856 0.856
## comp ~~
## uv 0.561 0.089 6.333 0.000 0.855 0.855
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .sci_interest 0.441 0.062 7.079 0.000 0.441 0.371
## .sci_fun 0.425 0.059 7.143 0.000 0.425 0.378
## .sc_lwys_fscntd 0.522 0.068 7.630 0.000 0.522 0.454
## .sci_good 0.427 0.057 7.507 0.000 0.427 0.406
## .sci_do_well 0.479 0.063 7.652 0.000 0.479 0.434
## .sci_god_lrn_nw 0.230 0.039 5.939 0.000 0.230 0.249
## .sci_usfl_t_knw 0.343 0.051 6.766 0.000 0.343 0.332
## .sc_mprtnt_b_gd 0.340 0.051 6.624 0.000 0.340 0.317
## .sci_appls_t_lf 0.351 0.053 6.603 0.000 0.351 0.315
## .sci_mprtnt_crr 0.724 0.089 8.107 0.000 0.724 0.593
## int 0.750 0.131 5.707 0.000 1.000 1.000
## comp 0.625 0.113 5.509 0.000 1.000 1.000
## uv 0.690 0.116 5.969 0.000 1.000 1.000
fitmeasures(fit1d, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.069 0.975 0.965 3620.284 3690.134
fm1d <- fitmeasures(fit1d, c("rmsea", "cfi", "tli", "aic", "bic"))
Mathematics
Model with all five utility value items
model <- '
int =~ math_interest + math_fun + math_always_fascinated
comp =~ math_good + math_do_well + math_good_learn_new
uv =~ math_useful_to_know + math_important_be_good + math_important_college + math_important_career + math_applies_to_life
'
fit2a <- cfa(model, data = pre_survey)
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use inspect(fit,"cov.lv") to investigate.
summary(fit2a, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 38 iterations
##
## Used Total
## Number of observations 102 193
##
## Estimator ML
## Minimum Function Test Statistic 104.111
## Degrees of freedom 41
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 888.416
## Degrees of freedom 55
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.924
## Tucker-Lewis Index (TLI) 0.898
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1224.323
## Loglikelihood unrestricted model (H1) -1172.268
##
## Number of free parameters 25
## Akaike (AIC) 2498.646
## Bayesian (BIC) 2564.270
## Sample-size adjusted Bayesian (BIC) 2485.304
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.123
## 90 Percent Confidence Interval 0.094 0.152
## P-value RMSEA <= 0.05 0.000
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.065
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## math_interest 1.000 1.004 0.877
## math_fun 0.973 0.080 12.234 0.000 0.977 0.878
## mth_lwys_fscnt 0.920 0.079 11.625 0.000 0.924 0.855
## comp =~
## math_good 1.000 0.766 0.752
## math_do_well 0.988 0.123 8.029 0.000 0.758 0.758
## math_gd_lrn_nw 1.154 0.120 9.618 0.000 0.885 0.884
## uv =~
## math_sfl_t_knw 1.000 0.825 0.874
## mth_mprtnt_b_g 0.897 0.103 8.687 0.000 0.740 0.735
## mth_mprtnt_cll 0.890 0.099 9.022 0.000 0.735 0.754
## mth_mprtnt_crr 0.854 0.104 8.200 0.000 0.705 0.707
## math_ppls_t_lf 0.834 0.103 8.129 0.000 0.688 0.703
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.748 0.133 5.630 0.000 0.972 0.972
## uv 0.618 0.117 5.260 0.000 0.745 0.745
## comp ~~
## uv 0.567 0.105 5.406 0.000 0.896 0.896
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .math_interest 0.302 0.057 5.326 0.000 0.302 0.230
## .math_fun 0.284 0.053 5.315 0.000 0.284 0.229
## .mth_lwys_fscnt 0.315 0.055 5.682 0.000 0.315 0.270
## .math_good 0.453 0.068 6.638 0.000 0.453 0.435
## .math_do_well 0.426 0.064 6.614 0.000 0.426 0.426
## .math_gd_lrn_nw 0.218 0.042 5.220 0.000 0.218 0.218
## .math_sfl_t_knw 0.211 0.044 4.748 0.000 0.211 0.237
## .mth_mprtnt_b_g 0.465 0.074 6.278 0.000 0.465 0.459
## .mth_mprtnt_cll 0.409 0.066 6.172 0.000 0.409 0.431
## .mth_mprtnt_crr 0.498 0.078 6.411 0.000 0.498 0.500
## .math_ppls_t_lf 0.486 0.076 6.429 0.000 0.486 0.506
## int 1.008 0.182 5.525 0.000 1.000 1.000
## comp 0.587 0.134 4.400 0.000 1.000 1.000
## uv 0.681 0.126 5.411 0.000 1.000 1.000
fitmeasures(fit2a, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.123 0.924 0.898 2498.646 2564.270
fm2a <- fitmeasures(fit2a, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with applies to life removed
model <- '
int =~ math_interest + math_fun +math_always_fascinated
comp =~ math_good + math_do_well + math_good_learn_new
uv =~ math_useful_to_know + math_important_be_good + math_important_college + math_important_career
'
fit2b <- cfa(model, data = pre_survey)
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use inspect(fit,"cov.lv") to investigate.
summary(fit2b, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 40 iterations
##
## Used Total
## Number of observations 103 193
##
## Estimator ML
## Minimum Function Test Statistic 81.901
## Degrees of freedom 32
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 812.635
## Degrees of freedom 45
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.935
## Tucker-Lewis Index (TLI) 0.909
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1120.763
## Loglikelihood unrestricted model (H1) -1079.813
##
## Number of free parameters 23
## Akaike (AIC) 2287.526
## Bayesian (BIC) 2348.125
## Sample-size adjusted Bayesian (BIC) 2275.472
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.123
## 90 Percent Confidence Interval 0.090 0.156
## P-value RMSEA <= 0.05 0.000
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.061
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## math_interest 1.000 0.997 0.875
## math_fun 0.982 0.080 12.257 0.000 0.979 0.878
## mth_lwys_fscnt 0.923 0.079 11.626 0.000 0.920 0.854
## comp =~
## math_good 1.000 0.769 0.753
## math_do_well 0.979 0.122 8.042 0.000 0.753 0.757
## math_gd_lrn_nw 1.151 0.119 9.640 0.000 0.885 0.883
## uv =~
## math_sfl_t_knw 1.000 0.791 0.842
## mth_mprtnt_b_g 0.961 0.112 8.570 0.000 0.760 0.756
## mth_mprtnt_cll 0.968 0.106 9.092 0.000 0.766 0.790
## mth_mprtnt_crr 0.946 0.111 8.495 0.000 0.748 0.752
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.746 0.132 5.657 0.000 0.973 0.973
## uv 0.547 0.110 4.957 0.000 0.694 0.694
## comp ~~
## uv 0.518 0.100 5.203 0.000 0.851 0.851
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .math_interest 0.304 0.056 5.388 0.000 0.304 0.234
## .math_fun 0.284 0.053 5.328 0.000 0.284 0.228
## .mth_lwys_fscnt 0.314 0.055 5.714 0.000 0.314 0.270
## .math_good 0.451 0.068 6.624 0.000 0.451 0.433
## .math_do_well 0.423 0.064 6.609 0.000 0.423 0.428
## .math_gd_lrn_nw 0.221 0.043 5.190 0.000 0.221 0.220
## .math_sfl_t_knw 0.258 0.051 5.027 0.000 0.258 0.292
## .mth_mprtnt_b_g 0.432 0.072 6.003 0.000 0.432 0.428
## .mth_mprtnt_cll 0.353 0.062 5.711 0.000 0.353 0.376
## .mth_mprtnt_crr 0.432 0.071 6.039 0.000 0.432 0.435
## int 0.994 0.180 5.531 0.000 1.000 1.000
## comp 0.591 0.134 4.427 0.000 1.000 1.000
## uv 0.626 0.123 5.076 0.000 1.000 1.000
fitmeasures(fit2b, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.123 0.935 0.909 2287.526 2348.125
fm2b <- fitmeasures(fit2b, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with important to college and important to career removed
model <- '
int =~ math_interest + math_fun +math_always_fascinated
comp =~ math_good + math_do_well + math_good_learn_new
uv =~ math_useful_to_know + math_important_be_good + math_applies_to_life
'
fit2c <- cfa(model, data = pre_survey)
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use inspect(fit,"cov.lv") to investigate.
summary(fit2c, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 35 iterations
##
## Used Total
## Number of observations 105 193
##
## Estimator ML
## Minimum Function Test Statistic 56.431
## Degrees of freedom 24
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 716.246
## Degrees of freedom 36
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.952
## Tucker-Lewis Index (TLI) 0.928
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1041.863
## Loglikelihood unrestricted model (H1) -1013.648
##
## Number of free parameters 21
## Akaike (AIC) 2125.726
## Bayesian (BIC) 2181.460
## Sample-size adjusted Bayesian (BIC) 2115.117
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.113
## 90 Percent Confidence Interval 0.075 0.152
## P-value RMSEA <= 0.05 0.005
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.047
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## math_interest 1.000 0.948 0.834
## math_fun 1.052 0.092 11.477 0.000 0.998 0.890
## mth_lwys_fscnt 0.993 0.090 10.990 0.000 0.941 0.866
## comp =~
## math_good 1.000 0.776 0.748
## math_do_well 0.978 0.120 8.123 0.000 0.759 0.763
## math_gd_lrn_nw 1.162 0.119 9.783 0.000 0.902 0.896
## uv =~
## math_sfl_t_knw 1.000 0.828 0.864
## mth_mprtnt_b_g 0.815 0.109 7.469 0.000 0.674 0.675
## math_ppls_t_lf 0.829 0.105 7.900 0.000 0.686 0.704
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.709 0.128 5.540 0.000 0.963 0.963
## uv 0.613 0.116 5.303 0.000 0.781 0.781
## comp ~~
## uv 0.596 0.108 5.513 0.000 0.928 0.928
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .math_interest 0.394 0.066 5.954 0.000 0.394 0.305
## .math_fun 0.262 0.052 5.046 0.000 0.262 0.208
## .mth_lwys_fscnt 0.297 0.054 5.533 0.000 0.297 0.251
## .math_good 0.473 0.070 6.713 0.000 0.473 0.440
## .math_do_well 0.414 0.062 6.655 0.000 0.414 0.418
## .math_gd_lrn_nw 0.199 0.040 4.959 0.000 0.199 0.196
## .math_sfl_t_knw 0.232 0.056 4.130 0.000 0.232 0.253
## .mth_mprtnt_b_g 0.544 0.084 6.440 0.000 0.544 0.545
## .math_ppls_t_lf 0.478 0.076 6.292 0.000 0.478 0.504
## int 0.899 0.174 5.163 0.000 1.000 1.000
## comp 0.602 0.136 4.431 0.000 1.000 1.000
## uv 0.685 0.131 5.238 0.000 1.000 1.000
fitmeasures(fit2c, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.113 0.952 0.928 2125.726 2181.460
fm2c <- fitmeasures(fit2c, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with important to career removed
model <- '
int =~ math_interest + math_fun +math_always_fascinated
comp =~ math_good + math_do_well + math_good_learn_new
uv =~ math_useful_to_know + math_important_be_good + math_applies_to_life + math_important_career
'
fit2d <- cfa(model, data = pre_survey)
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use inspect(fit,"cov.lv") to investigate.
summary(fit2d, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 38 iterations
##
## Used Total
## Number of observations 102 193
##
## Estimator ML
## Minimum Function Test Statistic 68.215
## Degrees of freedom 32
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 782.390
## Degrees of freedom 45
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.951
## Tucker-Lewis Index (TLI) 0.931
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1117.349
## Loglikelihood unrestricted model (H1) -1083.241
##
## Number of free parameters 23
## Akaike (AIC) 2280.698
## Bayesian (BIC) 2341.072
## Sample-size adjusted Bayesian (BIC) 2268.424
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.105
## 90 Percent Confidence Interval 0.071 0.140
## P-value RMSEA <= 0.05 0.007
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.051
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## math_interest 1.000 1.005 0.878
## math_fun 0.971 0.079 12.229 0.000 0.976 0.877
## mth_lwys_fscnt 0.920 0.079 11.644 0.000 0.924 0.855
## comp =~
## math_good 1.000 0.763 0.749
## math_do_well 0.991 0.124 7.983 0.000 0.757 0.757
## math_gd_lrn_nw 1.162 0.121 9.589 0.000 0.887 0.887
## uv =~
## math_sfl_t_knw 1.000 0.831 0.880
## mth_mprtnt_b_g 0.874 0.104 8.398 0.000 0.726 0.722
## math_ppls_t_lf 0.857 0.101 8.488 0.000 0.712 0.727
## mth_mprtnt_crr 0.767 0.108 7.097 0.000 0.638 0.639
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.745 0.133 5.619 0.000 0.972 0.972
## uv 0.656 0.121 5.430 0.000 0.786 0.786
## comp ~~
## uv 0.588 0.107 5.490 0.000 0.927 0.927
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .math_interest 0.300 0.057 5.316 0.000 0.300 0.229
## .math_fun 0.286 0.054 5.333 0.000 0.286 0.231
## .mth_lwys_fscnt 0.315 0.055 5.681 0.000 0.315 0.269
## .math_good 0.457 0.069 6.653 0.000 0.457 0.440
## .math_do_well 0.427 0.064 6.622 0.000 0.427 0.427
## .math_gd_lrn_nw 0.214 0.041 5.169 0.000 0.214 0.214
## .math_sfl_t_knw 0.202 0.047 4.299 0.000 0.202 0.226
## .mth_mprtnt_b_g 0.485 0.077 6.271 0.000 0.485 0.479
## .math_ppls_t_lf 0.452 0.072 6.242 0.000 0.452 0.471
## .mth_mprtnt_crr 0.588 0.089 6.594 0.000 0.588 0.591
## int 1.009 0.182 5.532 0.000 1.000 1.000
## comp 0.583 0.133 4.377 0.000 1.000 1.000
## uv 0.690 0.127 5.420 0.000 1.000 1.000
fitmeasures(fit2d, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.105 0.951 0.931 2280.698 2341.072
fm2d <- fitmeasures(fit2d, c("rmsea", "cfi", "tli", "aic", "bic"))
Engineering
Model with all five utility value items
model <- '
int =~ build_interest + build_fun +build_always_fascinated
comp =~ build_good + build_do_well + build_good_learn_new
uv =~ build_useful_to_know + build_important_be_good + build_important_college + build_important_career + build_applies_to_life
'
fit3a <- cfa(model, data = pre_survey)
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use inspect(fit,"cov.lv") to investigate.
summary(fit3a, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 46 iterations
##
## Used Total
## Number of observations 92 193
##
## Estimator ML
## Minimum Function Test Statistic 114.736
## Degrees of freedom 41
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 960.040
## Degrees of freedom 55
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.919
## Tucker-Lewis Index (TLI) 0.891
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1047.690
## Loglikelihood unrestricted model (H1) -990.322
##
## Number of free parameters 25
## Akaike (AIC) 2145.379
## Bayesian (BIC) 2208.424
## Sample-size adjusted Bayesian (BIC) 2129.510
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.140
## 90 Percent Confidence Interval 0.110 0.170
## P-value RMSEA <= 0.05 0.000
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.047
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## build_interest 1.000 0.788 0.753
## build_fun 0.967 0.119 8.096 0.000 0.761 0.770
## bld_lwys_fscnt 1.083 0.120 8.992 0.000 0.853 0.842
## comp =~
## build_good 1.000 0.788 0.815
## build_do_well 1.095 0.124 8.803 0.000 0.863 0.783
## buld_gd_lrn_nw 1.091 0.108 10.106 0.000 0.860 0.860
## uv =~
## buld_sfl_t_knw 1.000 0.856 0.822
## bld_mprtnt_b_g 1.074 0.100 10.725 0.000 0.919 0.892
## bld_mprtnt_cll 1.002 0.112 8.985 0.000 0.858 0.795
## bld_mprtnt_crr 0.991 0.109 9.072 0.000 0.848 0.801
## buld_ppls_t_lf 1.064 0.105 10.115 0.000 0.911 0.860
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.658 0.122 5.408 0.000 1.060 1.060
## uv 0.668 0.127 5.283 0.000 0.991 0.991
## comp ~~
## uv 0.625 0.118 5.316 0.000 0.926 0.926
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .build_interest 0.475 0.071 6.649 0.000 0.475 0.434
## .build_fun 0.398 0.060 6.589 0.000 0.398 0.407
## .bld_lwys_fscnt 0.299 0.049 6.107 0.000 0.299 0.291
## .build_good 0.315 0.052 6.024 0.000 0.315 0.336
## .build_do_well 0.469 0.076 6.210 0.000 0.469 0.386
## .buld_gd_lrn_nw 0.262 0.047 5.557 0.000 0.262 0.261
## .buld_sfl_t_knw 0.352 0.059 5.954 0.000 0.352 0.325
## .bld_mprtnt_b_g 0.216 0.042 5.205 0.000 0.216 0.204
## .bld_mprtnt_cll 0.428 0.070 6.099 0.000 0.428 0.367
## .bld_mprtnt_crr 0.403 0.066 6.073 0.000 0.403 0.359
## .buld_ppls_t_lf 0.292 0.052 5.643 0.000 0.292 0.260
## int 0.620 0.146 4.243 0.000 1.000 1.000
## comp 0.621 0.132 4.702 0.000 1.000 1.000
## uv 0.733 0.154 4.760 0.000 1.000 1.000
fitmeasures(fit3a, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.140 0.919 0.891 2145.379 2208.424
fm3a <- fitmeasures(fit3a, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with applies to life removed
model <- '
int =~ build_interest + build_fun +build_always_fascinated
comp =~ build_good + build_do_well + build_good_learn_new
uv =~ build_useful_to_know + build_important_be_good + build_important_college + build_important_career
'
fit3b <- cfa(model, data = pre_survey)
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use inspect(fit,"cov.lv") to investigate.
summary(fit3b, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 46 iterations
##
## Used Total
## Number of observations 92 193
##
## Estimator ML
## Minimum Function Test Statistic 102.417
## Degrees of freedom 32
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 840.338
## Degrees of freedom 45
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.911
## Tucker-Lewis Index (TLI) 0.875
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -965.570
## Loglikelihood unrestricted model (H1) -914.362
##
## Number of free parameters 23
## Akaike (AIC) 1977.141
## Bayesian (BIC) 2035.142
## Sample-size adjusted Bayesian (BIC) 1962.541
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.155
## 90 Percent Confidence Interval 0.122 0.189
## P-value RMSEA <= 0.05 0.000
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.050
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## build_interest 1.000 0.786 0.751
## build_fun 0.967 0.120 8.036 0.000 0.760 0.768
## bld_lwys_fscnt 1.089 0.121 8.984 0.000 0.856 0.845
## comp =~
## build_good 1.000 0.791 0.817
## build_do_well 1.090 0.124 8.805 0.000 0.862 0.782
## buld_gd_lrn_nw 1.087 0.107 10.123 0.000 0.859 0.859
## uv =~
## buld_sfl_t_knw 1.000 0.843 0.809
## bld_mprtnt_b_g 1.082 0.107 10.128 0.000 0.912 0.885
## bld_mprtnt_cll 1.039 0.116 8.958 0.000 0.876 0.812
## bld_mprtnt_crr 1.042 0.113 9.221 0.000 0.878 0.829
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.658 0.122 5.404 0.000 1.060 1.060
## uv 0.650 0.125 5.205 0.000 0.982 0.982
## comp ~~
## uv 0.605 0.116 5.220 0.000 0.907 0.907
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .build_interest 0.478 0.072 6.637 0.000 0.478 0.436
## .build_fun 0.401 0.061 6.578 0.000 0.401 0.410
## .bld_lwys_fscnt 0.294 0.049 6.051 0.000 0.294 0.286
## .build_good 0.311 0.052 5.985 0.000 0.311 0.332
## .build_do_well 0.471 0.076 6.196 0.000 0.471 0.388
## .buld_gd_lrn_nw 0.263 0.047 5.542 0.000 0.263 0.263
## .buld_sfl_t_knw 0.375 0.064 5.843 0.000 0.375 0.345
## .bld_mprtnt_b_g 0.231 0.047 4.961 0.000 0.231 0.217
## .bld_mprtnt_cll 0.396 0.068 5.822 0.000 0.396 0.340
## .bld_mprtnt_crr 0.351 0.062 5.689 0.000 0.351 0.313
## int 0.617 0.146 4.227 0.000 1.000 1.000
## comp 0.625 0.132 4.719 0.000 1.000 1.000
## uv 0.711 0.154 4.623 0.000 1.000 1.000
fitmeasures(fit3b, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.155 0.911 0.875 1977.141 2035.142
fm3b <- fitmeasures(fit3b, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with important to college and important to career removed
model <- '
int =~ build_interest + build_fun +build_always_fascinated
comp =~ build_good + build_do_well + build_good_learn_new
uv =~ build_useful_to_know + build_important_be_good + build_applies_to_life
'
fit3c <- cfa(model, data = pre_survey)
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use inspect(fit,"cov.lv") to investigate.
summary(fit3c, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 41 iterations
##
## Used Total
## Number of observations 95 193
##
## Estimator ML
## Minimum Function Test Statistic 50.642
## Degrees of freedom 24
## P-value (Chi-square) 0.001
##
## Model test baseline model:
##
## Minimum Function Test Statistic 773.959
## Degrees of freedom 36
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.964
## Tucker-Lewis Index (TLI) 0.946
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -880.204
## Loglikelihood unrestricted model (H1) -854.883
##
## Number of free parameters 21
## Akaike (AIC) 1802.407
## Bayesian (BIC) 1856.039
## Sample-size adjusted Bayesian (BIC) 1789.737
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.108
## 90 Percent Confidence Interval 0.066 0.150
## P-value RMSEA <= 0.05 0.015
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.035
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## build_interest 1.000 0.813 0.767
## build_fun 0.946 0.113 8.379 0.000 0.769 0.773
## bld_lwys_fscnt 1.052 0.113 9.273 0.000 0.854 0.839
## comp =~
## build_good 1.000 0.803 0.821
## build_do_well 1.085 0.119 9.112 0.000 0.871 0.787
## buld_gd_lrn_nw 1.083 0.103 10.557 0.000 0.870 0.867
## uv =~
## buld_sfl_t_knw 1.000 0.872 0.836
## bld_mprtnt_b_g 1.068 0.095 11.290 0.000 0.932 0.899
## buld_ppls_t_lf 1.066 0.100 10.637 0.000 0.930 0.867
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.690 0.124 5.557 0.000 1.057 1.057
## uv 0.699 0.129 5.436 0.000 0.986 0.986
## comp ~~
## uv 0.658 0.120 5.492 0.000 0.939 0.939
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .build_interest 0.463 0.070 6.629 0.000 0.463 0.412
## .build_fun 0.398 0.060 6.604 0.000 0.398 0.403
## .bld_lwys_fscnt 0.308 0.050 6.146 0.000 0.308 0.297
## .build_good 0.312 0.051 6.121 0.000 0.312 0.326
## .build_do_well 0.466 0.074 6.324 0.000 0.466 0.380
## .buld_gd_lrn_nw 0.251 0.045 5.616 0.000 0.251 0.249
## .buld_sfl_t_knw 0.327 0.057 5.758 0.000 0.327 0.300
## .bld_mprtnt_b_g 0.205 0.043 4.772 0.000 0.205 0.191
## .buld_ppls_t_lf 0.285 0.053 5.396 0.000 0.285 0.248
## int 0.660 0.150 4.410 0.000 1.000 1.000
## comp 0.645 0.133 4.838 0.000 1.000 1.000
## uv 0.761 0.154 4.951 0.000 1.000 1.000
fitmeasures(fit3c, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.108 0.964 0.946 1802.407 1856.039
fm3c <- fitmeasures(fit3c, c("rmsea", "cfi", "tli", "aic", "bic"))
Model with important to career removed
model <- '
int =~ build_interest + build_fun +build_always_fascinated
comp =~ build_good + build_do_well + build_good_learn_new
uv =~ build_useful_to_know + build_important_be_good + build_applies_to_life + build_important_career
'
fit3d <- cfa(model, data = pre_survey)
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use inspect(fit,"cov.lv") to investigate.
summary(fit3d, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 46 iterations
##
## Used Total
## Number of observations 92 193
##
## Estimator ML
## Minimum Function Test Statistic 57.354
## Degrees of freedom 32
## P-value (Chi-square) 0.004
##
## Model test baseline model:
##
## Minimum Function Test Statistic 821.461
## Degrees of freedom 45
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.967
## Tucker-Lewis Index (TLI) 0.954
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -950.766
## Loglikelihood unrestricted model (H1) -922.088
##
## Number of free parameters 23
## Akaike (AIC) 1947.531
## Bayesian (BIC) 2005.532
## Sample-size adjusted Bayesian (BIC) 1932.932
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.093
## 90 Percent Confidence Interval 0.052 0.131
## P-value RMSEA <= 0.05 0.043
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.036
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## build_interest 1.000 0.791 0.756
## build_fun 0.953 0.119 8.021 0.000 0.754 0.762
## bld_lwys_fscnt 1.082 0.119 9.055 0.000 0.855 0.844
## comp =~
## build_good 1.000 0.788 0.814
## build_do_well 1.096 0.124 8.804 0.000 0.863 0.783
## buld_gd_lrn_nw 1.093 0.108 10.113 0.000 0.861 0.860
## uv =~
## buld_sfl_t_knw 1.000 0.862 0.827
## bld_mprtnt_b_g 1.088 0.098 11.154 0.000 0.937 0.910
## buld_ppls_t_lf 1.060 0.104 10.243 0.000 0.914 0.863
## bld_mprtnt_crr 0.939 0.110 8.517 0.000 0.809 0.764
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.661 0.122 5.416 0.000 1.061 1.061
## uv 0.674 0.127 5.298 0.000 0.989 0.989
## comp ~~
## uv 0.632 0.118 5.341 0.000 0.932 0.932
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .build_interest 0.469 0.071 6.601 0.000 0.469 0.429
## .build_fun 0.410 0.062 6.579 0.000 0.410 0.419
## .bld_lwys_fscnt 0.295 0.049 6.027 0.000 0.295 0.287
## .build_good 0.316 0.052 6.045 0.000 0.316 0.337
## .build_do_well 0.469 0.075 6.224 0.000 0.469 0.386
## .buld_gd_lrn_nw 0.261 0.047 5.571 0.000 0.261 0.260
## .buld_sfl_t_knw 0.343 0.059 5.856 0.000 0.343 0.316
## .bld_mprtnt_b_g 0.183 0.039 4.678 0.000 0.183 0.173
## .buld_ppls_t_lf 0.286 0.052 5.522 0.000 0.286 0.255
## .bld_mprtnt_crr 0.468 0.076 6.189 0.000 0.468 0.417
## int 0.626 0.147 4.263 0.000 1.000 1.000
## comp 0.620 0.132 4.698 0.000 1.000 1.000
## uv 0.742 0.155 4.799 0.000 1.000 1.000
fitmeasures(fit3d, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.093 0.967 0.954 1947.531 2005.532
fm3d <- fitmeasures(fit3d, c("rmsea", "cfi", "tli", "aic", "bic"))
Summary of models
df <- data.frame(fm1a, fm1b, fm1c, fm1d,
fm2a, fm2b, fm2c, fm2d,
fm3a, fm3b, fm3c, fm3d)
df_ss <- df[4:5, ]
df_ss$var <- c("aic", "bic")
to_plot <- df_ss %>%
gather(key, val, -var) %>%
mutate(which_domain = ifelse(stringr::str_detect(key, "1"), "Science",
ifelse(stringr::str_detect(key, "2"), "Mathematics",
ifelse(stringr::str_detect(key, "3"), "Engineering", NA)))) %>%
mutate(which_model = ifelse(stringr::str_detect(key, "a"), "All (5)",
ifelse(stringr::str_detect(key, "b"), "No Always Fascinated (4)",
ifelse(stringr::str_detect(key, "c"), "No College or Career (3)",
ifelse(stringr::str_detect(key, "d"), "No Career (4)", NA)))))
ggplot(to_plot, aes(x = which_model, y = val, fill = var, color = var, group = var)) +
facet_wrap( ~ which_domain) +
geom_point() +
geom_line() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
ggsave("aic_bic.png", width = 8, height = 6)
df_ss <- df[1, ]
df_ss$var <- c("rmsea")
to_plot <- df_ss %>%
gather(key, val, -var) %>%
mutate(which_domain = ifelse(stringr::str_detect(key, "1"), "Science",
ifelse(stringr::str_detect(key, "2"), "Mathematics",
ifelse(stringr::str_detect(key, "3"), "Engineering", NA)))) %>%
mutate(which_model = ifelse(stringr::str_detect(key, "a"), "All (5)",
ifelse(stringr::str_detect(key, "b"), "No Always Fascinated (4)",
ifelse(stringr::str_detect(key, "c"), "No College or Career (3)",
ifelse(stringr::str_detect(key, "d"), "No Career (4)", NA)))))
ggplot(to_plot, aes(x = which_model, y = val, fill = var, color = var, group = var)) +
facet_wrap( ~ which_domain) +
geom_point() +
geom_line() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
ggsave("rmsea.png", width = 8, height = 6)
df_ss <- df[2:3, ]
df_ss$var <- c("cfi", "tli")
to_plot <- df_ss %>%
gather(key, val, -var) %>%
mutate(which_domain = ifelse(stringr::str_detect(key, "1"), "Science",
ifelse(stringr::str_detect(key, "2"), "Mathematics",
ifelse(stringr::str_detect(key, "3"), "Engineering", NA)))) %>%
mutate(which_model = ifelse(stringr::str_detect(key, "a"), "All (5)",
ifelse(stringr::str_detect(key, "b"), "No Always Fascinated (4)",
ifelse(stringr::str_detect(key, "c"), "No College or Career (3)",
ifelse(stringr::str_detect(key, "d"), "No Career (4)", NA)))))
ggplot(to_plot, aes(x = which_model, y = val, fill = var, color = var, group = var)) +
facet_wrap( ~ which_domain) +
geom_point() +
geom_line() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
ggsave("cfi_tli.png", width = 8, height = 6)
Comparing 3 factor to 2 factor model
model <- '
int =~ sci_interest + sci_fun +sci_always_fascinated
comp =~ sci_good + sci_do_well + sci_good_learn_new
uv =~ sci_useful_to_know + sci_important_be_good + sci_applies_to_life
'
fitthree <- cfa(model, data = pre_survey)
summary(fitthree, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 34 iterations
##
## Used Total
## Number of observations 154 193
##
## Estimator ML
## Minimum Function Test Statistic 41.654
## Degrees of freedom 24
## P-value (Chi-square) 0.014
##
## Model test baseline model:
##
## Minimum Function Test Statistic 908.647
## Degrees of freedom 36
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.980
## Tucker-Lewis Index (TLI) 0.970
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1587.976
## Loglikelihood unrestricted model (H1) -1567.149
##
## Number of free parameters 21
## Akaike (AIC) 3217.952
## Bayesian (BIC) 3281.728
## Sample-size adjusted Bayesian (BIC) 3215.260
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.069
## 90 Percent Confidence Interval 0.031 0.104
## P-value RMSEA <= 0.05 0.175
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.035
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## sci_interest 1.000 0.868 0.795
## sci_fun 0.966 0.091 10.641 0.000 0.838 0.791
## sc_lwys_fscntd 0.907 0.094 9.695 0.000 0.787 0.734
## comp =~
## sci_good 1.000 0.791 0.771
## sci_do_well 1.005 0.103 9.786 0.000 0.795 0.756
## sci_god_lrn_nw 1.051 0.092 11.432 0.000 0.831 0.863
## uv =~
## sci_usfl_t_knw 1.000 0.841 0.827
## sc_mprtnt_b_gd 1.013 0.088 11.504 0.000 0.852 0.823
## sci_appls_t_lf 1.035 0.090 11.530 0.000 0.870 0.824
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.669 0.101 6.631 0.000 0.974 0.974
## uv 0.619 0.097 6.406 0.000 0.849 0.849
## comp ~~
## uv 0.569 0.089 6.355 0.000 0.855 0.855
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .sci_interest 0.438 0.062 7.037 0.000 0.438 0.368
## .sci_fun 0.421 0.059 7.095 0.000 0.421 0.375
## .sc_lwys_fscntd 0.529 0.069 7.650 0.000 0.529 0.461
## .sci_good 0.426 0.057 7.502 0.000 0.426 0.405
## .sci_do_well 0.473 0.062 7.623 0.000 0.473 0.428
## .sci_god_lrn_nw 0.236 0.039 6.031 0.000 0.236 0.255
## .sci_usfl_t_knw 0.326 0.051 6.409 0.000 0.326 0.316
## .sc_mprtnt_b_gd 0.346 0.053 6.487 0.000 0.346 0.323
## .sci_appls_t_lf 0.357 0.055 6.461 0.000 0.357 0.320
## int 0.753 0.132 5.722 0.000 1.000 1.000
## comp 0.626 0.113 5.515 0.000 1.000 1.000
## uv 0.707 0.117 6.043 0.000 1.000 1.000
fitmeasures(fitthree, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.069 0.980 0.970 3217.952 3281.728
fmthree <- fitmeasures(fitthree, c("rmsea", "cfi", "tli", "aic", "bic"))
model <- '
int =~ sci_interest + sci_fun +sci_always_fascinated
comp =~ sci_good + sci_do_well + sci_good_learn_new + sci_useful_to_know + sci_important_be_good + sci_applies_to_life
'
fittwo <- cfa(model, data = pre_survey)
summary(fittwo, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 31 iterations
##
## Used Total
## Number of observations 154 193
##
## Estimator ML
## Minimum Function Test Statistic 76.681
## Degrees of freedom 26
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 908.647
## Degrees of freedom 36
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.942
## Tucker-Lewis Index (TLI) 0.920
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1605.489
## Loglikelihood unrestricted model (H1) -1567.149
##
## Number of free parameters 19
## Akaike (AIC) 3248.979
## Bayesian (BIC) 3306.681
## Sample-size adjusted Bayesian (BIC) 3246.543
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.113
## 90 Percent Confidence Interval 0.084 0.142
## P-value RMSEA <= 0.05 0.000
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.047
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## sci_interest 1.000 0.857 0.785
## sci_fun 0.985 0.094 10.482 0.000 0.843 0.796
## sc_lwys_fscntd 0.924 0.096 9.576 0.000 0.791 0.738
## comp =~
## sci_good 1.000 0.755 0.737
## sci_do_well 1.053 0.112 9.376 0.000 0.795 0.756
## sci_god_lrn_nw 1.078 0.102 10.565 0.000 0.814 0.845
## sci_usfl_t_knw 1.034 0.108 9.535 0.000 0.781 0.768
## sc_mprtnt_b_gd 1.071 0.110 9.718 0.000 0.809 0.782
## sci_appls_t_lf 1.056 0.113 9.370 0.000 0.798 0.756
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.619 0.097 6.404 0.000 0.957 0.957
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .sci_interest 0.457 0.065 7.085 0.000 0.457 0.384
## .sci_fun 0.411 0.059 6.934 0.000 0.411 0.366
## .sc_lwys_fscntd 0.522 0.069 7.551 0.000 0.522 0.455
## .sci_good 0.481 0.061 7.925 0.000 0.481 0.457
## .sci_do_well 0.473 0.061 7.815 0.000 0.473 0.428
## .sci_god_lrn_nw 0.264 0.038 6.961 0.000 0.264 0.285
## .sci_usfl_t_knw 0.423 0.055 7.740 0.000 0.423 0.410
## .sc_mprtnt_b_gd 0.416 0.054 7.643 0.000 0.416 0.388
## .sci_appls_t_lf 0.478 0.061 7.818 0.000 0.478 0.429
## int 0.734 0.131 5.603 0.000 1.000 1.000
## comp 0.571 0.110 5.202 0.000 1.000 1.000
fitmeasures(fittwo, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.113 0.942 0.920 3248.979 3306.681
fmtwo <- fitmeasures(fittwo, c("rmsea", "cfi", "tli", "aic", "bic"))
fitone <- cfa(model, data = pre_survey)
summary(fitone, standardized = T, fit.measures = T)
## lavaan (0.5-23.1097) converged normally after 31 iterations
##
## Used Total
## Number of observations 154 193
##
## Estimator ML
## Minimum Function Test Statistic 76.681
## Degrees of freedom 26
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 908.647
## Degrees of freedom 36
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.942
## Tucker-Lewis Index (TLI) 0.920
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -1605.489
## Loglikelihood unrestricted model (H1) -1567.149
##
## Number of free parameters 19
## Akaike (AIC) 3248.979
## Bayesian (BIC) 3306.681
## Sample-size adjusted Bayesian (BIC) 3246.543
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.113
## 90 Percent Confidence Interval 0.084 0.142
## P-value RMSEA <= 0.05 0.000
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.047
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## sci_interest 1.000 0.857 0.785
## sci_fun 0.985 0.094 10.482 0.000 0.843 0.796
## sc_lwys_fscntd 0.924 0.096 9.576 0.000 0.791 0.738
## comp =~
## sci_good 1.000 0.755 0.737
## sci_do_well 1.053 0.112 9.376 0.000 0.795 0.756
## sci_god_lrn_nw 1.078 0.102 10.565 0.000 0.814 0.845
## sci_usfl_t_knw 1.034 0.108 9.535 0.000 0.781 0.768
## sc_mprtnt_b_gd 1.071 0.110 9.718 0.000 0.809 0.782
## sci_appls_t_lf 1.056 0.113 9.370 0.000 0.798 0.756
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## comp 0.619 0.097 6.404 0.000 0.957 0.957
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .sci_interest 0.457 0.065 7.085 0.000 0.457 0.384
## .sci_fun 0.411 0.059 6.934 0.000 0.411 0.366
## .sc_lwys_fscntd 0.522 0.069 7.551 0.000 0.522 0.455
## .sci_good 0.481 0.061 7.925 0.000 0.481 0.457
## .sci_do_well 0.473 0.061 7.815 0.000 0.473 0.428
## .sci_god_lrn_nw 0.264 0.038 6.961 0.000 0.264 0.285
## .sci_usfl_t_knw 0.423 0.055 7.740 0.000 0.423 0.410
## .sc_mprtnt_b_gd 0.416 0.054 7.643 0.000 0.416 0.388
## .sci_appls_t_lf 0.478 0.061 7.818 0.000 0.478 0.429
## int 0.734 0.131 5.603 0.000 1.000 1.000
## comp 0.571 0.110 5.202 0.000 1.000 1.000
fitmeasures(fitone, c("rmsea", "cfi", "tli", "aic", "bic"))
## rmsea cfi tli aic bic
## 0.113 0.942 0.920 3248.979 3306.681
fmone <- fitmeasures(fitone, c("rmsea", "cfi", "tli", "aic", "bic"))
fmthree
## rmsea cfi tli aic bic
## 0.069 0.980 0.970 3217.952 3281.728
fmtwo
## rmsea cfi tli aic bic
## 0.113 0.942 0.920 3248.979 3306.681
anova(fitthree, fittwo)
## Chi Square Difference Test
##
## Df AIC BIC Chisq Chisq diff Df diff Pr(>Chisq)
## fitthree 24 3218 3281.7 41.654
## fittwo 26 3249 3306.7 76.681 35.027 2 2.477e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1