Type: Package
Title: Modified Generalized Estimating Equations for Small-Sample Data
Version: 0.1.2
Maintainer: Ryota Ishii <r.ishii0808@gmail.com>
Description: Analyze small-sample clustered or longitudinal data using modified generalized estimating equations with bias-adjusted covariance estimator. The package provides any combination of three modified generalized estimating equations and 11 bias-adjusted covariance estimators.
Depends: R (≥ 4.5.0)
Imports: MASS (≥ 7.3-45)
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
Encoding: UTF-8
RoxygenNote: 7.3.2
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2025-06-18 04:19:28 UTC; rishii
Author: Ryota Ishii [aut, cre], Kazushi Maruo [ctb], Masahiko Gosho [ctb]
Repository: CRAN
Date/Publication: 2025-06-19 07:40:02 UTC

Modified Generalized Estimating Equations for Small-Sample Data

Description

geess is an extension of geessbin package (Ishii et al., 2024). geess analyzes small-sample clustered or longitudinal data using modified generalized estimating equations (GEE) with bias-adjusted covariance estimator. This function provides any combination of three GEE methods (conventional and two modified GEE methods) and 12 covariance estimators (unadjusted and 11 bias-adjusted estimators).

Usage

geess(
  formula,
  family = gaussian,
  data = parent.frame(),
  id = NULL,
  corstr = "independence",
  repeated = NULL,
  beta.method = "GEE",
  SE.method = "SA",
  b = NULL,
  maxitr = 50,
  tol = 1e-05,
  scale.fix = FALSE,
  conf.level = 0.95
)

Arguments

formula

Object of class formula: symbolic description of model to be fitted (see documentation of lm and formula for details).

family

Description of the error distribution and link function to be used in the model. The gaussian family accepts the identity link function. The binomial family accepts the links logit and probit. The poisson family accepts the log link function.

data

Data frame.

id

Vector that identifies the subjects or clusters (NULL by default).

corstr

Working correlation structure. The following are permitted: "independence", "exchangeable", "ar1", and "unstructured" ("independence" by default).

repeated

Vector that identifies repeatedly measured variable within each subject or cluster. If repeated = NULL, as is the case in function gee, data are assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula.

beta.method

Method for estimating regression parameters (see Details section). The following are permitted: "GEE", "PGEE", and "BCGEE" ("GEE" by default).

SE.method

Method for estimating standard errors (see Details section). The following are permitted: "SA", "MK", "KC", "MD", "FG", "PA", "GS", "MB", "WL", "WB", "FW", and "FZ" ("SA" by default).

b

Numeric vector specifying initial values of regression coefficients. If b = NULL (default value), the initial values are calculated using the ordinary or Firth logistic regression assuming that all the observations are independent.

maxitr

Maximum number of iterations (50 by default).

tol

Tolerance used in fitting algorithm (1e-5 by default).

scale.fix

Logical variable; if TRUE, the scale parameter is fixed at 1 (FALSE by default).

conf.level

Numeric value of confidence level for confidence intervals (0.95 by default).

Details

Details of beta.method are as follows:

Details of SE.method are as follows:

Descriptions and performances of some of the above methods in the case of binary outcomes can be found in Gosho et al. (2023).

Value

The object of class "geess" representing the results of modified generalized estimating equations with bias-adjusted covariance estimators. Generic function summary provides details of the results.

References

Examples

library(geess)
library(MASS)

# analysis of longitudinal count data usinBCg GEE method with Morel et al. covariance estimator
res <- geess(formula = y ~ trt + period + lbase + lage,
             family = poisson, data = epil, id = subject,
             repeated = period, corstr = "unstructured",
             beta.method = "BCGEE", SE.method = "MB")
print(res)

# hypothesis tests for regression coefficients
summary(res)


Square root of nonsymmetric matrix

Description

sqrtmat is used to calculate the square root of E_i - H_{ii}, which is an adjustment factor in Kauermann and Carroll-type method.

Usage

sqrtmat(M)

Arguments

M

Square matrix whose square root is to be computed.

Value

The square root of M

References

Kauermann, G. and Carroll, R. J. (2001). A note on the efficiency of sandwich covariance matrix estimation. Journal of the American Statistical Association, 96, 1387–1396, doi:10.1198/016214501753382309.