Learn R Programming

pubh

A toolbox for Public Health and Epidemiology

pubh is an R package for making R functions and capabilities more accessible to students and professionals from epidemiology and public health related disciplines.

Information on use with examples can be found in "vignettes".

Copy Link

Version

Install

install.packages('pubh')

Monthly Downloads

509

Version

3.0.0

License

GPL-2

Maintainer

Josie Athens

Last Published

October 21st, 2025

Functions in pubh (3.0.0)

gg_star

Annotating a plot to display differences between groups.
get_r2

Estimate R2 or Pseudo-R2 from regression models
effect_plot

Constructs effect plots on for cases when the response (outcome) is a numerical variable and the explanatory (exposure) is a categorical variable.
cosm_sum

Cosmetics for summary tables Adds some cosmetics to tables of descriptive statistics generated by tbl_summary.
leverage

Leverage.
cross_tbl

Table of descriptive statistics by categorical variable.
knife_mean

Jackknife for means.
expand_df

Expand a data frame.
freq_cont

Relative and Cumulative Frequency.
inv_logit

Inverse of the logit
bst

Bootstrap Confidence Intervals.
jack_knife

Ranks leverage observations from Jackknife method.
multiple

Multiple comparisons with plot.
model_labels

Using labels as coefficient names in tables of coefficients.
ss_jk

Sum of squares for Jackknife.
round_pval

Rounding p-values.
stats_quotes

Internal function to calculate descriptive statistics.
rel_dis

Relative Dispersion.
qq_plot

Quantile-quantile plots against the standard Normal distribution.
Sharples

Measured and self-reported weight in New Zealand.
Thall

RCT on the treatment of epilepsy.
gen_bst_df

Generate a data frame with estimate and bootstrap CIs.
rank_influence

Ranks observations based upon influence measures on models.
logistic_gof

Goodness of fit for Logistic Regression.
estat

Descriptive statistics for continuous variables.
mhor

Mantel-Haenszel odds ratio.
odds_trend

Function to calculate OR using Wald CI, and plot trend.
strip_error

Strip plots with error bars.
geo_mean

Geometric mean.
theme_pubh

A theme for huxtables This function quickly set a default style for a huxtable.
prop_or

Proportion, p1 from proportion p2 and OR.
pseudo_r2

Pseudo R2 (logistic regression) pseudo_r2 Calculates R2 analogues (pseudo R2) of logistic regression.
harm_mean

Harmonic mean.
glm_coef

Table of coefficients from generalised linear models.
rank_leverage

Ranks observations by leverage.
reference_range

Reference range (reference interval).
predict_inv

Given y solve for x in a simple linear model.
Sandler

Passive smoking in adulthood and cancer risk.
Hodgkin

T-cell counts from Hodgkin's disease patients.
Rothman

Oral contraceptives and stroke.
bar_error

Bar charts with error bars.
Kirkwood

Body weight and plasma volume.
Macmahon

Breast cancer and age of childbirth.
Vanderpump

Smoking and mortality in Whickham, England.
Tuzson

Peak knee velocity in walking at flexion and extension.
Fentress

Migraine pain reduction.
Roberts

Extracorporeal membrane oxygenation in neonates.
coef_det

Coefficient of determination.
bland_altman

Bland-Altman agreement plots.
Oncho

Onchocerciasis in Sierra Leone.
Brenner

Prevalence of Helicobacter pylori infection in preschool children.
Bernard

Survival of patients with sepsis.
cosm_reg

Cosmetics for tables of regression coefficients. Converts tables generated by tbl_regression to huxtable and adds some cosmetics.
bmj

Palette inspired by the British Medical Journal.