Package: deltapif 0.4.6

deltapif: Estimate Potential Impact and Population Attributable Fractions with Aggregated Data

Uses the delta-method to estimate the Potential Impact Fraction (PIF) and the Population Attributable Fraction (PAF) from summary data. It creates point-estimates, confidence intervals, and estimates of the variance. Provides an extension to the aggregated data method in Chan, Zepeda-Tello et al (2025) <doi:10.1002/sim.70214>.

Authors:Rodrigo Zepeda-Tello [aut, cre]

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

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

Bug tracker:https://github.com/rodrigozepeda/deltapif/issues

Pkgdown/docs site:https://rodrigozepeda.github.io

Datasets:
  • alcohol - Alcohol consumption in Australia from Pandeya et al
  • cancer_rr - Relative risks for cancer from Pandeya et al
  • dementiacov - Relative risk covariance from Lee et al
  • dementiarisk - Exposure and Relative Risk data from Lee et Al

On CRAN:

Conda:

5.34 score 2 stars 9 scripts 428 downloads 44 exports 12 dependencies

Last updated from:ebe1cab40e. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK204
source / vignettesOK278
linux-release-x86_64OK174
macos-release-arm64OK181
macos-oldrel-arm64OK210
windows-develOK144
windows-releaseOK114
windows-oldrelOK110
wasm-releaseOK126

Exports:as_covariance_structureas.data.frameas.listas.matrixattributable_casesaverted_caseschange_linkchildrencoefcol_namesconfintcorrelationcovariancecovariance_structurecovariance_structure_classcovariance_structure2default_parameter_covariance_structuredefault_parameter_covariance_structure2default_pif_covariance_structuredefault_pif_covariance_structure2default_weight_covariance_structuredefault_weight_covariance_structure2default_weight_pif_covariance_structuredefault_weight_pif_covariance_structure2deriv_pif_pflatten_namesfraction_typelengthnamespafpaf_ensemblepaf_totalpifpif_ensemblepif_totalprintrow_namesstandard_deviationsubsetsummaryvarianceweighted_adjusted_pafweighted_adjusted_pifweights

Dependencies:cliDerivfarvergluelabelinglifecycleR6RColorBrewerrlangS7scalesviridisLite

Examples
Example 1: Estimating the PAF for the proportion of dementia attributable to smoking | Example 2: Combining subpopulations into a total | Example 3: Estimating the PIF for the proportion of dementia reduced by a 15% reduction in smoking. | Example 4: A categorical population attributable fraction | Example 5: Combining fractions of different risks into an ensemble | Example 6: Adjusted fractions | Example 7: Ensuring non-negative fractions | Example 8: Computing averted and attributable cases | Example 9: Computing averted cases (strictly positive) | Example 10: Using Hazard Ratios (HR) and Odds Ratios (OR) instead of Relative Risks (RR) | References

Last update: 2026-03-11
Started: 2026-02-19

Introduction
Core Concepts: PAF and PIF | Key assumption: Independent (summary) data sources. | Usage | Population Attributable Fraction (PAF) | Incorporating Uncertainty | Potential Impact Fraction (PIF) | Attributable and averted cases | Combining fractions from subpopulations | Combining fractions from multiple risks | Adjusting fractions for commonality | Additional information | References

Last update: 2026-03-04
Started: 2025-08-10

Readme and manuals

Help Manual

Help pageTopics
Alcohol consumption in Australia from Pandeya et alalcohol
Transform into a covariance structureas_covariance_structure as_covstr
Transform an object into a data.frameas.data.frame
Convert to listas.list
Convert a 'covariance_structure' to 'matrix'as.matrix
Relative risks for cancer from Pandeya et alcancer_rr
Attributable casesattributable_cases averted_cases casecalc
Change the linkchange_link
Get the children labels from a 'pif_class'children
Extract coefficients of a pif objectcoef
Extract confidence intervalsconfint
Covariance structure classcovariance_structure_class
Default covariance structurescovariance_structure covariance_structure2 covariance_structures default_parameter_covariance_structure default_parameter_covariance_structure2 default_pif_covariance_structure default_pif_covariance_structure2 default_weight_covariance_structure default_weight_covariance_structure2 default_weight_pif_covariance_structure default_weight_pif_covariance_structure2
Covariance matrix, correlation matrix, variance and standard deviation for potential impact fractionscorrelation covariance covcor standard_deviation variance
Relative risk covariance from Lee et aldementiacov
Exposure and Relative Risk data from Lee et Aldementiarisk
Partial derivatives of PIFderivatives deriv_pif_beta deriv_pif_p
Names of a PIF's componentsflatten_names
Get the type of the fractionfraction_type
Length of an objectlength
Get the label of a PIF or PAFnames
Potential Impact fraction and Population Attributable Fractionpaf pif pifpaf
Print or show a potential impact fractionprint
Row and Column namescol_names rowcol row_names
Subset a 'covariance_structure'subset
Summary of an objectsummary
Combine Potential Impact Fractions and Population Attributable Fractionspaf_ensemble paf_total pif_ensemble pif_total totalpifpaf
Weighted Adjusted Fractionsweighted_adjusted weighted_adjusted_paf weighted_adjusted_pif
Extract weights of a pif_global_ensembleweights