icdglm {icdGLM}R Documentation

EM by the Method of Weights for Incomplete Data in GLMs

Description

This function applies the EM algorithm by the method of weights to incomplete data in a general linearized model.

Usage

icdglm(formula, family = binomial(link = "logit"), data, weights = rep.int(1, NROW(data)),
              indicator = rep.int(0, NROW(data)), control = list(), model = TRUE)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

family

a description of the error distribution and link function to be used in the model. This can be a character string naming a family function, a family function or the result of a call to a family function. (See family for details of family functions.)

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula)

weights

a vector which attaches a weight to each observation. For incomplete data, this is obtained from expand_data.

indicator

a vector that indicates which observations belong to each other. This is obtained from expand_data.

control

a list of control characteristics used for the iteration process in icdglm.fit. See glm.control for further information how this works. Default settings are: epsilon = 1e-10, maxit = 100, trace = FALSE.

model

a logical value indicating whether model frame should be included as a component of the returned value.

Value

icdglm returns an object of class inheriting from "icdglm.fit", "glm" and "lm". The function summary.icdglm can be used to obtain a summary of the results. icdglm returns a list with the following elements:

References

Ibrahim, Joseph G. (1990). Incomplete Data in Generalized Linear Models. Journal of the American Statistical Association, Vol.85, No. 411, pp. 765 - 769.

See Also

expand_data, icdglm.fit, glm, glm.fit, glm.control, summary.glm

Examples

data(TLI.data)
          complete.data <- expand_data(data = TLI.data[,1:3],
                                       y = TLI.data[,4],
                                       missing.x = 1:3,
                                       value.set = 0:1)
          example <- icdglm(y ~ x1 + x2 + x3, family = binomial(link = "logit"),
                            data = complete.data$data, weights = complete.data$weights,
                            indicator = complete.data$indicator)
          summary(example)

[Package icdGLM version 1.0.0 Index]