geeglm_small_samp | R Documentation |
This function fits a GEE model using the geeglm
function
from the geepack-package. Additionally, small sample variance
estimates are calculated using one of three methods proposed in the following
papers: Pan (2001), Mancl and Derouen (2001), and Wang and Long (2011).
geeglm_small_samp(
formula,
family = poisson,
data,
id,
corstr = "exchangeable",
small.samp.method = NULL,
sort = T,
...
)
formula |
A two-sided linear formula object with the response on the left of a ~ operator and the terms, separated by + operators, on the right. |
family |
The error distribution to be used in the model. Only |
data |
an optional data frame, list or environment (or object coercible by |
id |
a vector or data column name which identifies the clusters. The length of
id should be the same as the number of observations. Data are
assumed to be sorted so that observations on each cluster appear
as contiguous rows in data. If data is not sorted this way, the
function will not identify the clusters correctly. If |
corstr |
a character string specifying the correlation structure. The following are permitted: "independence", "exchangeable", "ar1", and "unstructured" |
small.samp.method |
a character string specifying the
small sample method. The following are permitted: |
... |
additional arguments passed on to |
This function borrows heavily from the corresponding small sample variance estimating
functions in the geesmv-package
(GEE.var.pan
, GEE.var.md
and GEE.var.wl
).
In addition to combining these functions into a single function and using the geeglm
function
in model fitting, this function also varys from these functions in that it
ensures that model offsets are properly accounted for in the calculation of
small sample estimators.
This function returns a geeglm
object with small modifications:
small.samp.var |
an additional item containing the small sample variance estimators is included in the fit object |
geese$vbeta |
The variance covariance matrix in the geese item from the object fit contains the small sample adjusted variance covaraince matrix. |
Elizabeth Wynn, geesmv-authors for underlying code used in small sample size variance estimators.
Mancl LA, DeRouen TA (2001). "A covariance estimator for GEE with improved small-sample properties." Biometrics, 57(1), 126-134. ISSN 0006341X. doi:10. 1111/j.0006-341X.2001.00126.x.
Pan W (2001). "On the robust variance estimator in generalised estimating equations." Biometrika, 88(3), 901-906. ISSN 00063444. doi:10.1093/biomet/88.3.901.
Wang M, Long Q (2011). "Modified robust variance estimator for generalized estimating equations with improved small-sample performance." Statistics in Medicine, 30(11), 1278-1291. ISSN 02776715. doi:10.1002/sim.4150
geeglm
, GEE.var.pan
, GEE.var.md
and GEE.var.wl
data("simdata")
sample_meta_data <- simdata$metadata
#Subset down to one observation (i.e. gene)
counts=simdata$counts[1,]
#Combine counts, metadata into dataframe
df=cbind(counts, sample_meta_data)
#Sort data by id (Function also does this if sort=T)
df=df[order(df$ids),]
#Fit the Model-use Pan method for small sample variance
fit.gee.pan<-geeglm_small_samp(formula =counts ~ group * time,
family=poisson, data=df, id=ids,
corstr="exchangeable",
small.samp.method="pan", sort=T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.