【问题标题】:Options for dual domain latent growth curves (perhaps in lavaan?)双域潜在增长曲线的选项(可能在 lavaan 中?)
【发布时间】:2021-06-13 05:19:48
【问题描述】:

我正在尝试分析两个结果变量的三个重复测量值。建议使用潜在增长曲线模型。我知道在某些软件(SPSS)中,您可以使用多种测量方法制作增长曲线,但在 lavaan 中似乎并不那么简单。阅读 lavaan 教程,它提到了使用 sem() 的多级 SEM - 这是否适合重复测量数据集?或者是否有另一个包允许 R 中的多个结果增长曲线?

【问题讨论】:

    标签: r r-lavaan longitudinal sem


    【解决方案1】:

    要在lavaan 内创建潜在增长曲线很容易,请参见下面的示例(有 4 个时间点):

    library(lavaan)
    model <- ' i =~ 1*t1 + 1*t2 + 1*t3 + 1*t4
               s =~ 0*t1 + 1*t2 + 2*t3 + 3*t4 '
    fit <- growth(model, data=Demo.growth)
    summary(fit)
    #> lavaan 0.6-8 ended normally after 29 iterations
    #> 
    #>   Estimator                                         ML
    #>   Optimization method                           NLMINB
    #>   Number of model parameters                         9
    #>                                                       
    #>   Number of observations                           400
    #>                                                       
    #> Model Test User Model:
    #>                                                       
    #>   Test statistic                                 8.069
    #>   Degrees of freedom                                 5
    #>   P-value (Chi-square)                           0.152
    #> 
    #> Parameter Estimates:
    #> 
    #>   Standard errors                             Standard
    #>   Information                                 Expected
    #>   Information saturated (h1) model          Structured
    #> 
    #> Latent Variables:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>   i =~                                                
    #>     t1                1.000                           
    #>     t2                1.000                           
    #>     t3                1.000                           
    #>     t4                1.000                           
    #>   s =~                                                
    #>     t1                0.000                           
    #>     t2                1.000                           
    #>     t3                2.000                           
    #>     t4                3.000                           
    #> 
    #> Covariances:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>   i ~~                                                
    #>     s                 0.618    0.071    8.686    0.000
    #> 
    #> Intercepts:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>    .t1                0.000                           
    #>    .t2                0.000                           
    #>    .t3                0.000                           
    #>    .t4                0.000                           
    #>     i                 0.615    0.077    8.007    0.000
    #>     s                 1.006    0.042   24.076    0.000
    #> 
    #> Variances:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>    .t1                0.595    0.086    6.944    0.000
    #>    .t2                0.676    0.061   11.061    0.000
    #>    .t3                0.635    0.072    8.761    0.000
    #>    .t4                0.508    0.124    4.090    0.000
    #>     i                 1.932    0.173   11.194    0.000
    #>     s                 0.587    0.052   11.336    0.000
    

    但是,如果您想为 2 个并行过程(睡眠和焦虑)建模潜在增长曲线,您可以使用以下方法:

    library(lavaan)
    #> This is lavaan 0.6-8
    #> lavaan is FREE software! Please report any bugs.
    model <- "
    i1 =~ 1*t1 + 1*t2 + 1*t3 + 1*t4
    s1 =~ 0*t1 + 1*t2 + 2*t3 + 3*t4
    
    
    i2 =~ 1*c1 + 1*c2 + 1*c3 + 1*c4
    s2 =~ 0*c1 + 1*c2 + 2*c3 + 3*c4
    
    s1 ~ i2
    s2 ~ i1
    "
    fit <- growth(model, data=Demo.growth)
    #> Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
    #>                 is not positive definite;
    #>                 use lavInspect(fit, "cov.lv") to investigate.
    summary(fit)
    #> lavaan 0.6-8 ended normally after 76 iterations
    #> 
    #>   Estimator                                         ML
    #>   Optimization method                           NLMINB
    #>   Number of model parameters                        20
    #>                                                       
    #>   Number of observations                           400
    #>                                                       
    #> Model Test User Model:
    #>                                                       
    #>   Test statistic                               156.195
    #>   Degrees of freedom                                24
    #>   P-value (Chi-square)                           0.000
    #> 
    #> Parameter Estimates:
    #> 
    #>   Standard errors                             Standard
    #>   Information                                 Expected
    #>   Information saturated (h1) model          Structured
    #> 
    #> Latent Variables:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>   i1 =~                                               
    #>     t1                1.000                           
    #>     t2                1.000                           
    #>     t3                1.000                           
    #>     t4                1.000                           
    #>   s1 =~                                               
    #>     t1                0.000                           
    #>     t2                1.000                           
    #>     t3                2.000                           
    #>     t4                3.000                           
    #>   i2 =~                                               
    #>     c1                1.000                           
    #>     c2                1.000                           
    #>     c3                1.000                           
    #>     c4                1.000                           
    #>   s2 =~                                               
    #>     c1                0.000                           
    #>     c2                1.000                           
    #>     c3                2.000                           
    #>     c4                3.000                           
    #> 
    #> Regressions:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>   s1 ~                                                
    #>     i2                6.115    3.785    1.615    0.106
    #>   s2 ~                                                
    #>     i1               -0.011    0.017   -0.644    0.519
    #> 
    #> Covariances:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>   i1 ~~                                               
    #>     i2                0.101    0.062    1.632    0.103
    #>  .s1 ~~                                               
    #>    .s2                0.021    0.017    1.205    0.228
    #> 
    #> Intercepts:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>    .t1                0.000                           
    #>    .t2                0.000                           
    #>    .t3                0.000                           
    #>    .t4                0.000                           
    #>    .c1                0.000                           
    #>    .c2                0.000                           
    #>    .c3                0.000                           
    #>    .c4                0.000                           
    #>     i1                0.615    0.077    8.009    0.000
    #>    .s1                0.824    0.276    2.990    0.003
    #>     i2                0.030    0.041    0.731    0.464
    #>    .s2                0.002    0.024    0.063    0.950
    #> 
    #> Variances:
    #>                    Estimate  Std.Err  z-value  P(>|z|)
    #>    .t1                0.597    0.086    6.978    0.000
    #>    .t2                0.673    0.061   11.056    0.000
    #>    .t3                0.636    0.072    8.780    0.000
    #>    .t4                0.507    0.124    4.095    0.000
    #>    .c1                0.977    0.069   14.120    0.000
    #>    .c2                0.892    0.064   14.016    0.000
    #>    .c3                0.838    0.065   12.996    0.000
    #>    .c4                0.803    0.080   10.010    0.000
    #>     i1                1.931    0.173   11.193    0.000
    #>    .s1                0.533    0.203    2.626    0.009
    #>     i2                0.001    0.006    0.246    0.806
    #>    .s2                0.007    0.006    1.033    0.302
    

    reprex package (v1.0.0) 于 2021-03-19 创建

    【讨论】:

    • 谢谢!为了澄清,我的问题是如何在每个时间点有多个度量时建立模型。因此,例如 t1、t2、t3 和 t4 是测量睡眠和焦虑的三倍。
    • 嗯,您希望 LGCM 用于 2 个并行进程。它提供了有关两个过程(即睡眠和焦虑)变化率的信息,无论是线性的还是非线性的......我调整了我的答案。
    • 如果我的回答解决了你的问题,请标记为已解决。
    猜你喜欢
    • 1970-01-01
    • 2016-11-23
    • 1970-01-01
    • 2013-12-05
    • 1970-01-01
    • 2012-07-21
    • 2021-04-12
    • 2020-03-15
    • 1970-01-01
    相关资源
    最近更新 更多