Wraps an lm object with borrowed covariance information. S3 generics vcov(), sigma(), and df.residual() dispatch to the borrowed values instead of the original model's.
See also
Other modelling:
AnovaExtractor,
Contrasts,
ContrastsDEqMSFacade,
ContrastsFirth,
ContrastsFirthFacade,
ContrastsLMFacade,
ContrastsLMImputeFacade,
ContrastsLMMissingFacade,
ContrastsLimma,
ContrastsLimmaFacade,
ContrastsLmerFacade,
ContrastsMissing,
ContrastsModerated,
ContrastsModeratedDEqMS,
ContrastsPlotter,
ContrastsRLMFacade,
ContrastsROPECA,
ContrastsROPECAFacade,
ContrastsTable,
INTERNAL_FUNCTIONS_BY_FAMILY,
LR_test(),
Model,
ModelFirth,
ModelLimma,
StrategyLM,
StrategyLimma,
StrategyLmer,
StrategyLogistf,
StrategyRLM,
build_contrast_analysis(),
build_model(),
build_model_glm_peptide(),
build_model_glm_protein(),
build_model_impute(),
build_model_limma(),
build_model_logistf(),
compute_borrowed_variance(),
contrasts_fisher_exact(),
get_anova_df(),
get_complete_model_fit(),
get_p_values_pbeta(),
group_label(),
impute_refit_singular(),
isSingular_lm(),
linfct_all_possible_contrasts(),
linfct_factors_contrasts(),
linfct_from_model(),
linfct_matrix_contrasts(),
merge_contrasts_results(),
model_analyse(),
model_summary(),
moderated_p_deqms(),
moderated_p_deqms_long(),
moderated_p_limma(),
moderated_p_limma_long(),
my_contest(),
my_contrast(),
my_contrast_V2(),
pivot_model_contrasts_2_Wide(),
plot_lmer_peptide_predictions(),
sim_build_models_lm(),
sim_build_models_lmer(),
sim_build_models_logistf(),
sim_make_model_lm(),
sim_make_model_lmer(),
strategy_limma(),
strategy_logistf(),
summary_ROPECA_median_p.scaled()
Examples
# Fit a normal lm, then wrap it with borrowed covariance
dat <- data.frame(group_ = rep(c("A", "B"), each = 4),
y = c(20.1, 20.5, 19.8, 20.3, 22.1, 22.4, 21.9, 22.2))
fit <- lm(y ~ group_, data = dat)
# Wrap with borrowed variance (in practice these come from donor pool)
wrapped <- prolfqua:::new_lm_imputed(fit,
borrowed_vcov = vcov(fit),
borrowed_sigma = 0.8,
borrowed_df = 6,
n_observed = 5)
# S3 dispatch returns borrowed values
stopifnot(inherits(wrapped, "lm_imputed"))
stopifnot(sigma(wrapped) == 0.8)
stopifnot(df.residual(wrapped) == 6)
# coefficients() still dispatches to underlying lm
stopifnot(identical(coefficients(wrapped), coefficients(fit)))