使用lmer

时间:2016-06-16 06:16:49

标签: r

我正在尝试估算以下型号。我的目标是计算随机参数的置信区间。

variation.model1 =lmer(sales ~ 1+age+value_added+net_worth+(1+net_worth|industry:id)+
                           (1+net_worth|industry), 
                       data=data_file, 
                       control = lmerControl(calc.derivs = FALSE), 
                       REML=T, na.action=na.omit)

我收到以下错误。

confint(variation.model1, which="theta_")
  

profile.merMod(对象,其中= parm,signames = oldNames,...)的错误正式参数“哪个”与多个实际参数匹配

confint(variation.model1)
  

fn(x,...)出错:下降的VtV不是正定的另外:有50个或更多警告(使用警告()查看前50个)

我应该怎么处理这类问题?

我的数据结构:   行业id年销售年龄value_added net_worth 1 1 1 0 1.017 3.93 14.0 12.9 2 1 2 0 -0.780 3.90 13.2 13.1 3 1 2 3 -0.402 3.90 13.2 11.6 4 1 3 0 0.722 3.69 14.4 14.5 5 1 3 2 1.437 3.69 14.4 13.2 6 1 3 4 1.545 3.69 14.4 13.9

抱歉无法读取数据。

另外,我也尝试过使用lme。我收到了

的以下错误消息

DIAG(variation.model1 $ apVar)

diag中的错误(variation.model2 $ apVar):
无效的'nrow'值(太大或NA)

另外:警告信息: 在diag(variation.model2 $ apVar):由强制引入的NA

1 个答案:

答案 0 :(得分:2)

1)confint没有参数which - 如果您只想要某些参数的置信区间,请使用parm

confint(variation.model1, parm="theta_")

2)你的第二个问题我无法用我的数据重现,因为我不知道你的变量是什么,一个猜测将是风中的一击。但也许你的问题已在这里得到解答: Error message: Error in fn(x, ...) : Downdated VtV is not positive definite