Learn R Programming

predRupdate

The goal of predRupdate is to provide a suite of functions for validating a existing (i.e. previously developed) prediction/ prognostic model, and for applying model updating methods to said model, according to an available dataset.

Installation

The package can be installed from CRAN as follows:

install.packages("predRupdate")

Development version

You can install the development version of predRupdate from GitHub with::

# install.packages("devtools")
devtools::install_github("GlenMartin31/predRupdate")

Example

One main use of this package is to externally validate an existing (previously developed) prediction model. This can be achieved with the following code:

# create a data.frame of the model coefficients, with columns being variables
coefs_table <- data.frame("Intercept" = -3.4,
                          "SexM" = 0.306,
                          "Smoking_Status" = 0.628,
                          "Diabetes" = 0.499,
                          "Creatinine" = 0.538)

#pass this into pred_input_info()
Existing_Logistic_Model <- pred_input_info(model_type = "logistic",
                                           model_info = coefs_table)
summary(Existing_Logistic_Model)

#validate this model against an available dataset
pred_validate(x = Existing_Logistic_Model,
              new_data = SYNPM$ValidationData,
              binary_outcome = "Y")

Getting help

If you encounter a bug, please file an issue with a minimal reproducible example on GitHub.

Copy Link

Version

Install

install.packages('predRupdate')

Monthly Downloads

212

Version

0.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Glen P. Martin

Last Published

August 23rd, 2024

Functions in predRupdate (0.2.0)

pred_update

Perform Model Updating on an Existing Prediction Model
SYNPM

SYNthetic Prediction Models (SYNPM) and Validation dataset
dummy_vars

Create dummy variables for all categorical/factor variables in a data.frame
map_newdata

Map new data to a predinfo object
inv_logit

Apply the inverse logit function to an input
logit

Apply a logit transformation to an input
pred_stacked_regression

Perform Stacked Regression on Existing Prediction Models
pred_predict

Make predictions from an existing prediction model
pred_input_info

Input information about an existing prediction model
predRupdate-package

predRupdate: Prediction Model Validation and Updating
pred_val_probs

Validate Predicted Probabilities
pred_validate

Validate an existing prediction