diff options
author | Johannes Ranke <johannes.ranke@jrwb.de> | 2025-09-12 22:16:13 +0200 |
---|---|---|
committer | Johannes Ranke <johannes.ranke@jrwb.de> | 2025-09-12 22:16:13 +0200 |
commit | 17af45b984d348505527140470c7fff204748ea6 (patch) | |
tree | 4a7409236626c86e07746f7dfc736745f83a99d6 /inst/rmarkdown/templates | |
parent | 3ae975f6039da0edc3ae6298bcac388e7346e73f (diff) |
Facilitate centering covariates
The motivation for this is to obtain confidence intervals for
covariate dependent parameters that are valid for a median/mean
value of the covariate.
Implementation by adding an argument to the 'saem' function, and
adapting the relevant functions working with 'saem' objects.
Vignettes, the template and tests were updated to use the new functionality.
Diffstat (limited to 'inst/rmarkdown/templates')
-rw-r--r-- | inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd index f0692b4c..f61413ba 100644 --- a/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/hierarchical_kinetics/skeleton/skeleton.Rmd @@ -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) ``` |