Fit a GEE Model
(list)
see vars_gee().
(data.frame)
input data.
(string)
choice of regression model.
(string)
assumed correlation structure.
Object of class tern_gee as well as specific to the kind of regression
which was used.
The correlation structure can be:
unstructured: No constraints are placed on the correlations.
toeplitz: Assumes a banded correlation structure, i.e. the correlation
between two time points depends on the distance between the time indices.
compound symmetry: Constant correlation between all time points.
auto-regressive: Auto-regressive order 1 correlation matrix.
df <- fev_data
df$AVAL <- as.integer(fev_data$FEV1 > 30)
fit_gee(vars = vars_gee(arm = "ARMCD"), data = df)
#> Registered S3 methods overwritten by 'geeasy':
#> method from
#> drop1.geeglm MESS
#> drop1.geem MESS
#> plot.geeglm geepack
#>
#> Call:
#> geeasy::geelm(formula = formula, id = .id, waves = .waves, data = data,
#> family = family$object, corstr = cor_details$str, Mv = cor_details$mv,
#> control = family$control)
#>
#> Coefficients:
#> (Intercept) ARMCDTRT
#> 2.0299313 0.7809108
#>
#> Degrees of Freedom: 537 Total (i.e. Null); 535 Residual
#>
#> Scale is fixed.
#>
#> Correlation: Structure = unstructured Link = identity
#> Estimated Correlation Parameters:
#> [1] -0.032895921 -0.125407448 0.061961011 -0.030311479 -0.056769956
#> [6] 0.004383759
#>
#> Number of clusters: 197 Maximum cluster size: 4
#>
fit_gee(vars = vars_gee(arm = "ARMCD"), data = df, cor_struct = "compound symmetry")
#>
#> Call:
#> geeasy::geelm(formula = formula, id = .id, waves = .waves, data = data,
#> family = family$object, corstr = cor_details$str, Mv = cor_details$mv,
#> control = family$control)
#>
#> Coefficients:
#> (Intercept) ARMCDTRT
#> 2.0643073 0.8111855
#>
#> Degrees of Freedom: 537 Total (i.e. Null); 535 Residual
#>
#> Scale is fixed.
#>
#> Correlation: Structure = exchangeable Link = identity
#> Estimated Correlation Parameters:
#> [1] -0.03263465
#>
#> Number of clusters: 197 Maximum cluster size: 4
#>