Package: ham 1.2.0.9000

Stephen Zuniga

ham: Healthcare Analysis Methods

Conducts analyses for healthcare program evaluations or intervention studies. Calculates regression analyses for standard ordinary least squares (OLS or linear) or logistic models. Performs regression models used for causal modeling such as differences-in-differences (DID) and interrupted time series (ITS) models. Provides limited interpretations of model results and a ranking of variable importance in models. Performs propensity score models, top-coding of model outcome variables, and can return new data with the newly formed variables. Conducts Bayesian analysis summaries and graphs, decision curve analysis, and produces some Shewhart control charts. Also performs Cronbach's alpha for various scale items (e.g., survey questions). See Github URL for examples in the README file. For more details on the statistical methods, see Allen & Yen (1979, ISBN:0-8185-0283-5), Angrist & Pischke (2009, ISBN:9780691120355), Cohen (1988, ISBN:0-8058-0283-5), Gebski (2012) <doi:10.1017/S0950268812000179>, Gelman & Goodrich (2019) <doi:10.1080/00031305.2018.1549100>, Gelman & Hill (2007, ISBN:978-0-521-68689-1), Harrell (2015, ISBN:978-3-319-19424-0), Imbens & Rubin (2015, ISBN:978-0-521-88588-1), Kline (1999, ISBN:9780415211581), Kruschke (2014, ISBN:9780124058880), Linden (2015) <doi:10.1177/1536867X1501500208>, Merlo (2006) <doi:10.1136/jech.2004.029454>, Muthen & Satorra (1995) <doi:10.2307/271070>, Rabe-Hesketh & Skrondal (2008, ISBN:978-1-59718-040-5), Rosenbaum (2010, ISBN:978-1-4419-1212-1), Ryan (2011, ISBN:978-0-470-59074-4), and Vickers & Elkin (2006) <doi:10.1177/0272989X06295361>.

Authors:Stephen Zuniga [aut, cre, cph]

ham_1.2.0.9000.tar.gz
ham_1.2.0.9000.zip(r-4.7)ham_1.2.0.9000.zip(r-4.6)ham_1.2.0.9000.zip(r-4.5)
ham_1.2.0.9000.tgz(r-4.6-any)ham_1.2.0.9000.tgz(r-4.5-any)
ham_1.2.0.9000.tar.gz(r-4.7-any)ham_1.2.0.9000.tar.gz(r-4.6-any)
ham_1.2.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
ham/json (API)

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

Bug tracker:https://github.com/szuniga07/ham/issues

Datasets:
  • cas - Patient survey data
  • co2mcmc - Markov Chain Monte Carlo linear regression estimates of plant's CO2 uptake regressed on ambient carbon dioxide concentrations
  • co2multi - Bayes class object with summarized Markov Chain Monte Carlo estimates of plant's CO2 uptake as a binary variable that is above or below the median level
  • hosp1 - Patient hospital program/intervention data, intervention group only
  • hosprog - Patient hospital program/intervention data
  • infections - Hospital acquired infections (HAI) during 41 months.
  • losmcmc - Markov Chain Monte Carlo estimates of hospital length of stay from the hosprog data frame
  • NHSN - NHSN standardized incidence ratios for 4 incidents, 2016-2024.
  • unemployment - USA's unemployment rate between 1929 and 2024

On CRAN:

Conda:

6.08 score 20 scripts 170 downloads 10 exports 0 dependencies

Last updated from:5052c4985a. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK209
source / vignettesOK203
linux-release-x86_64OK202
macos-release-arm64OK110
macos-oldrel-arm64OK93
windows-develOK105
windows-releaseOK91
windows-oldrelOK106
wasm-releaseOK118

Exports:alphaassessBayescontroldecidegroupimportanceinterpretitsEffectSummary

Dependencies:

ham-package
Healthcare Analysis Methods (ham) | 1. Introduction | 2. Descriptive and inferential statistics | Group level 95% confidence intervals over 12 months (t distribution) | Rolling 6-month averages by quartiles of age (Q1 - Q4) | Graph the results | Between-group variance and within-group clustering | Graph the confidence interval trend results | 3. Linear and logistic regression | OLS or linear regression | ham provides coefficient interpretations with interpret() | Logistic regression | Logistic regression interpretations | Poisson regression | Poisson regression interpretations | OLS top-coding and propensity scores | model results | Inverse Probability of Treatment Weighting using the propensity score (IPW) | Weighted least squares model results | importance | Graph importance | Graph a summary of the coefficients | 4. Differences-in-Differences | DID model for length of stay using assess() | Code to view DID model results | Code to get the coefficient interpretations | View a partial prediction plot | View DID 30-day readmissions results | 5. Interrupted Time Series | ITS model 1 | View ITS model 1 results | interpret coefficients | Graph ITS model 1 | ITS model 2 | View ITS model 2 results | interpret ITS 2 coefficients | Graph ITS model 2 | ITS model 3 | Plot the summary coefficients | View ITS model 3 results | ITS model 4: 30-day death (mortality) | View ITS model 4 results | interpret ITS 4 coefficients | Graph ITS model 4 | ITS model 5 | Graph ITS model 5 results | An example of calculating Cronbach's alpha: | Interpret Cronbach's alpha: | 7. Discussion | 8. References

Last update: 2026-06-29
Started: 2025-10-25

Bayes
1. Introduction | Bayes() | plot.Bayes() | 2. Diagnostics: 'dxa', 'dxd', 'dxg', 'dxt' | interpretations | 3. Posterior summary: 'post' | 4a. Posterior Predictive Check: 'check' | 4b. Checking the regression trend line: 'check' | 5. Hierarchical or Multilevel Model summary: 'multi' | 6. Target setting: 'target' | 7. Gelamn's R^2: 'r2'

Last update: 2026-06-27
Started: 2026-03-13

control
1. Introduction | 2. $\bar{X}$ charts | 3. p-chart | 4. u-chart

Last update: 2026-06-17
Started: 2026-03-14

decide
1. Introduction | 1. Model classification | 2. Decision Curve Analysis: Net Benefit | 3. Decision Curve Analysis (DCA): Interventions Saved

Last update: 2026-03-19
Started: 2026-03-14

Readme and manuals

Help Manual

Help pageTopics
Calculates Cronbach's alpha on scale itemsalpha
Assess models with regressionassess
Summarize Bayesian Markov Chain Monte Carlo (MCMC) objectBayes
Patient survey datacas
Markov Chain Monte Carlo linear regression estimates of plant's CO2 uptake regressed on ambient carbon dioxide concentrationsco2mcmc
Bayes class object with summarized Markov Chain Monte Carlo estimates of plant's CO2 uptake as a binary variable that is above or below the median levelco2multi
Statistics for Shewhart control chartscontrol
Statistics for Decision Curve Analysis and logistic regression model classificationdecide
Group level confidence intervals and between-group variationgroup
Patient hospital program/intervention data, intervention group onlyhosp1
Patient hospital program/intervention datahosprog
Importance of variables based on partial chi-square statisticimportance
Hospital acquired infections (HAI) during 41 months.infections
Interpret model outputinterpret
Interrupted time series analysis effectsitsEffect
Markov Chain Monte Carlo estimates of hospital length of stay from the hosprog data framelosmcmc
NHSN standardized incidence ratios for 4 incidents, 2016-2024.NHSN
Prediction plot of treatment and control groups for DID and ITS modelsplot.assess
Bayesian plots for various analysesplot.Bayes
Shewhart control chartsplot.control
Decision Curve Analysis plots and regression model classification graphs on sensitivity and specificityplot.decide
Confidence interval graphs for group class objectsplot.group
Plot of variable importance ranked by partial chi-square statisticplot.importance
Plot of a regression model's coefficient summaryplot.Summary
Print alpha resultsprint.alpha
Print interpret objectprint.interpret
Print Model Summary Resultsprint.Summary
Creates a Summary object of regression model results for graphing purposesSummary
USA's unemployment rate between 1929 and 2024unemployment