Attributable Risk Calculator

This calculator finds the attributable risk, attributable risk percentage, and population attributable risk percentage for a given 2×2 contingency table.

Simply fill in the cells of the table below and then click “Calculate.”

Disease No Disease
Exposed
Not Exposed

Attributable Risk: 0.08077

Attributable Risk %: 53.30612

Population Attributable Risk %: 17.30718%

2 Replies to “Attributable Risk Calculator”

  1. Hello Zach,
    Thanks for disseminationg your relevant knowledge and work via the statology website- it is great.

    I have a question. Did you have any content on sensitive analysis? I am browsing how to systematically address it for a logistic regression mondel.
    Many thanks for considering my enquiry.

    Juan

    1. Yes, I can definitely help you with **sensitivity analysis for a logistic regression model**. Sensitivity analysis examines how the output (e.g., predicted probabilities or classification decisions) of your logistic regression model changes when inputs (features, parameters, assumptions) are varied. This is especially important in fields like epidemiology, economics, and risk modeling.

      ### 🔍 **Types of Sensitivity Analysis for Logistic Regression**

      Here’s a structured way to think about it:

      #### 1. **Input (Predictor) Sensitivity**

      * **Objective**: Assess how changes in predictor values affect the predicted probability or odds.
      * **Method**: Vary one input at a time (OAT) while holding others constant, and observe the change in predicted probabilities.
      * **Tool**: Partial dependence plots (PDPs) or marginal effect plots.

      #### 2. **Coefficient Sensitivity**

      * **Objective**: Assess how robust the model is to small perturbations in the estimated coefficients.
      * **Method**: Use bootstrapping or jackknife resampling to obtain confidence intervals and test coefficient stability.

      #### 3. **Assumption Sensitivity**

      * **Objective**: Check sensitivity to model assumptions such as linearity, independence of errors, multicollinearity.
      * **Method**:

      * Run the model excluding or including interaction terms.
      * Check with/without regularization (e.g., L1/L2).
      * Test for multicollinearity (e.g., VIF scores).

      #### 4. **Sensitivity to Missing Data Imputation**

      * **Objective**: See how your choice of imputation method affects model outcomes.
      * **Method**: Fit models using different imputation techniques (mean, median, multiple imputation) and compare output.

      #### 5. **Outcome Classification Threshold Sensitivity**

      * **Objective**: Evaluate how the classification performance (e.g., sensitivity, specificity) changes as the probability threshold varies.
      * **Method**:

      * Vary the threshold from 0 to 1.
      * Plot ROC curve and Precision-Recall curve.
      * Identify the threshold that balances sensitivity/specificity or maximizes a custom metric.

      #### 6. **Influential Observation Sensitivity**

      * **Objective**: Identify observations that disproportionately influence the model.
      * **Method**:

      * Cook’s distance, leverage statistics, DFBETA.
      * Rerun model excluding influential observations.

      ### 🛠️ Tools and Libraries

      In **Python**:

      * `statsmodels` for influence diagnostics.
      * `sklearn.inspection` for PDP and permutation importance.
      * `seaborn`/`matplotlib` for visualizing effects.

      In **R**:

      * `car` package for VIF and influence measures.
      * `effects` and `rms` for plotting marginal effects.
      * `boot` for coefficient stability.

Leave a Reply

Your email address will not be published. Required fields are marked *