A specified estimating equation for ELCIC under GLM. This estimating equation is used for marginal mean selection.
Arguments
- x
A matrix containing covariates. The first column should be all ones corresponding to the intercept. See more details in
- y
A vector containing outcomes.
- beta
A plug-in estimator solved by an external estimating procedure.
- dist
A specified distribution. It can be "gaussian", "poisson",and "binomial".
Examples
## tests
# load data
data(glmsimdata)
x<-glmsimdata$x
y<-glmsimdata$y
# obtain the estimates. Note that x matrix already contains intercept.
fit<-glm(y~x-1,family="poisson")
beta<-fit$coefficients
ee.matrix<-ee.glm(x, y, beta, dist="poisson")
apply(ee.matrix,1,mean)
#> [1] -2.439933e-11 5.729860e-12 -1.884371e-12 6.665323e-12