ee.gee: Estimating equation for GEE without missingness or with data...

View source: R/estimating_equations.R

ee.geeR Documentation

Estimating equation for GEE without missingness or with data missing completely at random.

Description

Calculate estimating equation from GEE in ELCIC without missingness or missing completely at random. This estimating equation is used for joint selection of marginal mean and working correlation structure.

Usage

ee.gee(y,x,r,id,beta,rho,phi,dist,corstr)

Arguments

y

A vector containing outcomes.

x

A matrix containing covariates. The first column should be all ones the represents the intercept.

r

A vector indicating the observation of outcomes: 1 for observed records, and 0 for unobserved records. The default setup is that all data are observed. See more in details section.

id

A vector indicating subject id.

beta

A plug-in estimator solved by an external estimation procedure.

rho

A correlation coefficients obtained from an external estimation procedure, such as GEE.

phi

An over-dispersion parameter obtained from an external estimation procedure, such as GEE.

dist

A specified distribution. It can be "gaussian", "poisson",and "binomial".

corstr

A candidate correlation structure. It can be "independence","exchangeable", and "ar1".

Details

If the element in argument "r" equals zero, the corresponding rows of "x" and "y" should be all zeros.

Value

A matrix containing values of calculated estimating equations.

Examples

## tests
# load data
data(geesimdata)
x<-geesimdata$x
y<-geesimdata$y
id<-geesimdata$id
corstr<-"exchangeable"
dist<-"poisson"
# obtain the estimates
library(geepack)
# x matrix already include the intercept column.
fit<-geeglm(y~x-1,data=geesimdata,family =dist,id=id,corstr = "ar1")
beta<-fit$coefficients
rho<-unlist(summary(fit)$corr[1])
phi<-unlist(summary(fit)$dispersion[1])
r<-rep(1,nrow(x))
ee.matrix<-ee.gee(y,x,r,id,beta,rho,phi,dist,corstr)
apply(ee.matrix,1,mean)


ELCIC documentation built on Feb. 16, 2023, 7:18 p.m.