Holds one Firth logistic regression fit (logistf) per subject, modelling whether a protein is detected in a sample,
with the model table in models$model_df. Contrasts are computed from it with ContrastsFirth.
See also
Other modelling:
AnovaExtractor,
Contrasts,
ContrastsComparison,
ContrastsDEqMSFacade,
ContrastsDEqMSVoomFacade,
ContrastsFacadeBase,
ContrastsFirth,
ContrastsFirthFacade,
ContrastsHurdleFacade,
ContrastsHurdleNestedFacade,
ContrastsLMFacade,
ContrastsLMImputeFacade,
ContrastsLimma,
ContrastsLimmaFacade,
ContrastsLimmaImputeFacade,
ContrastsLimmaVoomFacade,
ContrastsLimmaVoomImputeFacade,
ContrastsLimpaFacade,
ContrastsLimpaNestedFacade,
ContrastsLmerNestedFacade,
ContrastsModerated,
ContrastsModeratedDEqMS,
ContrastsPlotter,
ContrastsRLMFacade,
ContrastsROPECA,
ContrastsROPECANestedFacade,
ContrastsROPECAV2,
ContrastsROPECAV2NestedFacade,
ContrastsRfitFacade,
ContrastsRfitImputeFacade,
ContrastsTable,
INTERNAL_FUNCTIONS_BY_FAMILY,
Model,
ModelLimma,
StrategyLM,
StrategyLimma,
StrategyLimpa,
StrategyLmer,
StrategyLogistf,
StrategyRLM,
StrategyRfit,
build_contrast_analysis(),
build_model(),
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(),
compute_borrowed_variance(),
compute_borrowed_variance_limma(),
df.residual.rfit_prolfqua(),
group_label(),
impute_from_model(),
impute_refit_singular(),
list_facades(),
lookup_facade(),
lr_test(),
merge_contrasts_results(),
new_imputed_model(),
nobs.rfit_prolfqua(),
pivot_model_contrasts_to_wide(),
prolfqua_analysis_methods,
register_facade(),
sigma.rfit_prolfqua(),
strategy_limma(),
strategy_limpa(),
strategy_logistf(),
vcov.rfit_prolfqua()
Super class
ModelInterface -> ModelFirth
Public fields
modelslist with
model_df, one fitted model per subject, and thestrategymodel_namename of model
subject_ide.g. protein_Id
p.adjustfunction to adjust p-values
Methods
ModelFirth$new()
initialize
Usage
ModelFirth$new(
models,
model_name = "modelFirth",
subject_id = "protein_Id",
p.adjust = prolfqua::adjust_p_values
)Examples
istar <- prolfqua::sim_lfq_data_protein_config(n_proteins = 10, with_missing = TRUE,
weight_missing = 0.5, seed = 3)
#> `protein_Id`: columns `proteinID`, `idtype2` united with separator '~'.
#> creating sampleName from file_name column
#> setup_analysis: dropped 5 unconfigured columns: average_prot_abundance, sd, mean, N, Replicate.
#> setup_analysis: added 23 rows with NA response for feature and sample combinations absent from the input.
mod <- build_model_glm_protein(LFQData$new(istar$data, istar$config), "~ group_")
tmp <- mod$get_coefficients()
stopifnot(nrow(tmp) == 30)
mod$coef_histogram()
#> $plot
#>
#> $name
#> [1] "Coef_Histogram_modelFirth.pdf"
#>
mod$coef_pairs()
#> $plot
#> # A tibble: 10 × 4
#> subject_id `(Intercept)` group_B group_Ctrl
#> <chr> <dbl> <dbl> <dbl>
#> 1 7IZdVV~0841 2.20 9.70e-16 -2.20e+ 0
#> 2 AZPG26~2091 2.20 1.26e-15 -4.27e-16
#> 3 AoNKbb~6908 2.20 -1.69e-16 -1.35e+ 0
#> 4 EnbuYk~0350 0.847 -8.47e- 1 4.14e-16
#> 5 JnEDsz~4938 -0.847 -1.35e+ 0 -4.18e-17
#> 6 NNASGK~1417 2.20 1.26e-15 -4.27e-16
#> 7 XYrp6h~5793 2.20 1.26e-15 -4.27e-16
#> 8 quTD7H~4566 2.20 -1.35e+ 0 -2.20e+ 0
#> 9 tCZCHm~6695 2.20 -1.35e+ 0 -2.16e-15
#> 10 tHE075~8231 0.847 1.35e+ 0 1.59e-16
#>
#> $name
#> [1] "Coef_Pairsplot_modelFirth.pdf"
#>
mod$get_anova()
#> Warning: `get_anova()` is not implemented for Firth models; returning `NULL`.
#> NULL
mod$coef_volcano()
#> $plot
#>
#> $name
#> [1] "Coef_volcano_plot_modelFirth.pdf"
#>
mod$anova_histogram()
#> Warning: `anova_histogram()` is not implemented for Firth models; returning `NULL`.
#> NULL