EstimatingEquationsRegression.AR1Cor
— TypeAR1Cor <: CorStruct
Type that represents a GEE working correlation structure in which the observations within a group are modeled as being serially correlated according to their order in the dataset, with the correlation between two observations that are j positions apart being r^j
for a real parameter r
that can be estimated from the data.
EstimatingEquationsRegression.ExchangeableCor
— TypeExchangeableCor <: CorStruct
Type that represents a GEE working correlation structure in which the observations within a group are modeled as exchangeably correlated. Any two observations in a group have the same correlation between them, which can be estimated from the data.
EstimatingEquationsRegression.GEECov
— TypeGEECov
Covariance matrices for the parameter estimates.
EstimatingEquationsRegression.GEEE
— TypeGEEE
Fit expectile regression models using GEE.
EstimatingEquationsRegression.GEEEResp
— TypeGEEEResp
The response vector and group labels for GEE expectile analysis.
EstimatingEquationsRegression.GEEResp
— TypeGEEResp
The response vector, grouping information, and vectors derived from the response. Vectors here are all n-dimensional.
EstimatingEquationsRegression.GEEprop
— TypeGEEprop
Properties that define a GLM fit using GEE - link, distribution, and working correlation structure.
EstimatingEquationsRegression.GeneralizedEstimatingEquationsModel
— TypeGeneralizedEstimatingEquationsModel <: AbstractGEE
Type representing a GLM to be fit using generalized estimating equations (GEE).
EstimatingEquationsRegression.IndependenceCor
— TypeIndependenceCor <: CorStruct
Type that represents a GEE working correlation structure in which the observations within a group are modeled as being independent.
EstimatingEquationsRegression.OrdinalIndependenceCor
— TypeOrdinalIndependenceCor <: CorStruct
Type that represents a GEE working correlation structure in which the ordinal observations within a group are modeled as being independent. Each ordinal observation is converted to a set of binary indicators, and the indicators derived from a common ordinal value are modeled as correlated, with the correlations determined from the marginal means.
EstimatingEquationsRegression.QIF
— TypeQIF
Quadratic Inference Function (QIF) is an approach to fitting marginal regression models with correlated data.
EstimatingEquationsRegression.QIFBasis
— TypeQIFBasis
A basis matrix for representing the inverse working correlation matrix.
EstimatingEquationsRegression.QIFLinPred
— TypeQIFLinPred
Represent a design matrix for QIF analysis. The design matrix is stored with the variables as rows and the observations as columns.
EstimatingEquationsRegression.QIFResp
— TypeQIFResp
n-dimensional vectors related to the QIF response variable.
EstimatingEquationsRegression.corparams
— Methodcorparams(m::AbstractGEE)
Return the parameters that define the working correlation structure.
EstimatingEquationsRegression.expand_ordinal
— Methodexpand_ordinal(df, response; response_recoded, var_id, level_var)
Construct a dataframe from source df
that converts an ordinal variable into a series of binary indicators. These indicators can then be modeled using binomial GEE with the OrdinalIndependenceCor
working correlation structure.
response
must be a column name in df
containing an ordinal variable. For each threshold t
in the unique values of this variable an indicator that the value of the variable is >= t
is created. The smallest unique value in response
is omitted. The recoded variable is called response_recoded
and a default name is created if no name is provided. A variable called var_id
is created that gives a unique integer label for each set of indicators derived from a common observed ordinal value. The threshold value used to create each binary indicator is placed into the variable named level_var
.
EstimatingEquationsRegression.gee
— Methodgee(F, D, args...; kwargs...)
Fit a generalized linear model to data using generalized estimating equations. Alias for fit(GeneralizedEstimatingEquationsModel, ...)
. See fit
for documentation.
EstimatingEquationsRegression.qif
— Methodqif(F, D, args...; kwargs...)
Fit a generalized linear model to data using quadratic inference functions. Alias for fit(QIF, ...)
. See fit
for documentation.
EstimatingEquationsRegression.resid_pearson
— Methodresid_pearson(m::AbstractGEE)
Return the Pearson residuals, which are the observed data minus the mean, divided by the square root of the variance function. The scale parameter is not included so the Pearson residuals should have constant variance but not necessarily unit variance.
EstimatingEquationsRegression.scoretest
— Methodscoretest(model::AbstractGEE, submodel::AbstractGEE)
GEE score test comparing submodel to model. model need not have been fit before calling scoretest.
StatsAPI.fit
— Functionfit(GeneralizedEstimatingEquationsModel, X, y, g, l, v, [c = IndependenceCor()]; <keyword arguments>)
Fit a generalized linear model to data using generalized estimating equations (GEE). This interface emphasizes the "quasi-likelihood" framework for GEE and requires direct specification of the link and variance function, without reference to any distribution/family.
StatsAPI.fit
— Functionfit(GeneralizedEstimatingEquationsModel, X, y, g, d, c, [l = canonicallink(d)]; <keyword arguments>)
Fit a generalized linear model to data using generalized estimating equations. X
and y
can either be a matrix and a vector, respectively, or a formula and a data frame. g
is a vector containing group labels, and elements in a group must be consecutive in the data. d
must be a UnivariateDistribution
, c
must be a CorStruct
and l
must be a Link
, if supplied.
Keyword Arguments
cov_type::String
: Type of covariance estimate for parameters. Defaults
to "robust", other options are "naive", "md" (Mancl-DeRouen debiased) and "kc" (Kauermann-Carroll debiased).xs
dofit::Bool=true
: Determines whether model will be fitwts::Vector=similar(y,0)
: Not implemented.
Can be length 0 to indicate no weighting (default).
offset::Vector=similar(y,0)
: offset added toXβ
to formeta
. Can be of
length 0
verbose::Bool=false
: Display convergence information for each iterationmaxiter::Integer=100
: Maximum number of iterations allowed to achieve convergenceatol::Real=1e-6
: Convergence is achieved when the relative change in
β
is less than max(rtol*dev, atol)
.
rtol::Real=1e-6
: Convergence is achieved when the relative change in
β
is less than max(rtol*dev, atol)
.
start::AbstractVector=nothing
: Starting values for beta. Should have the
same length as the number of columns in the model matrix.
fitcoef::Bool=true
: If false, set the coefficients equal to the GLM coefficients
or to start
if provided, and update the correlation parameters and dispersion without using GEE iterations to update the coefficients.`
fitcor::Bool=true
: If false, hold the correlation parameters equal to their starting
values.
bccor::Bool=true
: If false, do not compute the Kauermann-Carroll and Mancel-DeRouen
covariances.
StatsAPI.predict
— Methodpredict(m::AbstractGEE; type=:linear)
Return the fitted values from the fitted model. If type is :linear returns the linear predictor, if type is :response returns the fitted mean.