R数据分析:论文中的轨迹的做法,潜增长模型和增长混合模型
2026-05-22
张柯论文指导

好多同学手上有纵向数据,想看轨迹,看人群异质性,咨询做法,今天给大家写两个方法,一个叫潜增长模型Latent Class Growth Analyses (LCGA) ,一个叫增长混合模型Growth Mixture Modeling (GMM)。
这个异质性怎么看呢,就是基于人的不同发展的轨迹的出来的:
They can be used to identify latent subgroups, classes or clusters of individuals based on their common growth trajectories over time.
两个模型都可以看作是增长模型growth mode的拓展:
LCGA can roughly be seen as an extension of a fixed effect growth model, whereas GMM can be seen as an extension of a random effect growth model
LCGA和GMM的区别
这两种方法都是将传统增长模型与潜类别分析相结合的模型,既可以刻画增长趋势又可以考虑群体异质性的目的。
二者的区别主要在于类别组内的发展轨迹是否考虑增长曲线内部的个体扰动,潜增长模型可以看作是增长混合模型的特例,就是说增长混合模型不考虑随机效应的时候就可以认为是潜增长模型:
A special case of GMMs is latent class growth analysis (LCGA)[15],[16] which does not allow for departure from the average trajectory within each latent class。Thus, in contrast to mixed effects models where each subject's intercept and slope are drawn from a normal distribution or GCMMs where they are drawn from a mixture of normal distributions,LCGAs allow only for a limited set of discrete options。
实例操练
我现在手上有500个重复测量的数据集,100个观测,每个观测连续测量5次。数据大概长这样:
固定效应部分,“~”符号左边写因变量右边写自变量,自变量用加号链接。mixture参数只有在类别数大于一的时候才需要设置,我们做1个类别是不需要的;random参数是随机效应部分,因为我们做的是潜增长(没有混合),也没有必要设置这一个参数,subject用来设置嵌套结构的主体,此例中是“ID”;ng是潜类别个数;classmb是逻辑增长中的协变量,所以也不需要设置;最终我们写出代码如下:
如果需要论文指导,可联系网站客服!
学员评价

推荐阅读:
- 上一篇:latex模板(自用)
- 下一篇:没有了