miss.glm: Statistical Inference for Logistic Regression Models with...

Description Usage Arguments Value Examples

Description

This function is used to perform statistical inference for logistic regression model with missing values, by algorithm SAEM.

Usage

1
miss.glm(formula, data, control = list(...), ...)

Arguments

formula

an object of class "formula" : a symbolic description of the logistic regression model to be fitted.

data

an optional data frame containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which miss.glm is called.

control

a list of parameters for controlling the fitting process. For miss.glm.fit this is passed to miss.glm.control.

...

arguments to be used to form the default control argument if it is not supplied directly.

Value

An object of class "miss.glm": a list with following components:

coefficients

Estimated β.

ll

Observed log-likelihood.

var.covar

Variance-covariance matrix for estimated parameters.

s.err

Standard error for estimated parameters.

mu.X

Estimated μ.

Sig.X

Estimated Σ.

call

the matched call.

formula

the formula supplied.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Generate dataset
N <- 100  # number of subjects
p <- 3     # number of explanatory variables
mu.star <- rep(0,p)  # mean of the explanatory variables
Sigma.star <- diag(rep(1,p)) # covariance
beta.star <- c(1, 1,  0) # coefficients
beta0.star <- 0 # intercept
beta.true = c(beta0.star,beta.star)
X.complete <- matrix(rnorm(N*p), nrow=N)%*%chol(Sigma.star) +
              matrix(rep(mu.star,N), nrow=N, byrow = TRUE)
p1 <- 1/(1+exp(-X.complete%*%beta.star-beta0.star))
y <- as.numeric(runif(N)<p1)

# Generate missingness
p.miss <- 0.10
patterns <- runif(N*p)<p.miss #missing completely at random
X.obs <- X.complete
X.obs[patterns] <- NA

df.obs = data.frame(y,X.obs)

# SAEM
miss.list = miss.glm(y~., data=df.obs, print_iter=FALSE,seed=100)
print(miss.list)
print(summary(miss.list))
summary(miss.list)$coef

misaem documentation built on April 12, 2021, 9:06 a.m.