diff options
Diffstat (limited to 'inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd')
| -rw-r--r-- | inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd index a77908cb..f61413ba 100644 --- a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd @@ -122,7 +122,7 @@ From the refined fits, the most suitable model is selected using the AIC. ```{r parent-best, dependson = "parent-mhmkin"} aic_parent <- AIC(parent_mhmkin_refined) -min_aic <- which(aic_parent == min(aic_parent), arr.ind = TRUE) +min_aic <- which(aic_parent == min(aic_parent, na.rm = TRUE), arr.ind = TRUE) best_degmod_parent <- rownames(aic_parent)[min_aic[1]] best_errmod_parent <- colnames(aic_parent)[min_aic[2]] anova(parent_mhmkin_refined) |> kable(digits = 1) @@ -157,11 +157,12 @@ models for both of them is fitted. ```{r parent-best-pH} parent_best_pH_1 <- update(parent_best, covariates = covariates, - covariate_models = list(log_k_lambda_free ~ pH)) + covariate_models = list(log_k_lambda_free ~ pH), center_covariates = "median") parent_best_pH_2 <- update(parent_best, covariates = covariates, - covariate_models = list(log_k_lambda_bound_free ~ pH)) + covariate_models = list(log_k_lambda_bound_free ~ pH), center_covariates = "median") parent_best_pH_3 <- update(parent_best, covariates = covariates, - covariate_models = list(log_k_lambda_free ~ pH, log_k_lambda_bound_free ~ pH)) + covariate_models = list(log_k_lambda_free ~ pH, log_k_lambda_bound_free ~ pH), + center_covariates = "median") ``` The resulting models are compared. @@ -244,6 +245,7 @@ model that was identified for the parent degradation, are attempted below. path_1 <- mhmkin(list(sforb_sep_const, sforb_sep_tc), no_random_effect = c("lambda_free_0", "log_k_lambda_free_bound"), covariates = covariates, covariate_models = list(log_k_lambda_bound_free ~ pH), + center_covariates = "median", cluster = cl_path) ``` @@ -297,6 +299,12 @@ are shown below. endpoints(path_1_refined) ``` +We can also show endpoints corresponding to a user defined pH value. + +```{r dependson = "parent-best-pH"} +endpoints(path_1_refined, covariates = c(pH = 7)) +``` + ```{r} if (!is.null(cl_path)) stopCluster(cl_path) ``` |
