library(lavaan)
### Model 1 (Braak I-II)
Model_01 <- 'CDR_sum_of_boxes ~ HC_vol_Adj + MK_braak12_SUVR + PBR_braak12_SUVR + NeoctxAZD_SUVR + years_of_education + age_at_mri + sex
HC_vol_Adj ~ MK_braak12_SUVR + PBR_braak12_SUVR + NeoctxAZD_SUVR + years_of_education + age_at_mri + sex
MK_braak12_SUVR ~ apoe4_status + PBR_braak12_SUVR + NeoctxAZD_SUVR + age_at_mri + sex
PBR_braak12_SUVR ~ apoe4_status + NeoctxAZD_SUVR + age_at_mri + sex
NeoctxAZD_SUVR ~ apoe4_status + age_at_mri + sex'
fit01 <- sem(Model_01, data=data)
summary(fit01, standardized=T, fit.measures=T, rsq=T, ci = TRUE)
fit01_boot <- sem(Model_01, data=data, verbose= T, test = "bootstrap", se = "bootstrap", bootstrap = 1000)
parameterEstimates(fit01_boot, boot.ci.type = "norm", standardized = TRUE, rsq=T)
standardizedSolution(fit01_boot, type = "std.all")
### Model 2 (Braak III-IV)
Model_02 <- 'CDR_sum_of_boxes ~ HC_vol_Adj + MK_braak34_SUVR + PBR_braak34_SUVR + NeoctxAZD_SUVR + years_of_education + age_at_mri + sex
HC_vol_Adj ~ MK_braak34_SUVR + PBR_braak34_SUVR + NeoctxAZD_SUVR + years_of_education + age_at_mri + sex
MK_braak34_SUVR ~ apoe4_status + PBR_braak34_SUVR + NeoctxAZD_SUVR + age_at_mri + sex
PBR_braak34_SUVR ~ apoe4_status + NeoctxAZD_SUVR + age_at_mri + sex
NeoctxAZD_SUVR ~ apoe4_status + age_at_mri + sex'
fit02 <- sem(Model_02, data=data)
summary(fit02, standardized=T, fit.measures=T, rsq=T, ci = TRUE)
fit02_boot <- sem(Model_02, data=data, verbose= T, test = "bootstrap", se = "bootstrap", bootstrap = 1000)
parameterEstimates(fit02_boot, boot.ci.type = "norm", standardized = TRUE, rsq=T)
standardizedSolution(fit02_boot, type = "std.all")