Skip to contents

When options(prolfqua.vectorize = TRUE) is set, dispatches to a vectorized implementation that batch-evaluates all contrast expressions in a single dplyr::mutate() call instead of looping per expression. Set options(prolfqua.vectorize = FALSE) (the default) to use the original per-expression loop.

Usage

linfct_matrix_contrasts(linfct, contrasts, p.message = FALSE)

Arguments

linfct

linear functions as created by linfct_from_model

contrasts

named character vector of contrasts to determine linear functions for

p.message

print messages default FALSE

See also

Other modelling: AnovaExtractor, Contrasts, ContrastsDEqMSFacade, ContrastsDEqMSVoomFacade, ContrastsFirth, ContrastsFirthFacade, ContrastsLMFacade, ContrastsLMImputeFacade, ContrastsLMMissingFacade, ContrastsLimma, ContrastsLimmaFacade, ContrastsLimmaImputeFacade, ContrastsLimmaVoomFacade, ContrastsLimmaVoomImputeFacade, ContrastsLimpaFacade, ContrastsLmerFacade, ContrastsMissing, ContrastsModerated, ContrastsModeratedDEqMS, ContrastsPlotter, ContrastsRLMFacade, ContrastsROPECA, ContrastsROPECAFacade, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, LR_test(), Model, ModelFirth, ModelLimma, StrategyLM, StrategyLimma, StrategyLimpa, StrategyLmer, StrategyLogistf, StrategyRLM, build_contrast_analysis(), build_model(), build_model_glm_peptide(), build_model_glm_protein(), build_model_impute(), build_model_limma(), build_model_limma_impute(), build_model_limma_voom(), build_model_limma_voom_impute(), build_model_limpa(), build_model_logistf(), compute_borrowed_variance(), compute_borrowed_variance_limma(), compute_contrast(), compute_lmer_contrast(), 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(), merge_contrasts_results(), model_analyse(), model_summary(), moderated_p_deqms(), moderated_p_deqms_long(), moderated_p_limma(), moderated_p_limma_long(), new_lm_imputed(), 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_limpa(), strategy_logistf(), summary_ROPECA_median_p.scaled()

Examples


m <- sim_make_model_lm( "factors")
#> creating sampleName from file_name column
#> completing cases
#> completing cases done
#> setup done
Contr <- c("TreatmentA_vs_B" = "TreatmentA - TreatmentB",
    "BackgroundX_vs_Z" = "BackgroundX - BackgroundZ",
    "IntoflintoA" = "`TreatmentA:BackgroundX` - `TreatmentA:BackgroundZ`",
    "IntoflintoB" = "`TreatmentB:BackgroundX` - `TreatmentB:BackgroundZ`",
    "IntoflintoX" = "`TreatmentA:BackgroundX` - `TreatmentB:BackgroundX`",
    "IntoflintoZ" = "`TreatmentA:BackgroundZ` - `TreatmentB:BackgroundZ`",
    "interactXZ" = "IntoflintoX - IntoflintoZ",
    "interactAB" = "IntoflintoA - IntoflintoB"
     )
linfct <- linfct_from_model(m, as_list = FALSE)
x <- linfct_matrix_contrasts(linfct, Contr )
stopifnot(sum(x["interactXZ",]) == 0 )
stopifnot(sum(x["interactAB",]) == 0 )

m <- sim_make_model_lm( "interaction")
#> creating sampleName from file_name column
#> completing cases
#> completing cases done
#> setup done
linfct <- linfct_from_model(m, as_list = FALSE)
x <- linfct_matrix_contrasts(linfct, Contr )
stopifnot(sum(x["interactXZ",]) ==1 )
stopifnot(sum(x["interactAB",]) ==1 )