错误消息:fn(x,...)中的错误:降级的VtV不是肯定的 [英] Error message: Error in fn(x, ...) : Downdated VtV is not positive definite

查看:486
本文介绍了错误消息:fn(x,...)中的错误:降级的VtV不是肯定的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此先感谢所有对此内容进行审核的人. 我曾经在档案库中看到过这个问题,但是我对R有点陌生,并且在理解问题和解决方案时遇到了很多麻烦...

Thanks in advance for anyone who gives this a look over. I've seen this problem once on the archives but I'm a bit new to R and had a lot of trouble understanding both the problem and the solution...

我正在尝试使用lmer函数来创建一个最低限度的模型.我的模型是Mated〜Size * Attempts * Status +(随机因子).

I'm trying to use the lmer function to create a minimum adequate model. My model is Mated ~ Size * Attempts * Status + (random factor).

as.logical(Mated)
as.numeric(Size)
as.factor(Attempts)
as.factor(Status)

(这些都在以前的模型上起作用)

(These have all worked on previous models)

因此,毕竟我尝试运行模型:

So after all that I try running my model:

Model1<-lmer(Mated ~ Size*Status*Attempts + (1|FemaleID),data=mydata)

它可以毫无问题地提交.只有当我尝试应用此更新时,它才会出错:

And it can be submitted without fault.It's only when I try to apply this update that it goes wrong:

Model2<-update(Model1, REML=FALSE)

这是提供的错误消息: fn(x,...)中的错误:降级的VtV不是正定的

Here is the error message supplied: Error in fn(x, ...) : Downdated VtV is not positive definite

如果我建立了没有交互作用的第三个模型,并在那个模型和第一个模型之间进行了ANOVA,那么说这两个模型有很大的不同.

If I make a third model without the interaction and do an ANOVA between that and model one, then it says the two are significantly different.

Model3<-update(Model1,~.-Size:Status:Attempts
anova(Model1,Model3)

我做错了什么?三种方式的互动真的很重要还是我犯了一些错误?

What am I doing wrong? Is the three way interaction really significant or have I made some mistake?

谢谢

推荐答案

如果Mated是二进制的,那么您可能应该将glmer与logit或probit链接函数一起使用,例如:

If Mated is binary, then you should probably be using glmer with a logit or probit link function instead, something like:

model <- glmer(Mated ~ Size * Status * Attempts + (1|FemaleID), 
data = mydata, family = binomial)

如果您可以让我们知道您的数据是什么样子(head(mydata)可能很好,或者请参阅

It would help if you could let us know what your data looks like (head(mydata) might be fine, or see here for how to make a reproducible example).

此外,我会避免使Mated具有逻辑性(请参阅此问题和答案了解如何使您的生活更加困难.相反,as.factor(Mated)将显式使您的响应变量离散.

Also, I would avoid making Mated logical (see this question and answer for how it can make your life more difficult). Instead, as.factor(Mated) will explicitly make your response variable discrete.

之后,您可以将完整模型和简化模型与anova()进行比较.

After that, you can compare your full and reduced models with anova().

这篇关于错误消息:fn(x,...)中的错误:降级的VtV不是肯定的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆