gee_di: Fit generalized estimating equation models for disease...

View source: R/gee_di.R

gee_diR Documentation

Fit generalized estimating equation models for disease intensity

Description

Fits generalized estimating equation (GEE) models to angular-transformed disease intensity. Compares a model without treatment-by-time interactions against a model including these interactions. Supports single-factor and factorial experimental designs.

Usage

gee_di(
  data_longo,
  corstr = c("ar1", "exchangeable", "independence", "unstructured"),
  do_anova = TRUE,
  factors = "trat"
)

Arguments

data_longo

Long-format data frame with time, DI, DI_clip, DI_ang, and columns named in factors. Must also contain unit or block to identify experimental units.

corstr

Working correlation structure: "ar1", "exchangeable", "independence", or "unstructured".

do_anova

If TRUE, compares treatment-by-time interactions. When the standard model comparison is unavailable, uses the package's Wald test.

factors

Character vector naming treatment-factor columns. The default "trat" preserves the single-factor interface. For factorial designs, for example, use c("cultivar", "produto").

Details

The experimental unit is identified by unit; if absent, it is derived from block and the combination of factors specified in factors.

Value

Invisibly returns a list containing gee0 (model without treatment-by-time interactions), gee1 (model with interactions), comp (comparison result when do_anova = TRUE, otherwise NULL), and predictions (prediction grid). When Wald inference is numerically unreliable, such as under near-zero dispersion, its statistic and p-value may be returned as NA rather than a spurious inference.


infectionIndex documentation built on Dec. 4, 2026, 5:10 p.m.