HW8

Will Henderson

2022-11-23

Table of Contents

Problem Description

[7 points + 2 bonus points] Using the data from Roth et al., 1989 (see Table 4.2), do the following:

Import Data

Table 1. Corelation Matrix of the Variables
exercise hardiness fitness stress illness
exercise 1.00 -0.03 0.39 -0.05 -0.08
hardiness -0.03 1.00 0.07 -0.23 -0.16
fitness 0.39 0.07 1.00 -0.13 -0.29
stress -0.05 -0.23 -0.13 1.00 -0.34
illness -0.08 -0.16 -0.29 -0.34 1.00
Table 2. Covariance Matrix of the Variables
exercise hardiness fitness stress illness
exercise 4422.2500 -75.8100 477.2040 -111.3875 -332.3936
hardiness -75.8100 1444.0000 48.9440 -292.7900 -379.8784
fitness 477.2040 48.9440 338.5600 -80.1320 -333.3933
stress -111.3875 -292.7900 -80.1320 1122.2500 -711.6472
illness -332.3936 -379.8784 -333.3933 -711.6472 3903.7504

A)

Estimate the model specified in Figure 7.5 and report the estimated parameters.

The number of estimated parameters is 10 with 5 degrees of freedom and 373 observations. All estimates (std.lv) were found to be statistically significant rejecting the null hypothesis. The estimated parameters are provided below followed by the model used.

                 Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  fitness ~                                                             
    exercise          0.108    0.013    8.180    0.000    0.108    0.390
  stress ~                                                              
    hardiness        -0.203    0.044   -4.564    0.000   -0.203   -0.230
  illness ~                                                             
    fitness          -1.154    0.154   -7.478    0.000   -1.154   -0.334
    stress           -0.717    0.085   -8.452    0.000   -0.717   -0.378

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  exercise ~~                                                           
    hardiness       -75.810  130.902   -0.579    0.562  -75.810   -0.030

Establish Model

roth.model <- '
  # regressions
  fitness ~ exercise
  stress ~ hardiness
  illness ~ fitness + stress
  # Covariance
  exercise ~~ hardiness'

B)

Model Fit Indices

Report and discuss the basic model fit indices.

The path analysis was found with a root mean square error of approximation (RMSEA) of 0.127. This does not provide an appropriate fit as the suggested cutoff is <.05.

The Standardized Root Mean Square Residual (SRMR) is 0.082 meeting acceptable fit of <0.10.

However, the Comparative Fit Index (CFI) was 0.85 along with the Tucker-Lewis Index (TLI) of 0.705. Both do not fit where CFI should be > 0.90 and TLI should be >.95. This model is not an acceptable fit.

However, the chi-squared goodness of fit was found to be significant (x2(5)= 35.179, p < .001). This model fits within an acceptable fit.

Overall, the model fits with an acceptable fit according to SRMR and chi-square, but does not fit according to RMSEA, CFI, and TLI.

C)

Review the basic set of conditional independence (see Table 11.1) and compute partial correlations while adjusting for the corresponding variables in R. (hint: use ‘?psych::partial.r’ to obtain the same numbers from Table 11.1)

Partial Corelations

         exercise stress
exercise     1.00  -0.06
stress      -0.06   1.00

         exercise illness
exercise     1.00    0.04
illness      0.04    1.00
 
          hardiness fitness
hardiness      1.00    0.09
fitness        0.09    1.00

          hardiness illness
hardiness      1.00   -0.26
illness       -0.26    1.00

        fitness stress
fitness     1.0   -0.1
stress     -0.1    1.0

In my results, I discovered different partial corelations between hardiness and illness with the conditioning set fitness and stress as compared to the table provided in the homework.

D)

Model Residuals

Check the correlation residuals for model-data disagreement. (hint: ‘?lavaan::lavResiduals’ to get the residual matrix)

## $type
## [1] "cor.bentler"
## 
## $cov
##           fitnss stress illnss exercs hrdnss
## fitness    0.000                            
## stress    -0.133  0.000                     
## illness    0.051  0.045 -0.035              
## exercise   0.000 -0.057  0.055  0.000       
## hardiness  0.082  0.000 -0.252  0.000  0.000
## 
## $cov.z
##           fitnss stress illnss exercs hrdnss
## fitness    0.000                            
## stress    -2.548  0.000                     
## illness    2.548  2.548 -2.548              
## exercise   0.000 -1.128  1.172  0.000       
## hardiness  1.708  0.000 -5.142  0.000  0.000
## 
## $summary
##                           cov
## srmr                    0.082
## srmr.se                 0.011
## srmr.exactfit.z         5.122
## srmr.exactfit.pvalue    0.000
## usrmr                   0.078
## usrmr.se                0.017
## usrmr.ci.lower          0.050
## usrmr.ci.upper          0.105
## usrmr.closefit.h0.value 0.050
## usrmr.closefit.z        1.659
## usrmr.closefit.pvalue   0.049
Table 3. Residuals of First Model
fitness stress illness exercise hardiness
fitness 0.0000000 -0.1326910 0.0509789 0.0000000 0.0817000
stress -0.1326910 0.0000000 0.0451077 -0.0569000 0.0000000
illness 0.0509789 0.0451077 -0.0346601 0.0552295 -0.2523417
exercise 0.0000000 -0.0569000 0.0552295 0.0000000 0.0000000
hardiness 0.0817000 0.0000000 -0.2523417 0.0000000 0.0000000

According to the check between correlation residuals and model-implied correlations, fitness/stress (-.13) and hardiness/illness (-.25) are greater than .1 in accordance to the absolute value. There is model-data disagreement. The researcher should respecify the model.

E)

Model Respecification

Discuss if (use information from parts a-d) and how the model should be respecified. Review the ‘Conditional Independence’ section on page 240.

Because there are two correlation residuals >.10 in addition to a partial correlations over .1, I will respecify the model by adding path between fitness impacting stress.

F)

Respecified Model Fit Indices and Residuals

Estimate the respecified model and check its correlation residuals.

Upon respecification, the number of estimated parameters is 11 with 4 degrees of freedom and 373 observations. All estimates (std.lv) were found to be statistically significant rejecting the null hypothesis. The estimated parameters are provided below followed by the model used.

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  fitness ~                                                             
    exercise          0.108    0.013    8.180    0.000    0.108    0.390
  stress ~                                                              
    hardiness        -0.196    0.044   -4.436    0.000   -0.196   -0.222
    fitness          -0.208    0.091   -2.287    0.022   -0.208   -0.115
  illness ~                                                             
    fitness          -1.154    0.155   -7.431    0.000   -1.154   -0.339
    stress           -0.717    0.085   -8.381    0.000   -0.717   -0.383

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  exercise ~~                                                           
    hardiness       -75.810  130.902   -0.579    0.562  -75.810   -0.030

Model

roth.model.refit <- '
  # regressions
  fitness ~ exercise
  stress ~ hardiness + fitness
  illness ~ fitness + stress
  # Covariance
  exercise ~~ hardiness'

G)

Compare model fit of the original model and the respecified model. (hint: use AIC and BIC along with other fit indices)

Discussion

Table 4. Residuals of First Respecified Model
fitness stress illness exercise hardiness
fitness 0.0000000 -0.0181364 0.0069679 0.0000000 0.0817000
stress -0.0181364 0.0041518 0.0045703 -0.0120199 -0.0093515
illness 0.0069679 0.0045703 -0.0041246 0.0379869 -0.2487490
exercise 0.0000000 -0.0120199 0.0379869 0.0000000 0.0000000
hardiness 0.0817000 -0.0093515 -0.2487490 0.0000000 0.0000000

Comparing the two models found, the respecified model has an appropriate fit when analyzing the residuals. Instead of two residuals greater than .1 in the first model, the second model provides only one residual. Neither model fits based on the RMSEA in the first model (0.127) compared to the new model (0.132) and the RMSEA cutoff if <0.05 for an acceptable fit. The Standardized Root Mean Square Residual (SRMR) meets acceptable fit of <0.10 in both the original model (0.082) and the respecified model (0.069). Furthermore, the Comparative Fit Index (CFI) in the first model (0.85) and the Tucker-Lewis Index (TLI) of 0.705 compared to the respecified model CFI (.873) and TLI (.682) does not have acceptable fit with a CFI cutoff at > 0.90 and TLI >.95. The chi-squared goodness of fit was found to be significant in both the first model (x2(5, N=373) = 35.179, p < .001) and the respecified model (x2(4, , N=37) = 30.009, p < .001). Comparing the first model AIC (18854.957) and BIC (18894.173) to the respecfied model AIC (18851.787) and BIC (18894.925), the smaller respecified model AIC number suggests use and acceptable fit.

In comparison of the two models, the original model fits with an acceptable fit according to SRMR, and chi-square, but does not fit according to RMSEA, CFI, and TLI. However the respecified model’s residuals, chi-square, AIC, and SRMR support that this model should be used.

*Original Model* 
Akaike (AIC) 18854.957
Bayesian (BIC) 18894.173
RMSEA 0.127
Test statistic 35.179
Degrees of freedom 5
P-value (Chi-square) 0.000
SRMR: 0.082
CFI 0.85
TLI 0.705

*Respecified Model* 
Akaike (AIC) 18851.787
Bayesian (BIC) 18894.925
RMSEA 0.132
Test statistic 30.009
Degrees of freedom 4
P-value (Chi-square) 0.000
SRMR: 0.069
CFI .873
TLI .682

H)

Second Respecified Model

[2 bonus points] Find another respecified model, (preferably with the same degrees of freedom as the respecified model in part f) and discuss which model has a better fit (check residuals and model fit indices)

Model

roth.model.refit2 <- '
# regressions
fitness ~ exercise + fitness
stress ~ hardiness 
illness ~ fitness + stress
# Covariance
exercise ~~ hardiness'

Residuals

Table 5. Residuals of Second Respecified Model
fitness stress illness exercise hardiness
fitness 0.0000006 -0.1326910 0.0509787 0.0000003 0.0817000
stress -0.1326910 0.0000000 0.0451076 -0.0569000 0.0000000
illness 0.0509787 0.0451076 -0.0346600 0.0552294 -0.2523417
exercise 0.0000003 -0.0569000 0.0552294 0.0000000 -0.0000001
hardiness 0.0817000 0.0000000 -0.2523417 -0.0000001 0.0000000

Discussion

Original Model

Akaike (AIC) 18854.957
Bayesian (BIC) 18894.173
RMSEA 0.127
Test statistic 35.179
Degrees of freedom 5
P-value (Chi-square) 0.000
SRMR 0.082
CFI 0.85
TLI 0.705

Respecified Model

Akaike (AIC) 18851.787
Bayesian (BIC) 18894.925
RMSEA 0.132
Test statistic 30.009
Degrees of freedom 4
P-value (Chi-square) 0.000
SRMR 0.069
CFI .873
TLI .682

Respecified Model 2

Akaike (AIC) 18856.957
Bayesian (BIC) 18900.095
RMSEA 0.145
Test statistic 35.179
Degrees of freedom 4
P-value (Chi-square)0.000
SRMR 0.082
CFI .847
TLI .619 

In comparison to the first and second model, the third model has two residuals found beyond the cutoff of <.1. Only one residual in the second model was found beyond the cutoff. Analyzing the fit indices between the three identifies the second model appropriate fit with the smaller AIC (18851.787). All models fit within the cutoff for SRMR as the cutoff is <.1, and have significant chi-square tests. The models do not fit within the cutoff of RMSEA, CFI, TLI,

The second model should be used as it has only one residual beyond <.1, smaller AIC, appropriate SRMR, and significant chi-square tests.