Skip to contents

A 10-variable dataset with 200 cases.

Usage

data_pa

Format

A data frame with 200 rows and 10 variables:

m11

Mediator. Numeric.

m12

Mediator. Numeric.

m21

Mediator. Numeric.

m22

Mediator. Numeric.

y1

Outcome variable. Numeric.

y2

Outcome variable. Numeric.

x1

Predictor. Numeric.

x2

Predictor. Numeric.

c1

Control variable. Numeric.

c2

Control variable. Numeric.

Examples

library(lavaan)
#> This is lavaan 0.6-15
#> lavaan is FREE software! Please report any bugs.
data(data_pa)
mod <-
"
m11 ~ a11*x1 + a21*x2 + c1 + c2
m12 ~ b12*m11 + c1 + c2
m21 ~ a12*x1 + a22*x2 + c1 + c2
m22 ~ b22*m21 + c1 + c2
y1 ~ b12y1*m12 + c1 + c2
y2 ~ b22y2*m22 + c1 + c2
ind_1 := a11*b12*b12y1
ind_2 := a21*b22*b22y2
"
fit <- sem(mod, data_pa)
summary(fit, fit.measures = TRUE)
#> lavaan 0.6.15 ended normally after 7 iterations
#> 
#>   Estimator                                         ML
#>   Optimization method                           NLMINB
#>   Number of model parameters                        27
#> 
#>   Number of observations                           200
#> 
#> Model Test User Model:
#>                                                       
#>   Test statistic                                76.709
#>   Degrees of freedom                                18
#>   P-value (Chi-square)                           0.000
#> 
#> Model Test Baseline Model:
#> 
#>   Test statistic                               377.440
#>   Degrees of freedom                                39
#>   P-value                                        0.000
#> 
#> User Model versus Baseline Model:
#> 
#>   Comparative Fit Index (CFI)                    0.827
#>   Tucker-Lewis Index (TLI)                       0.624
#> 
#> Loglikelihood and Information Criteria:
#> 
#>   Loglikelihood user model (H0)              -1709.158
#>   Loglikelihood unrestricted model (H1)      -1670.803
#>                                                       
#>   Akaike (AIC)                                3472.315
#>   Bayesian (BIC)                              3561.370
#>   Sample-size adjusted Bayesian (SABIC)       3475.831
#> 
#> Root Mean Square Error of Approximation:
#> 
#>   RMSEA                                          0.128
#>   90 Percent confidence interval - lower         0.099
#>   90 Percent confidence interval - upper         0.158
#>   P-value H_0: RMSEA <= 0.050                    0.000
#>   P-value H_0: RMSEA >= 0.080                    0.996
#> 
#> Standardized Root Mean Square Residual:
#> 
#>   SRMR                                           0.090
#> 
#> Parameter Estimates:
#> 
#>   Standard errors                             Standard
#>   Information                                 Expected
#>   Information saturated (h1) model          Structured
#> 
#> Regressions:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   m11 ~                                               
#>     x1       (a11)    0.543    0.066    8.202    0.000
#>     x2       (a21)    0.572    0.069    8.345    0.000
#>     c1                0.258    0.070    3.701    0.000
#>     c2                0.460    0.074    6.213    0.000
#>   m12 ~                                               
#>     m11      (b12)    0.290    0.055    5.246    0.000
#>     c1                0.165    0.073    2.269    0.023
#>     c2                0.185    0.079    2.322    0.020
#>   m21 ~                                               
#>     x1       (a12)   -0.068    0.066   -1.027    0.304
#>     x2       (a22)    0.184    0.069    2.678    0.007
#>     c1               -0.011    0.070   -0.158    0.874
#>     c2               -0.138    0.074   -1.861    0.063
#>   m22 ~                                               
#>     m21      (b22)    0.249    0.076    3.274    0.001
#>     c1                0.031    0.076    0.405    0.685
#>     c2               -0.023    0.082   -0.280    0.780
#>   y1 ~                                                
#>     m12     (b121)    0.442    0.070    6.267    0.000
#>     c1               -0.041    0.078   -0.525    0.599
#>     c2               -0.053    0.084   -0.636    0.525
#>   y2 ~                                                
#>     m22     (b222)    0.511    0.065    7.822    0.000
#>     c1                0.210    0.072    2.895    0.004
#>     c2               -0.027    0.077   -0.350    0.727
#> 
#> Covariances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>  .y1 ~~                                               
#>    .y2                0.028    0.075    0.377    0.706
#> 
#> Variances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>    .m11               0.928    0.093   10.000    0.000
#>    .m12               0.987    0.099   10.000    0.000
#>    .m21               0.930    0.093   10.000    0.000
#>    .m22               1.118    0.112   10.000    0.000
#>    .y1                1.115    0.112   10.000    0.000
#>    .y2                1.005    0.101   10.000    0.000
#> 
#> Defined Parameters:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>     ind_1             0.070    0.019    3.612    0.000
#>     ind_2             0.073    0.026    2.840    0.005
#>