Package: graphPAF 2.0.0

John Ferguson

graphPAF: Estimating and Displaying Population Attributable Fractions

Estimation and display of various types of population attributable fraction and impact fractions. As well as the usual calculations of attributable fractions and impact fractions, functions are provided for attributable fraction nomograms and fan plots, continuous exposures, for pathway specific population attributable fractions, and for joint, average and sequential population attributable fractions.

Authors:John Ferguson [aut, cre]

graphPAF_2.0.0.tar.gz
graphPAF_2.0.0.zip(r-4.5)graphPAF_2.0.0.zip(r-4.4)graphPAF_2.0.0.zip(r-4.3)
graphPAF_2.0.0.tgz(r-4.4-any)graphPAF_2.0.0.tgz(r-4.3-any)
graphPAF_2.0.0.tar.gz(r-4.5-noble)graphPAF_2.0.0.tar.gz(r-4.4-noble)
graphPAF_2.0.0.tgz(r-4.4-emscripten)graphPAF_2.0.0.tgz(r-4.3-emscripten)
graphPAF.pdf |graphPAF.html
graphPAF/json (API)

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

Peer review:

Bug tracker:https://github.com/johnfergusonnuig/graphpaf/issues

Datasets:
  • Hordaland_data - Simulated case control dataset for 5000 cases (individuals with chronic cough) and 5000 controls
  • stroke_reduced - Simulated case control dataset for 6856 stroke cases and 6856 stroke controls

On CRAN:

21 exports 2 stars 1.33 score 44 dependencies 6 scripts 275 downloads

Last updated 1 months agofrom:71316df95a. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 16 2024
R-4.5-winOKSep 16 2024
R-4.5-linuxOKSep 16 2024
R-4.4-winOKSep 16 2024
R-4.4-macOKSep 16 2024
R-4.3-winOKSep 16 2024
R-4.3-macOKSep 16 2024

Exports:automatic_fitaverage_pafdata_cleando_simif_bruzziif_directimpact_fractionjoint_pafPAF_calc_continuousPAF_calc_discretepaf_levinpaf_miettinenplot_continuouspredict_df_continuouspredict_df_discreteps_pafpspaf_discreterf_summaryrisk_quantilesseq_pafsim_outnode

Dependencies:bootclicolorspacedplyrexpmfansifarvergenericsggplot2ggrepelgluegridExtragtablegtoolsisobandlabelinglatticelifecyclemadnessmagrittrMASSMatrixmatrixcalcmgcvmunsellnlmepillarpkgconfigplyrR6RColorBrewerRcppreshape2rlangscalesstringistringrsurvivaltibbletidyselectutf8vctrsviridisLitewithr

graphPAF: An R package to estimate and display population attributable fractions

Rendered fromgraphPAF_vignette.pdf.asisusingR.rsp::asison Sep 16 2024.

Last update: 2024-08-17
Started: 2023-02-07

Readme and manuals

Help Manual

Help pageTopics
Automatic fitting of probability models in a pre-specified Bayesian network.automatic_fit
Calculation of average and sequential paf taking into account risk factor sequencingaverage_paf
Clean a dataset to make model fitting more efficientdata_clean
Internal: Simulate a column from the post intervention distribution corresponding to eliminating a risk factordo_sim
Estimating and Displaying Population Attributable FractionsgraphPAF-package graphPAF
Simulated case control dataset for 5000 cases (individuals with chronic cough) and 5000 controlsHordaland_data
Internal: Calculation of an impact fraction using the Bruzzi approachif_bruzzi
Internal: Calculation of an impact fraction using the direct approachif_direct
General calculations of impact fractionsimpact_fraction
Calculation of joint attributable fractions over several risk factors taking into account risk factor sequencingjoint_paf
Calculation of attributable fractions with a continuous exposurePAF_calc_continuous
Calculation of attributable fractions using a categorized risk factorPAF_calc_discrete
Implementation of Levin's formula for summary datapaf_levin
Implementation of Miettinen's formula for summary datapaf_miettinen
Plot hazard ratios, odds ratios or risk ratios comparing differing values of a continuous exposure to a reference levelplot_continuous
Plot impact fractions corresponding to risk-quantiles over several risk factorsplot.PAF_q
Create a fan_plot of a rf.data.frame objectplot.rf.data.frame
Produce plots of sequential and average PAFplot.SAF_summary
Internal: Create a data frame for predictions (when risk factor is continuous).predict_df_continuous
Internal: Create a data frame for predictions (when risk factor is discrete).predict_df_discrete
Print out PAF_q for differing risk factorsprint.PAF_q
Print out a SAF_summary objectprint.SAF_summary
Estimate pathway specific population attributable fractionsps_paf
Internal, pathway specific PAF when the mediator is discretepspaf_discrete
Create a rf.data.frame objectrf_summary
Return the vector of risk quantiles for a continuous risk factor.risk_quantiles
Calculation of sequential PAF taking into account risk factor sequencingseq_paf
Internal: Simulate from the post intervention distribution corresponding to eliminating a risk factorsim_outnode
Simulated case control dataset for 6856 stroke cases and 6856 stroke controlsstroke_reduced