Evaluates a linear contrast over the group levels as a linear combination of the
model coefficients. The group-level weights are applied to complete model design
rows evaluated at the covariate reference point, so interactions are included and
the result is independent of the active contrasts coding.
ancova_linear_contrast(weights, beta, vcov_mod, df_res, contrast_design)A list with elements est, se and df.
Numeric weight vector over the group levels (factor order), summing to zero.
Numeric vector of model coefficients.
Variance-covariance matrix of the model coefficients.
Residual degrees of freedom.
Numeric model matrix with one row per group level, evaluated at the covariate reference point, and one column per model coefficient.
The contrast is evaluated at the reference values defined by
ancova_contrast_design(). Finite columns involving only non-group covariates
are identical across group rows and cancel for a sum-to-zero contrast.
Group-by-covariate interaction columns are included when they are non-zero at
that reference point, although ancova() currently rejects such interactions.
A required coefficient that is missing,
aliased (NA) or absent from the
variance-covariance matrix indicates a rank-deficient design and triggers an error
rather than a silently dropped term.