Description Usage Arguments Value Author(s) Examples
View source: R/get.pseudodata.binomial.R
For logistic regression, given the current estimates of regression coefficients, working responses and their corresponding weights are obtained.
1 | get.pseudodata.binomial(Y, X, beta0, beta, niter)
|
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. |
Return a list including elements
z |
an (n*1) matrix of working responses |
sigma2 |
an (n*1) matrix of inverse of weights. |
Vitara Pungpapong, Min Zhang, Dabao Zhang
1 2 3 4 5 6 7 8 9 10 11 | 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
pseudodata<-get.pseudodata.binomial(Y=Y, X=X, beta0=0, beta=initbeta, niter=1)
z<-pseudodata$z
sigma<-sqrt(pseudodata$sigma2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.