一些预测变量的尺度非常不同:考虑重新缩放; 11聚物

时间:2016-02-03 20:54:10

标签: r

我的数据

> str(dataCCLM)
'data.frame':   78 obs. of  10 variables:
 $ ID           : Factor w/ 39 levels "A1","A10","A11",..: 1 1 12 12 23 23 34     34 35 35 ...
 $ species      : Factor w/ 1 level "c": 1 1 1 1 1 1 1 1 1 1 ...
 $ d2H          : num  -91.5 -72.2 -66.3 -85.6 -57 ...
 $ tissue       : Factor w/ 2 levels "feather","liver": 2 1 2 1 2 1 2 1 2 1    ...
 $ d2HS         : num  -72.2 -72.2 -85.6 -85.6 -76.8 ...
 $ d2HL         : num  -91.5 -91.5 -66.3 -66.3 -57 -57 -72 -72 -87.8 -87.8 ...
 $ guild        : int  1 1 1 1 1 1 1 1 1 1 ...
 $ numerical.day: int  8 8 9 9 21 21 22 22 23 23 ...
 $ Elevation.m. : int  372 372 352 352 115 115 39 39 39 39 ...
 $ locality     : Factor w/ 13 levels "Bosque Cachil",..: 5 5 6 6 7 7 7 7 7 7 ...
> 

我正在尝试创建ID为随机因子的线性混合效果模型

mod.EL.OD <-lmer(d2H ~ Elevation.m. + numerical.day + (1|ID), data = dataCCLM, REML=F)
summary(mod.EL.OD)

我不断收到此缩放错误:

> mod.EL.OD <-lmer(d2H ~ Elevation.m. + numerical.day + (1|ID), data = dataCCLM, REML=F)
Warning message:
Some predictor variables are on very different scales: consider rescaling 
> summary(mod.EL.OD)
Linear mixed model fit by maximum likelihood  ['lmerMod']
Formula: d2H ~ Elevation.m. + numerical.day + (1 | ID)
   Data: dataCCLM

     AIC      BIC   logLik deviance df.resid 
   649.6    661.4   -319.8    639.6       73 

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.5083 -0.5624  0.0381  0.6384  2.9054 

Random effects:
 Groups   Name        Variance Std.Dev.
 ID       (Intercept)   8.72    2.953  
 Residual             204.70   14.307  
Number of obs: 78, groups:  ID, 39

Fixed effects:
                Estimate Std. Error t value
(Intercept)   -77.950113   3.770435 -20.674
Elevation.m.   -0.001115   0.001161  -0.961
numerical.day   0.056195   0.018016   3.119

Correlation of Fixed Effects:
            (Intr) Elvt..
Elevatin.m. -0.286       
numericl.dy -0.731 -0.283
fit warnings:
Some predictor variables are on very different scales: consider rescaling
> 

我已经关注了其他一些论坛建议并使用此代码来扩展我的数据:

pvars <- c( "d2H",# Scaling numeric parameters
           "Elevation.m.","numerical.day",
           "d2HL","d2HS")

datscCC <- dataCCLM
datscCC[pvars] <- lapply(datscCC[pvars],scale)

然而我仍然得到了警告...... 这个模型不适合我的数据,还是我可以采取其他重新缩放步骤?

0 个答案:

没有答案