linfct_matrix_contrasts: linfct_matrix_contrasts

View source: R/tidyMS_R6_Modelling.R

linfct_matrix_contrastsR Documentation

linfct_matrix_contrasts

Description

linfct_matrix_contrasts

Usage

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

Arguments

linfct

linear functions as created by linfct_from_model

p.message

print messages default FALSE

contrast

contrasts to determine linear functions for

See Also

Other modelling: Contrasts, ContrastsMissing, ContrastsModerated, ContrastsPlotter, ContrastsProDA, ContrastsROPECA, ContrastsTable, INTERNAL_FUNCTIONS_BY_FAMILY, LR_test(), Model, build_model(), build_models(), contrasts_fisher_exact(), get_anova_df(), get_complete_model_fit(), get_p_values_pbeta(), isSingular_lm(), linfct_all_possible_contrasts(), linfct_factors_contrasts(), linfct_from_model(), make_model(), merge_contrasts_results(), model_analyse(), model_summary(), moderated_p_limma(), moderated_p_limma_long(), my_contest(), my_contrast(), my_contrast_V1(), my_contrast_V2(), my_glht(), pivot_model_contrasts_2_Wide(), plot_lmer_model_and_data(), plot_lmer_peptide_noRandom(), plot_lmer_peptide_predictions(), plot_lmer_predicted_interactions(), strategy_lmer(), summary_ROPECA_median_p.scaled()

Examples


m <- make_model( "factors")
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 <- make_model( "interaction")
linfct <- linfct_from_model(m, as_list = FALSE)
x<- linfct_matrix_contrasts(linfct, Contr )
stopifnot(sum(x["interactXZ",]) ==1 )
stopifnot(sum(x["interactAB",]) ==1 )

wolski/prolfqua documentation built on May 12, 2024, 10:16 p.m.