Package: packDAMipd 1.1.0

Sheeja Manchira Krishnan

packDAMipd: Decision Analysis Modelling Package with Parameters Estimation Ability from Individual Patient Level Data

A collection of functions to construct Markov model for model-based cost-effectiveness analysis. This includes creating Markov model (both time homogenous and time dependent models), decision analysis, sensitivity analysis (deterministic and probabilistic). The package allows estimation of parameters for the Markov model from a given individual patient level data, provided the data file follows some standard data entry rules.

Authors:Sheeja Manchira Krishnan [aut, cre]

packDAMipd_1.1.0.tar.gz
packDAMipd_1.1.0.zip(r-4.5)packDAMipd_1.1.0.zip(r-4.4)packDAMipd_1.1.0.zip(r-4.3)
packDAMipd_1.1.0.tgz(r-4.4-any)packDAMipd_1.1.0.tgz(r-4.3-any)
packDAMipd_1.1.0.tar.gz(r-4.5-noble)packDAMipd_1.1.0.tar.gz(r-4.4-noble)
packDAMipd_1.1.0.tgz(r-4.4-emscripten)packDAMipd_1.1.0.tgz(r-4.3-emscripten)
packDAMipd.pdf |packDAMipd.html
packDAMipd/json (API)

# Install 'packDAMipd' in R:
install.packages('packDAMipd', repos = c('https://cranhaven.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/sheejamk/packdamipd/issues

Datasets:

On CRAN:

archivedpackagesr-universe

146 exports 5 stars 0.82 score 199 dependencies 25 scripts 228 downloads

Last updated 29 days agofrom:3e3dfebe8f (on package/packDAMipd). Checks:OK: 1 ERROR: 6. Indexed: no.

TargetResultDate
Doc / VignettesOKAug 19 2024
R-4.5-winERRORAug 19 2024
R-4.5-linuxERRORAug 19 2024
R-4.4-winERRORAug 19 2024
R-4.4-macERRORAug 19 2024
R-4.3-winERRORAug 19 2024
R-4.3-macERRORAug 19 2024

Exports:add_entries_sameuse_timepointassign_parameterscalculate_icer_nmbcheck_equal_columncontents_NAomittedcheck_equal_sumcolumncontents_NAomittedcheck_estimate_required_paramscheck_estimate_substitute_proper_paramscheck_link_glmcheck_list_markov_modelscheck_null_nacheck_trans_probcheck_treatment_armcheck_values_stateschecks_markov_pick_methodcombine_markovcombine_stateconvert_freq_diff_basisconvert_to_given_timeperiodconvert_volume_basisconvert_weight_diff_basisconvert_wtpertimediff_basisconvert_wtpervoldiff_basiscosting_AandE_admissioncosting_inpatient_daycase_admissioncosting_opioid_liquids_averageMED_longcosting_opioid_liquids_averageMED_widecosting_opioid_patches_averageMED_longcosting_opioid_patches_averageMED_widecosting_opioid_tablets_averageMED_longcosting_opioid_tablets_averageMED_widecosting_opioid_tablets_MED_widecosting_resource_usecreate_new_datasetcreate_shorttable_from_gtsummary_compare_twogroups_timpointscreate_table_from_gtsummary_compare_twogroupsdefine_parametersdefine_parameters_psadefine_parameters_sens_analdefine_transition_tabledo_diagnostic_glmdo_diagnostic_linear_regressiondo_psado_sensitivity_analysisencode_codes_dataeval_assign_trans_probeval_assign_values_statesfind_glm_distributionfind_keyword_rand_generationfind_keyword_regression_methodfind_parameters_btn_operatorsfind_required_parameter_combsfind_rowwise_sum_multiplecolfind_survreg_distributionform_expression_glmform_expression_lmform_expression_mixed_model_lme4generate_wt_time_unitsgenerate_wt_vol_unitsget_age_detailsget_colnames_codedvaluesget_cost_AandE_codeget_cost_AandE_descriptionget_cost_ip_dc_descriptionget_cost_ip_dc_hrgget_doses_combinationget_doses_combination_unitsget_eq5d_detailsget_extension_fileget_gender_detailsget_mean_sd_ageget_mortality_from_fileget_name_value_probdistrb_defget_outcome_detailsget_parameter_def_distributionget_parameter_directget_parameter_estimated_regressionget_parameter_readget_single_col_multiple_patternget_slope_interceptget_slope_intercept_crossget_slope_intercept_nestedget_timepoint_detailsget_trial_arm_detailsget_var_statehealth_stateinit_traceinit_trace_sjtimekeep_results_plot_dsalist_paramwise_psa_resultload_trial_datamake_string_covariatesmap_eq5d5Lto3L_VanHoutmap_resource_use_categoriesmarkov_modelmarkov_model_sojourntimemicrocosting_liquids_longmicrocosting_liquids_widemicrocosting_patches_longmicrocosting_patches_widemicrocosting_tablets_longmicrocosting_tablets_wideplot_ceac_psaplot_dsaplot_dsa_differenceplot_dsa_icer_rangeplot_dsa_nmb_rangeplot_dsa_others_rangeplot_efficiency_frontierplot_histogram_onetimepoint_twogroupsplot_meanSE_longitudinal_twogroupsplot_modelplot_nmb_lambdaplot_prediction_parametric_survivalplot_return_residual_coxplot_return_residual_survivalplot_return_survival_curveplot_survival_cox_covariatespopulate_transition_matrixpredict_coxphprediction_regressionreport_sensitivity_analysisreturn_equal_liststring_colreturn_equal_liststring_listcolreturn_equal_str_colreturn0_if_not_null_naset_var_statestrategysummary_plot_psatransition_cost_utiluse_coxph_survivaluse_fh_survivaluse_fh2_survivaluse_generalised_linear_mixed_modeluse_generalised_linear_modeluse_km_survivaluse_linear_mixed_modeluse_linear_regressionuse_parametric_survivaluse_seemingly_unrelated_regressionuse_survival_analysisvalue_ADL_scores_IPDvalue_eq5d3L_IPDvalue_eq5d5L_IPDvalue_promis3a_scores_IPDvalue_Shows_IPDword2num

Dependencies:abindarmaskpassbackportsbase64encbigDbitbit64bitopsbootbriobroombslibcachemcallrcarcarDatacardscellrangerclicliprcodacolorspacecommonmarkcorpcorcorrplotcowplotcpp11crayoncrulcurldata.tableDBIDerivdescdiffobjdigestdoBydplyreeptoolseffectseffsizeestimabilityevaluateexactRankTestsfansifarverfastmapflextablefontawesomefontBitstreamVerafontLiberationfontquiverforcatsfsgdtoolsgenericsgfontsggplot2ggpubrggrepelggsciggsignifggtextgluegridExtragridtextgtgtablegtsummarygvlmahashhavenhighrhmshtmltoolshtmlwidgetshttpcodehttpuvinsightIPDFileCheckISLRisobandjpegjquerylibjsonlitejuicyjuicekableExtrakm.ciKMsurvknitrlabelinglabelledlaterlatticelifecyclelme4lmtestlubridatemagrittrmarkdownMASSMatrixMatrixModelsmaxstatmemoisemgcvmicrobenchmarkmimeminqamitoolsmodelrmunsellmvtnormnlmenloptrnnetnumDerivofficeropensslpbkrtestpillarpkgbuildpkgconfigpkgloadplyrpngpolynompraiseprettyunitsprocessxprogresspromisespspurrrquantregR6raggrappdirsRColorBrewerRcppRcppArmadilloRcppEigenreactablereactRreadrreadxlrelaimporematchrematch2reshape2rlangrmarkdownrprojrootrstatixrstudioapisandwichsassscalesshinysourcetoolsSparseMstringistringrsurveysurvivalsurvminersurvMiscSurvRegCensCovsvglitesyssystemfitsystemfontstestthattextshapingtibbletidyrtidyselecttimechangetinytextriebeardtzdburltoolsutf8uuidV8valueEQ5DvcdvctrsviridisLitevroomwaldowithrxfunxml2xtableyamlzipzoo

Cycle dependent

Rendered fromCycledep.Rmdusingknitr::rmarkdownon Aug 19 2024.

Last update: 2024-08-19
Started: 2024-08-19

Deterministic sensitivity analysis

Rendered fromdsa.Rmdusingknitr::rmarkdownon Aug 19 2024.

Last update: 2024-08-19
Started: 2024-08-19

Probabilistic sensitivity analysis

Rendered frompsa.Rmdusingknitr::rmarkdownon Aug 19 2024.

Last update: 2024-08-19
Started: 2024-08-19

Probabilistic sensitivity analysis - 2

Rendered frompsa_2.Rmdusingknitr::rmarkdownon Aug 19 2024.

Last update: 2024-08-19
Started: 2024-08-19

Sick sicker age dependent

Rendered fromSicksicker_age.Rmdusingknitr::rmarkdownon Aug 19 2024.

Last update: 2024-08-19
Started: 2024-08-19

Simple sick sicker model

Rendered fromSicksicker.Rmdusingknitr::rmarkdownon Aug 19 2024.

Last update: 2024-08-19
Started: 2024-08-19

Readme and manuals

Help Manual

Help pageTopics
Function to get sum of entries of resource per individual at diff timepoints if same cateogry has listed multiple time for same id of participant , this method comes in handy to get the sumadd_entries_sameuse_timepoint
adl_scoring tableadl_scoring.df
Function to assign the values of nested parameters from the parameter listassign_parameters
Parameter table createdblank.df
Estimation of ICER and NMBcalculate_icer_nmb
Function to check the equality of column contents between two data sets with omitting NAcheck_equal_columncontents_NAomitted
Function to check the sum of column contents between two data sets with omitting NAcheck_equal_sumcolumncontents_NAomitted
Function to find the keyword for family of distribution in glmcheck_link_glm
check the list of Markov modelscheck_list_markov_models
Function to check the variable null or NAcheck_null_na
Check the transition probabilities for numeric values and unity row sumcheck_trans_prob
Function to return treatment armcheck_treatment_arm
Check if the values of health states are providedcheck_values_states
Checks the input to run the Markov cycles and picks correct methodchecks_markov_pick_method
Function to do some checks before plotting sensitivity analysis resultschecks_plot_dsa
Join Markov model objectscombine_markov
Join health statescombine_state
Convert frequency medication to given basisconvert_freq_diff_basis
Convert period to given basisconvert_to_given_timeperiod
Convert volume to given basisconvert_volume_basis
Convert unit strength to given basisconvert_weight_diff_basis
Convert weight per time to given basisconvert_wtpertimediff_basis
Convert wt per unit volume to given basisconvert_wtpervoldiff_basis
cost matrixcost_data.df
Function to estimate the cost of inpatient admission but taken from GP records where code or description knowncosting_AandE_admission
Function to estimate the cost of inpatient admission but taken from GP records where HRG code or description knowncosting_inpatient_daycase_admission
Function to estimate the cost of liquids when IPD is in long formatcosting_opioid_liquids_averageMED_long
Function to estimate the cost of liquids taken (from IPD)costing_opioid_liquids_averageMED_wide
#'########################################################################### Function to estimate the cost of patches when IPD is in long format using a IPD data of long formatcosting_opioid_patches_averageMED_long
Function to estimate the cost of patches taken (from IPD)costing_opioid_patches_averageMED_wide
Function to estimate the cost of tablets when IPD is in long formatcosting_opioid_tablets_averageMED_long
Function to estimate the cost of tablets taken as an average cost per equivalent dose in the opioid scenario is the morphine equivalent dose (from IPD)costing_opioid_tablets_averageMED_wide
Function to estimate the cost of tablets taken (from IPD)costing_opioid_tablets_MED_wide
Function to estimate the cost of resource use taken (from IPD)costing_resource_use
create new dataset while keeping cox regression results and returned coefficientscreate_new_dataset
Create a table to compare the descriptive analysis (short) from gtsummary of two groups, but at different timepointscreate_shorttable_from_gtsummary_compare_twogroups_timpoints
Create a table to compare the descriptive analysis from gtsummary of two groupscreate_table_from_gtsummary_compare_twogroups
Function to return a list of parameters givendefine_parameters
Define parameter lists for deterministic sensitivity analysisdefine_parameters_psa
ISLR flextable huxtable nlme tm Define parameter lists for deterministic sensitivity analysisdefine_parameters_sens_anal
Define the table for transitiondefine_transition_table
Function to do probabilistic sensitivity analysisdo_psa
Function to do deterministic sensitivity analysisdo_sensitivity_analysis
Function to get the codes and the corresponding entriesencode_codes_data
Attribute parameters to probabilities of transition matrixeval_assign_trans_prob
Attribute values in health stateseval_assign_values_states
Function to find the keyword for family of distribution in glmfind_glm_distribution
Function to find the keyword for generating random numbers the distributionfind_keyword_rand_generation
Function to find the keyword for regression methodsfind_keyword_regression_method
Function to return parameters with in a expression containing operatorsfind_parameters_btn_operators
Function to find the parameters that determine the probability distributionfind_required_parameter_combs
Function to get sum of multiple columns of observationsfind_rowwise_sum_multiplecol
Function to find the keyword for survreg distributionfind_survreg_distribution
Form expression to use with glm()form_expression_glm
Form expression to use with lm()form_expression_lm
Form expression to use with mixed modelsform_expression_mixed_model_lme4
Function to get the weight and time unitsgenerate_wt_time_units
Function to get the weight and volume unitsgenerate_wt_vol_units
Function to get the details of the age columnget_age_details
Function to keep the column name, coded values and non response code into a dataframeget_colnames_codedvalues
Function to extract the unit hospital inpatient admission by matching codeget_cost_AandE_code
Function to extract the unit cost by descirption of AandE att matching descriptionget_cost_AandE_description
Function to extract the unit hospital inpatient admission by matching descriptionget_cost_ip_dc_description
Function to extract the unit hospital inpatient admission by matching HRG codeget_cost_ip_dc_hrg
Convert the combined dose to its individual component numerical value or can be unit/unitget_doses_combination
Convert the combined dose to its individual component numerical value and unitsget_doses_combination_units
Function to get the details of the EQ5D columnget_eq5d_details
Function to get extension of a file nameget_extension_file
Function to get the details of the gender columnget_gender_details
Function to return mean age from a data frameget_mean_sd_age
Get the mortality rate values from reading a fileget_mortality_from_file
Function to return the two parameters from a given expression separated by comma,get_name_value_probdistrb_def
Function to get the details of the outcome columnget_outcome_details
Get the definition of given parameter distribution defined in a fileget_parameter_def_distribution
Get the parameter values from reading a fileget_parameter_direct
Get the parameter values using the provided statistical regression methodsget_parameter_estimated_regression
Get the parameter values from reading a fileget_parameter_read
Function to get cols for the pattern givenget_single_col_multiple_pattern
help function to keep slope and intercept portion ready in mixed model expressionget_slope_intercept
help function to keep slope and intercept portion ready in mixed model expressionget_slope_intercept_cross
help function to keep slope and intercept portion ready in mixed model expressionget_slope_intercept_nested
Function to get the details of the time point columnget_timepoint_details
Function to get the details of the trial armget_trial_arm_details
Get the attribute for the health stateget_var_state
Definition of health state class or health state constructorhealth_state
Define an all zero trace matrixinit_trace
Define an all zero trace matrixinit_trace_sjtime
Function to do some checks before plotting sensitivity analysis resultskeep_results_plot_dsa
Function to list probabilistic sensitivity analysis results parameterwiselist_paramwise_psa_result
Function to load the file containing trial data and return itload_trial_data
Function to map EQ5D5L scores to EQ5D3L scores and then add to IPD datamap_eq5d5Lto3L_VanHout
Function to to read the text form of resource use and replace it with standard texts of resoure use ie. some one can describe GP visit as GP surgery visit, surgery visit or general practioners visit etc. Here all these texts should be given in a excel or csv file and then corresponidng standard form will be read from the file and will be replaced.map_resource_use_categories
Definition of Markov model and tracemarkov_model
Definition of Markov model and tracemarkov_model_sojourntime
Function to estimate the cost of liquids when IPD is in long formatmicrocosting_liquids_long
Function to estimate the cost of liquids taken (from IPD)microcosting_liquids_wide
#'########################################################################### Function to estimate the cost of patches when IPD is in long format using a IPD data of long formatmicrocosting_patches_long
Function to estimate the cost of patches taken (from IPD)microcosting_patches_wide
Function to estimate the cost of tablets when IPD is in long formatmicrocosting_tablets_long
Function to estimate the cost of tablets taken (from IPD)microcosting_tablets_wide
Function to plot CEACplot_ceac_psa
Function to plot results of sensitivity analysis do_sensitivity_analysis()plot_dsa
Function to do some checks before plotting sensitivity analysis resultsplot_dsa_difference
Function to do some checks before plotting sensitivity analysis resultsplot_dsa_icer_range
Function to do some checks before plotting sensitivity analysis resultsplot_dsa_nmb_range
Function to do some checks before plotting sensitivity analysis resultsplot_dsa_others_range
Plot efficiency frontierplot_efficiency_frontier
Function to plot mean and SE for longitudinal observations for twogroups comparedplot_histogram_onetimepoint_twogroups
Function to plot mean and SE for longitudinal observations for twogroups comparedplot_meanSE_longitudinal_twogroups
E1. Plot a Markov modelplot_model
Plot cost effectiveness acceptability curveplot_nmb_lambda
Plot the predicted survival curves for covariates keeping the others fixedplot_prediction_parametric_survival
Plotting and return the residuals after cox proportional hazard modelplot_return_residual_cox
Plotting and return the residuals after survival modelplot_return_residual_survival
Plotting survival function for all covariates using survfitplot_return_survival_curve
Plotting survival function for all covariates calculated from cox regression results and returned coefficientsplot_survival_cox_covariates
Populate transition matrixpopulate_transition_matrix
Predict risk/hazard function for cox ph regressionpredict_coxph
promis 3a scoring tablepromis3a_scoring.df
Function to report deterministic sensitivity analysisreport_sensitivity_analysis
Function to get the subset of data compared to a string after trimming the white spacesreturn_equal_liststring_col
Function to get the subset of data compared to a string after trimming the white spacesreturn_equal_liststring_listcol
Function to get the subset of data compared to a string after trimming the white spacesreturn_equal_str_col
Function to return 0 if the param is not null or NA trimming the white spacesreturn0_if_not_null_na
Set the attribute for the health stateset_var_state
Definition of strategy - or armstrategy
Function to summarise and plot probabilistic sensitivity analysissummary_plot_psa
Parameter table createdtable_param.df
Trace matrixtrace_data.df
Create the the values of cost and utility while transitiontransition_cost_util
Example trial datatrial_data.df
########################################################################### Get the parameter values using the survival analysis using cox proportional hazarduse_coxph_survival
########################################################################### Get the parameter values using the survival analysis method FHuse_fh_survival
############################################################################ Get the parameter values using the survival analysis using FH2 methoduse_fh2_survival
Function for generalised linear mixed modeluse_generalised_linear_mixed_model
############################################################################ Get the parameter values using logistic regressionuse_generalised_linear_model
########################################################################### Get the parameter values using the Kaplan-Meier survival analysisuse_km_survival
Function for mixed effect regressionuse_linear_mixed_model
########################################################################### Get the parameter values using the linear regressionuse_linear_regression
########################################################################### Get the parameter values using the survival analysis parametric survivaluse_parametric_survival
Bivariate regression for correlated observationsuse_seemingly_unrelated_regression
############################################################################ Get the parameter values using the survival analysisuse_survival_analysis
utility matrixutility_data.df
Function to convert ADL scores to a T scorevalue_ADL_scores_IPD
Function to add EQ5D3L scores to IPD datavalue_eq5d3L_IPD
Function to add EQ5D5L scores to IPD datavalue_eq5d5L_IPD
Function to convert promis3a scores to a T scorevalue_promis3a_scores_IPD
Function to estimate the cost of tablets taken (from IPD)value_Shows_IPD
Function to check the variable null or NAword2num