Learn R Programming

⚠️There's a newer version (1.1.0) of this package.Take me there.

packDAMipd

"packDAMipd" is a package that allows to do decision analysis using Markov model. It allows estimating incremental cost effectiveness ratio and net monetary benefit for the strategies that you are trying to compare. For the Markov modelling, the parameters like transition probabilities, costs and qualys can be given either directly, or in a data file or the package will estimate the parameter using regression models. In such instances, the individual patient level data should be provided. This also allows estimating the qalys using a package in CRAN "valueEQ5D". Moreover to cost effectiveness analysis, the package can also be used to estimate the sensitivity analysis, both deterministic and probabilistic sensitivity analysis.

Usage

See the User Guide Vignette for examples on using the package.

For a simple toy model please see toy_model.R

Installation

You can install the released version from CRAN with the command:

install.packages("packDAMipd")

Alternatively, the latest release can be installed from www.github.com/sheejamk/packDAMipd

Copy Link

Version

Install

install.packages('packDAMipd')

Monthly Downloads

60

Version

0.2.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Sheeja Manchira Krishnan

Last Published

February 19th, 2021

Functions in packDAMipd (0.2.0)

check_link_glm

Function to find the keyword for family of distribution in glm
eval_assign_trans_prob

Attribute parameters to probabilities of transition matrix
check_list_markov_models

check the list of Markov models
check_values_states

Check if the values of health states are provided
check_treatment_arm

Function to return treatment arm
encode_codes_data

Function to get the codes and the corresponding entries
get_age_details

Function to get the details of the age column
convert_wtpertimediff_basis

Convert weight per time to given basis
cost_data

cost matrix
convert_freq_diff_basis

Convert frequency medication to given basis
blank

Parameter table created
convert_to_given_timeperiod

Convert period to given basis
use_generalised_linear_mixed_model

Function for generalised linear mixed model
adl_scoring

adl_scoring table
assign_parameters

Function to assign the values of nested parameters from the parameter list
get_slope_intercept_cross

help function to keep slope and intercept portion ready in mixed model expression
convert_weight_diff_basis

Convert unit strength to given basis
value_ADL_scores_IPD

Function to convert ADL scores to a T score
calculate_icer_nmb

Estimation of ICER and NMB
convert_volume_basis

Convert volume to given basis
define_parameters_sens_anal

Define parameter lists for deterministic sensitivity analysis
combine_markov

Join Markov model objects
get_mean_sd_age

Function to return mean age from a data frame
get_slope_intercept

help function to keep slope and intercept portion ready in mixed model expression
combine_state

Join health states
check_estimate_required_params

Function to check if the parameters are sufficient to define a distribution and if not see if we can estimate the parameters from the given parameters, e.g. for gamma distribution, shape and rate can be estimated from mean and sd
costing_inpatient_daycase_admission

Function to estimate the cost of inpatient admission but taken from GP records where HRG code or description known
get_outcome_details

Function to get the details of the outcome column
eval_assign_values_states

Attribute values in health states
get_col_multiple_pattern

Function to get cols for the pattern given
plot_dsa_nmb_range

Function to do some checks before plotting sensitivity analysis results
costing_AandE_admission

Function to estimate the cost of inpatient admission but taken from GP records where code or description known
define_transition_table

Define the table for transition
get_extension_file

Function to get extension of a file name
do_diagnostic_glm

Do the diagnostic test for glm model assumption
form_expression_lm

Form expression to use with lm()
form_expression_mixed_model_lme4

Form expression to use with mixed models
define_parameters

Function to return a list of parameters given
checks_markov_pick_method

Checks the input to run the Markov cycles and picks correct method
find_glm_distribution

Function to find the keyword for family of distribution in glm
checks_plot_dsa

Function to do some checks before plotting sensitivity analysis results
check_estimate_substitute_proper_params

####################################################################### Function to get the expression, analyse it for what distribution it is, then check if it has all parameters requires, if not estimate the required parameters from given parameters, and substitute it for actual expression that can be used with R stats package
check_null_na

Function to check the variable null or NA
define_parameters_psa

Define parameter lists for deterministic sensitivity analysis
get_name_value_probdistrb_def

Function to return the two parameters from a given expression separated by comma,
check_trans_prob

Check the transition probabilities for numeric values and unity row sum
costing_resource_use

Function to estimate the cost of resource use taken (from IPD)
health_state

Definition of health state class or health state constructor
get_gender_details

Function to get the details of the gender column
get_trial_arm_details

Function to get the details of the trial arm
find_keyword_rand_generation

Function to find the keyword for generating random numbers the distribution
plot_efficiency_frontier

Plot efficiency frontier
return_equal_liststring_col

Function to get the subset of data compared to a string after trimming the white spaces
do_diagnostic_linear_regression

Do the diagnostic test for lm model assumption
plot_model

E1. Plot a Markov model
generate_wt_time_units

Function to get the weight and time units
generate_wt_vol_units

Function to get the weight and volume units
get_cost_ip_dc_hrg

Function to extract the unit hospital inpatient admission by matching HRG code
get_var_state

Get the attribute for the health state
return_equal_liststring_listcol

Function to get the subset of data compared to a string after trimming the white spaces
transition_cost_util

Create the the values of cost and utility while transition
plot_prediction_parametric_survival

Plot the predicted survival curves for covariates keeping the others fixed
get_parameter_estimated_regression

Get the parameter values using the provided statistical regression methods
plot_ceac

Plot cost effectiveness acceptability curve
list_paramwise_psa_result

Function to list probabilistic sensitivity analysis results parameterwise
plot_dsa

Function to plot results of sensitivity analysis do_sensitivity_analysis()
keep_results_plot_dsa

Function to do some checks before plotting sensitivity analysis results
get_eq5d_details

Function to get the details of the EQ5D column
find_keyword_regression_method

Function to find the keyword for regression methods
get_parameter_read

Get the parameter values from reading a file
trial_data

Example trial data
plot_return_residual_cox

Plotting and return the residuals after cox proportional hazard model
use_parametric_survival

########################################################################### Get the parameter values using the survival analysis parametric survival
find_survreg_distribution

Function to find the keyword for survreg distribution
value_eq5d3L_IPD

Function to add EQ5D3L scores to IPD data
create_new_dataset

create new dataset while keeping cox regression results and returned coefficients
do_psa

Function to do probabilistic sensitivity analysis
use_linear_mixed_model

Function for mixed effect regression
return_equal_str_col

Function to get the subset of data compared to a string after trimming the white spaces
use_linear_regression

########################################################################### Get the parameter values using the linear regression
set_var_state

Set the attribute for the health state
find_parameters_btn_operators

Function to return parameters with in a expression containing operators
do_sensitivity_analysis

Function to do deterministic sensitivity analysis
find_required_parameter_combs

Function to find the parameters that determine the probability distribution
get_cost_AandE_description

Function to extract the unit cost by descirption of AandE att matching description
get_colnames_codedvalues

Function to keep the column name, coded values and non response code into a dataframe
form_expression_glm

Form expression to use with glm()
get_parameter_def_distribution

Get the definition of given parameter distribution defined in a file
load_trial_data

Function to load the file containing trial data and return it
get_parameter_direct

Get the parameter values from reading a file
get_cost_AandE_code

Function to extract the unit hospital inpatient admission by matching code
make_string_covariates

Make a string of covariates using addition sign
plot_dsa_difference

Function to do some checks before plotting sensitivity analysis results
get_cost_ip_dc_description

Function to extract the unit hospital inpatient admission by matching description
get_slope_intercept_nested

help function to keep slope and intercept portion ready in mixed model expression
get_timepoint_details

Function to get the details of the time point column
map_eq5d5Lto3L_VanHout

Function to map EQ5D5L scores to EQ5D3L scores and then add to IPD data
get_mortality_from_file

Get the mortality rate values from reading a file
microcosting_liquids_long

Function to estimate the cost of liquids when IPD is in long format
plot_survival_cox_covariates

Plotting survival function for all covariates calculated from cox regression results and returned coefficients
init_trace

Define an all zero trace matrix
strategy

Definition of strategy - or arm
microcosting_liquids_wide

Function to estimate the cost of liquids taken (from IPD)
plot_dsa_icer_range

Function to do some checks before plotting sensitivity analysis results
use_generalised_linear_model

############################################################################ Get the parameter values using logistic regression
populate_transition_matrix

Populate transition matrix
use_seemingly_unrelated_regression

Bivariate regression for correlated observations
microcosting_tablets_long

Function to estimate the cost of tablets when IPD is in long format
report_sensitivity_analysis

Function to report deterministic sensitivity analysis
use_coxph_survival

########################################################################### Get the parameter values using the survival analysis using cox proportional hazard
summary_plot_psa

Function to summarise and plot probabilistic sensitivity analysis
markov_model

Definition of Markov model and trace
use_fh2_survival

############################################################################ Get the parameter values using the survival analysis using FH2 method
plot_dsa_others_range

Function to do some checks before plotting sensitivity analysis results
microcosting_patches_wide

Function to estimate the cost of patches taken (from IPD)
microcosting_patches_long

#'########################################################################### Function to estimate the cost of patches when IPD is in long format using a IPD data of long format
plot_return_residual_survival

Plotting and return the residuals after survival model
plot_return_survival_curve

Plotting survival function for all covariates using survfit
predict_coxph

Predict risk/hazard function for cox ph regression
value_Shows_IPD

Function to estimate the cost of tablets taken (from IPD)
use_km_survival

########################################################################### Get the parameter values using the Kaplan-Meier survival analysis
return0_if_not_null_na

Function to return 0 if the param is not null or NA trimming the white spaces
microcosting_tablets_wide

Function to estimate the cost of tablets taken (from IPD)
prediction_regression

Do the prediction for regression
use_fh_survival

########################################################################### Get the parameter values using the survival analysis method FH
table_param

Parameter table created
word2num

Function to check the variable null or NA
value_eq5d5L_IPD

Function to add EQ5D5L scores to IPD data
use_survival_analysis

############################################################################ Get the parameter values using the survival analysis
trace_data

Trace matrix
utility_data

utility matrix