Learn R Programming

VGAM (version 1.1-14)

N1binomial: Linear Model and Binomial Mixed Data Type Family Function

Description

Estimate the four parameters of the (bivariate) \(N_1\)--binomial copula mixed data type model by maximum likelihood estimation.

Usage

N1binomial(lmean = "identitylink", lsd = "loglink",
    lvar = "loglink", lprob = "logitlink", lapar = "rhobitlink",
    zero = c(if (var.arg) "var" else "sd", "apar"),
    nnodes = 20, copula = "gaussian", var.arg = FALSE,
    imethod = 1, isd = NULL, iprob = NULL, iapar = NULL)

Arguments

Value

An object of class "vglmff"

(see vglmff-class). The object is used by modelling functions such as vglm

and vgam.

Details

The bivariate response comprises \(Y_1\) from the linear model having parameters mean and sd for \(\mu_1\) and \(\sigma_1\), and the binary \(Y_2\) having parameter prob for its mean \(\mu_2\). The joint probability density/mass function is \(P(y_1, Y_2 = 0) = \phi_1(y_1; \mu_1, \sigma_1) (1 - \Delta)\) and \(P(y_1, Y_2 = 1) = \phi_1(y_1; \mu_1, \sigma_1) \Delta\) where \(\Delta\) adjusts \(\mu_2\) according to the association parameter \(\alpha\). The quantity \(\Delta\) is \(\Phi((\Phi^{-1}(\mu_2) - \alpha Z_1)/ \sqrt{1 - \alpha^2})\). The quantity \(Z_1\) is \((Y_1-\mu_1) / \sigma_1\). Thus there is an underlying bivariate normal distribution, and a copula is used to bring the two marginal distributions together. Here, \(-1 < \alpha < 1\), and \(\Phi\) is the cumulative distribution function pnorm of a standard univariate normal.

The first marginal distribution is a normal distribution for the linear model. The second column of the response must have values 0 or 1, e.g., Bernoulli random variables. When \(\alpha = 0\) then \(\Delta=\mu_2\). Together, this family function combines uninormal and binomialff. If the response are correlated then a more efficient joint analysis should result.

This VGAM family function cannot handle multiple responses. Only a two-column matrix is allowed. The two-column fitted value matrix has columns \(\mu_1\) and \(\mu_2\).

References

Song, P. X.-K. (2007). Correlated Data Analysis: Modeling, Analytics, and Applications. Springer.

See Also

rN1binom, N1poisson, binormalcop, uninormal, binomialff, pnorm.

Examples

Run this code
nn <- 1000; mymu <- 1; sdev <- exp(1)
apar <- rhobitlink(0.5, inverse = TRUE)
prob <-  logitlink(0.5, inverse = TRUE)
mat <- rN1binom(nn, mymu, sdev, prob, apar)
nbdata <- data.frame(y1 = mat[, 1], y2 = mat[, 2])
fit1 <- vglm(cbind(y1, y2) ~ 1, N1binomial,
             nbdata, trace = TRUE)
coef(fit1, matrix = TRUE)
Coef(fit1)
head(fitted(fit1))
summary(fit1)
confint(fit1)

Run the code above in your browser using DataLab