Description Usage Arguments Value References See Also Examples
View source: R/info.mvlogistic.R
Calculates the expected information matrix for a multivariate logistic model where the parameter p, probability of an event, depends on the covariates, x = c(x[1], x[2], …, x[n]), through a logistic, p = exp(u)/(1+exp(u)), model. The variable u is a linear combination of the covariates via a set of coefficients, coef = c(coef[1], coef[2], …, coef[n]), u = Sum (coef[i] * x[i]) i = 1, … ,n.
The usual use of this routine is for tabulated data in which case the x's will all be 0 or 1 valued indicator variables.
1 | info.mvlogistic(coef, design, rss=1)
|
coef |
Vector of length p (number of covariates) giving coefficients of variables. |
design |
Matrix of dimension (n X p) each row of which gives values of covariates at one of the n design points. Note: Most models will include a constant term and the column of design corresponding to this term will be identically 1. |
rss |
The relative sample size at each design point. The default is the same sample size at each design point. If changed from the default, rss should be a vector of length n. |
The information matrix for one observation for this design.
Cox, D.R. and Hinkley, D.V. (1974). Theoretical Statistics Chapman and Hall, London.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Find the information matrix for a multivariate
# logistic design with variables x, y and z
# Define coefficient matrix so that
# u = 1 + .5*x + .7*y + .9*z
coef <- c(1, .5, .7, .9)
# Define the design matrix so that there are 10 design points
intercept <- rep(1, 10)
x <- rnorm(10)
y <- rnorm(10)
z <- rnorm(10)
design <- cbind(intercept, x, y, z)
# Use info.mvlogistic to find the information matrix for
# this design
info.xyz <- info.mvlogistic(coef, design)
print(info.xyz)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.