Learn R Programming

icmm (version 1.2)

get.pseudodata.binomial: Obtain pseudodata based on the binary logistic regression model.

Description

For logistic regression, given the current estimates of regression coefficients, working responses and their corresponding weights are obtained.

Usage

get.pseudodata.binomial(Y, X, beta0, beta, niter)

Arguments

Y

an (n*1) numeric matrix of responses.

X

an (n*p) numeric design matrix.

beta0

a scalar value of intercept term.

beta

a (p*1) matrix of regression coefficients.

niter

number of iterations in ICM/M algorithm.

Value

Return a list including elements

z

an (n*1) matrix of working responses

sigma2

an (n*1) matrix of inverse of weights.

Examples

Run this code
# NOT RUN {
data(simBinomial)
Y<-as.matrix(simBinomial[,1])
X<-as.matrix(simBinomial[,-1])
p<-dim(X)[2]
# Obtain initial values from lasso
data(initbetaBinomial)
initbeta<-as.matrix(initbetaBinomial)
# Get Pseudodata
# }
# NOT RUN {
pseudodata<-get.pseudodata.binomial(Y=Y, X=X, beta0=0, beta=initbeta, niter=1)
# }
# NOT RUN {
z<-pseudodata$z
# }
# NOT RUN {
sigma<-sqrt(pseudodata$sigma2)
# }

Run the code above in your browser using DataLab