# NOT RUN {
nnn <- 1000; tvec <- c(2, 3, 6); size <- 10
pdata <- data.frame(x2 = runif(nnn), x3 = runif(nnn))
pdata <- transform(pdata,
y1 = rgentbinom(nnn, prob = logitlink(-1, inverse = TRUE),
truncate = tvec,
size = size),
y2 = rgentbinom(nnn, prob = logitlink(-1 + x2 + x3, inverse = TRUE),
truncate = tvec,
size = size))
with(pdata, table(y1))
with(pdata, table(y2))
head(pdata)
fit1 <- vglm(cbind(y1, size - y1) ~ 1,
gentbinomial(truncate = tvec), trace = TRUE, data = pdata)
coef(fit1, matrix = TRUE)
summary(fit1)
fit2 <- vglm(cbind(y2, size - y2) ~ x2 + x3, crit = "coef",
gentbinomial(truncate = tvec), trace = TRUE, data = pdata)
coef(fit2, matrix = TRUE)
summary(fit2)
# }
Run the code above in your browser using DataLab