strategy: Create custom lmer model

strategy_lmerR Documentation

Create custom lmer model

Description

The strategy contains functions to fit the model but also compute the contrasts etc.

The strategy contains functions to fit the model but also compute the contrasts etc.

Usage

strategy_lmer(
  modelstr,
  model_name = "Model",
  report_columns = c("statistic", "p.value", "p.value.adjusted", "moderated.p.value",
    "moderated.p.value.adjusted")
)

strategy_lm(
  modelstr,
  model_name = "Model",
  report_columns = c("statistic", "p.value", "p.value.adjusted", "moderated.p.value",
    "moderated.p.value.adjusted")
)

strategy_rlm(
  modelstr,
  model_name = "Model",
  report_columns = c("statistic", "p.value", "p.value.adjusted", "moderated.p.value",
    "moderated.p.value.adjusted")
)

strategy_glm(
  modelstr,
  model_name = "Model",
  test = "Chisq",
  family = stats::binomial,
  multiplier = 1,
  offset = 1,
  report_columns = c("statistic", "p.value", "p.value.adjusted", "moderated.p.value",
    "moderated.p.value.adjusted")
)

Arguments

modelstr

model formula

model_name

name of model

report_columns

columns to report

family

either binomial or quasibinomial

multiplier

for tuning default is 1.

Value

list with model function, contrast computation function etc.

list with model function, contrast computation function etc.

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(), linfct_matrix_contrasts(), 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(), summary_ROPECA_median_p.scaled()

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(), linfct_matrix_contrasts(), 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(), summary_ROPECA_median_p.scaled()

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(), linfct_matrix_contrasts(), 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(), summary_ROPECA_median_p.scaled()

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(), linfct_matrix_contrasts(), 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(), summary_ROPECA_median_p.scaled()

Examples


istar <- prolfqua::sim_lfq_data_peptide_config(Nprot = 10, with_missing = FALSE)
istar <- prolfqua::LFQData$new(istar$data,istar$config)
istar$data <- istar$data |> dplyr::group_by(protein_Id) |>
dplyr::mutate(abundanceC = abundance - mean(abundance)) |> dplyr::ungroup()
istar$factors()
modelFunction <- strategy_lmer("abundanceC ~ group_ + (1|peptide_Id) ", model_name = "random_example")
mod <- build_model(
 istar,
 modelFunction)
sum(mod$modelDF$exists_lmer)
sum(mod$modelDF$isSingular, na.rm=TRUE)



tmp <- strategy_lm("Intensity ~ condition", model_name = "parallel design")
tmp$model_fun(get_formula = TRUE)
tmp$isSingular
tmp <- strategy_rlm("Intensity ~ condition", model_name = "parallel design")
tmp$model_fun(get_formula = TRUE)
tmp$isSingular
tmp <- strategy_glm("Intensity ~ condition", model_name = "parallel design")
tmp$model_fun(get_formula = TRUE)
tmp$isSingular

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