You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

lme含随机效应模型的BMI估计值低于gls是否正常?随机效应设置是否有误?

GLS与LME模型BMI轨迹估计值差异及LME随机效应设置疑问

我原本使用gls模型基于营养素摄入情况构建BMI轨迹模型,后因样本存在famID下嵌套twinID的多层聚类结构,改用lme模型。

GLS模型代码

gls_21m <- long_data_m %>% filter(age>= ageT2_m) %>%    #filtering out cases for pre-nutrient BMI
  gls(BMI ~  ns(age,3) * ns(nutrient,2) + ns(age,3) * Sex + ns(age,3) * CSDS_weight_0m + ns(age,3) * CweeksDelivery
      + ns(age,3) * Cincome + ns(age,3) * MatQual + ns(age,3) * ethnicity + ns(age,3) * Ccigarettes + 
        ns(age,3) * diabetes + ns(age,3) * CBMI_mother + ns(age,3) * NSSEC3 + ns(age,3) * CIMD + 
        ns(age,3) * FeedingModality_3 + ns(age,3) * closest_BMI_T2 ,
      data=., 
      correlation = corCAR1(form = ~age|twinID),
      na.action = na.omit)

LME模型代码

lme_21m <- long_data_m %>% filter(age>= ageT2_m) %>%    #filtering out cases for pre-nutrient BMI
  lme(BMI ~ ns(age,3) * ns(nutrient,2) + ns(age,3) * Sex + ns(age,3) * CSDS_weight_0m + ns(age,3) * CweeksDelivery
      + ns(age,3) * Cincome + ns(age,3) * MatQual + ns(age,3) * ethnicity + ns(age,3) * Ccigarettes + 
        ns(age,3) * diabetes + ns(age,3) * CBMI_mother + ns(age,3) * NSSEC3 + ns(age,3) * CIMD + 
        ns(age,3) * FeedingModality_3 + ns(age,3) * closest_BMI_T2 ,
      data=., 
      correlation = corCAR1(form = ~age|famID/twinID),
      na.action = na.omit,
      random = ~ 1|famID/twinID)
summary(lme_21m_adj_filt)

模型估计结果对比

当营养素摄入量为样本均值时,两个模型的估计结果差异显著:

GLS模型估计结果

age NUT_21m Estimate Std. Error   z Pr(&gt;|z|)   S 2.5 % 97.5 %
  24    46.9     17.0     0.0575 297   &lt;0.001 Inf  16.9   17.2
  36    46.9     16.1     0.0549 294   &lt;0.001 Inf  16.0   16.2
  48    46.9     15.6     0.0578 270   &lt;0.001 Inf  15.5   15.7
  60    46.9     15.4     0.0549 280   &lt;0.001 Inf  15.3   15.5
  72    46.9     15.4     0.0579 267   &lt;0.001 Inf  15.3   15.6
  84    46.9     15.7     0.0662 236   &lt;0.001 Inf  15.5   15.8
  96    46.9     16.0     0.0718 222   &lt;0.001 Inf  15.8   16.1
 108    46.9     16.4     0.0727 225   &lt;0.001 Inf  16.2   16.5
 120    46.9     16.9     0.0702 240   &lt;0.001 Inf  16.7   17.0
 132    46.9     17.4     0.0677 257   &lt;0.001 Inf  17.3   17.5
 144    46.9     18.0     0.0699 258   &lt;0.001 Inf  17.9   18.2
 156    46.9     18.7     0.0806 232   &lt;0.001 Inf  18.5   18.8
 168    46.9     19.4     0.1000 194   &lt;0.001 Inf  19.2   19.6
 180    46.9     20.1     0.1255 160   &lt;0.001 Inf  19.8   20.3

LME模型估计结果

age NUT_21m Estimate Std. Error   z Pr(&gt;|z|)   S 2.5 % 97.5 %
  24    46.9     15.8     0.0622 254   &lt;0.001 Inf  15.7   15.9
  36    46.9     14.9     0.0594 251   &lt;0.001 Inf  14.8   15.0
  48    46.9     14.4     0.0622 231   &lt;0.001 Inf  14.3   14.5
  60    46.9     14.2     0.0605 235   &lt;0.001 Inf  14.1   14.3
  72    46.9     14.2     0.0629 226   &lt;0.001 Inf  14.1   14.4
  84    46.9     14.4     0.0696 207   &lt;0.001 Inf  14.3   14.6
  96    46.9     14.8     0.0745 198   &lt;0.001 Inf  14.6   14.9
 108    46.9     15.2     0.0756 200   &lt;0.001 Inf  15.0   15.3
 120    46.9     15.7     0.0742 211   &lt;0.001 Inf  15.5   15.8
 132    46.9     16.2     0.0725 224   &lt;0.001 Inf  16.1   16.4
 144    46.9     16.8     0.0743 227   &lt;0.001 Inf  16.7   17.0
 156    46.9     17.5     0.0825 212   &lt;0.001 Inf  17.3   17.7
 168    46.9     18.2     0.0979 186   &lt;0.001 Inf  18.0   18.4
 180    46.9     18.9     0.1189 159   &lt;0.001 Inf  18.7   19.2

注:估计结果由marginaleffects包的avg_predictions函数生成

疑问

  • 这种LME模型估计值普遍低于GLS模型的情况是否正常?
  • 我的LME模型随机效应部分random = ~ 1|famID/twinID的设置是否存在问题?

内容的提问来源于stack exchange,提问作者Gaby Heuchan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 18:05:54