Binom2.rho(VGAM)
Binom2.rho()所属R语言包:VGAM
Bivariate Probit Model
二元Probit模型
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Density and random generation for a bivariate probit model. The correlation parameter rho is the measure of dependency.
密度和随机生成的二元概率模型。相关参数rho是依赖的措施。
用法----------Usage----------
rbinom2.rho(n, mu1,
mu2=if(exchangeable) mu1 else stop("'mu2' not specified"),
rho=0, exchangeable=FALSE, twoCols=TRUE,
colnames=if(twoCols) c("y1","y2") else c("00", "01", "10", "11"),
ErrorCheck=TRUE)
dbinom2.rho(mu1,
mu2=if(exchangeable) mu1 else stop("'mu2' not specified"),
rho=0, exchangeable=FALSE,
colnames=c("00", "01", "10", "11"), ErrorCheck=TRUE)
参数----------Arguments----------
参数:n
number of observations. Must be a single positive integer. The arguments mu1, mu2, rho are recycled to length n.
若干意见。必须是一个单一的正整数。的参数mu1,mu2,rho被回收长度n。
参数:mu1, mu2
The marginal probabilities. Only mu1 is needed if exchangeable=TRUE. Values should be between 0 and 1.
边缘概率。只有mu1如果exchangeable=TRUE。值应该是在0和1之间。
参数:rho
The correlation parameter. Must be numeric and lie between -1 and 1. The default value of zero means the responses are uncorrelated.
相关参数。必须是数字,介于-1和1。默认值为零表示的反应是不相关的。
参数:exchangeable
Logical. If TRUE, the two marginal probabilities are constrained to be equal.
逻辑。如果TRUE,这两个边缘概率的约束是平等的。
参数:twoCols
Logical. If TRUE, then a n * 2 matrix of 1s and 0s is returned. If FALSE, then a n * 4 matrix of 1s and 0s is returned.
逻辑。如果TRUE,然后是n*2矩阵1s和0s返回。如果FALSE,然后是n*4矩阵1s和0s返回。
参数:colnames
The dimnames argument of matrix is assigned list(NULL, colnames).
dimnamesmatrix参数分配list(NULL, colnames)。
参数:ErrorCheck
Logical. Do some error checking of the input parameters?
逻辑。做一些错误的输入参数的检查?
Details
详细信息----------Details----------
The function rbinom2.rho generates data coming from a bivariate probit model. The data might be fitted with the VGAM family function binom2.rho.
函数rbinom2.rho从二元probit模型来生成数据。的数据可能会被安装与VGAM家庭函数binom2.rho。
The function dbinom2.rho does not really compute the density (because that does not make sense here) but rather returns the four joint probabilities.
的功能dbinom2.rho并没有真正计算密度(因为这是没有意义的),而是返回四个联合概率。
值----------Value----------
The function rbinom2.rho returns either a 2 or 4 column matrix of 1s and 0s, depending on the argument twoCols.
函数rbinom2.rho返回1s和0s 2或4列的矩阵,根据参数twoCols。
The function dbinom2.rho returns a 4 column matrix of joint probabilities; each row adds up to unity.
函数dbinom2.rho的联合概率返回一个4列的矩阵,每行统一。
(作者)----------Author(s)----------
T. W. Yee
参见----------See Also----------
binom2.rho.
binom2.rho。
实例----------Examples----------
# Example 1[例1]
(myrho <- rhobit(2, inverse = TRUE))
ymat = rbinom2.rho(nn <- 2000, mu1 = 0.8, rho = myrho, exch = TRUE)
(mytab = table(ymat[,1], ymat[,2], dnn = c("Y1","Y2")))
fit = vglm(ymat ~ 1, binom2.rho(exch = TRUE))
coef(fit, matrix = TRUE)
# Example 2[例2]
bdata = data.frame(x = sort(runif(nn)))
bdata = transform(bdata, mu1 = probit(-2+4*x, inverse = TRUE),
mu2 = probit(-1+3*x, inverse = TRUE))
dmat = with(bdata, dbinom2.rho(mu1, mu2, myrho))
ymat = with(bdata, rbinom2.rho(nn, mu1, mu2, myrho))
fit2 = vglm(ymat ~ x, binom2.rho, bdata)
coef(fit2, matrix = TRUE)
## Not run: matplot(with(bdata, x), dmat, lty = 1:4, col = 1:4,[#不运行:matplot(与(BDATA,X),DMAT,LTY = 1:4,列= 1:4,]
type = "l", main = "Joint probabilities",
ylim = 0:1, lwd = 2, ylab = "Probability")
legend(x = 0.25, y = 0.9, lty = 1:4, col = 1:4, lwd = 2,
legend = c("1 = (y1=0, y2=0)", "2 = (y1=0, y2=1)",
"3 = (y1=1, y2=0)", "4 = (y1=1, y2=1)"))
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|