OpenBUGS-未定义变量 [英] OpenBUGS - Variable is not defined

查看:103
本文介绍了OpenBUGS-未定义变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OpenBUGS中使用以下代码进行分析:

I'm using the following code in OpenBUGS to perform an analysis:

model
{
for(i in 1:467)
{
probit(p[i])<-gamma0+gamma1*drug[i]+gamma2*CD41[i]
R[i]~dbern(p[i])
junk[i]<-ID[i]
}
gamma0~dnorm(0,.0001)
gamma1~dnorm(0,.0001)
gamma2~dnorm(0,.0001)
}
ID[] drug[] CD41[] R[]
1   0   114 NA
2   1   40  NA
3   1   12  0
4   0   15  0
....
END

并且我收到以下错误:未定义变量CD41 [].我不确定如何解决此问题,因此将不胜感激.

And I'm receiving the following error: Variable CD41[] is not defined. I'm not sure how to fix this problem, so any help would be greatly appreciated.

推荐答案

确定要正确将向量变量CD41传递到dataList吗?

Are you sure you are passing the vector variable CD41 correctly to your dataList?

如果使用R,请尝试先调用CD41<-as.vector(CD41),然后再将其传递给OpenBUGS.请记住,对于BUG和R,1列矩阵和向量都是不同的.

If are using R, try to call CD41<-as.vector(CD41) before passing it to OpenBUGS. Remember that 1 column matrix and a vector are different things for both BUG and for R.

这篇关于OpenBUGS-未定义变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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