Skip to content

Commit

Permalink
Updated AIPTW
Browse files Browse the repository at this point in the history
  • Loading branch information
pzivich committed Mar 23, 2019
1 parent b20109f commit 09cfd77
Showing 1 changed file with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -95,7 +95,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -113,8 +113,8 @@
"Model Family: Binomial Df Model: 8\n",
"Link Function: logit Scale: 1.0000\n",
"Method: IRLS Log-Likelihood: -206.06\n",
"Date: Mon, 11 Mar 2019 Deviance: 412.12\n",
"Time: 08:24:05 Pearson chi2: 510.\n",
"Date: Sat, 23 Mar 2019 Deviance: 412.12\n",
"Time: 18:18:31 Pearson chi2: 510.\n",
"No. Iterations: 5 Covariance Type: nonrobust\n",
"==============================================================================\n",
" coef std err z P>|z| [0.025 0.975]\n",
Expand Down Expand Up @@ -148,7 +148,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -166,8 +166,8 @@
"Model Family: Binomial Df Model: 9\n",
"Link Function: logit Scale: 1.0000\n",
"Method: IRLS Log-Likelihood: -202.85\n",
"Date: Mon, 11 Mar 2019 Deviance: 405.71\n",
"Time: 08:25:18 Pearson chi2: 535.\n",
"Date: Sat, 23 Mar 2019 Deviance: 405.71\n",
"Time: 18:18:31 Pearson chi2: 535.\n",
"No. Iterations: 6 Covariance Type: nonrobust\n",
"==============================================================================\n",
" coef std err z P>|z| [0.025 0.975]\n",
Expand Down Expand Up @@ -202,19 +202,22 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"RD: -0.06857139263314216\n",
"RR: 0.5844630051369846\n",
"RD: -0.08485106054489719\n",
"RR: 0.5319812234515429\n",
"======================================================================\n",
" Augment Inverse Probability of Treatment Weights \n",
"======================================================================\n",
"Risk Difference: -0.0849\n",
"----------------------------------------------------------------------\n",
"Risk Difference: -0.0686\n",
"Risk Ratio: 0.5845\n",
"----------------------------------------------------------------------\n"
"Risk Ratio: 0.532\n",
"======================================================================\n"
]
}
],
Expand All @@ -231,23 +234,23 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Interpreting the risk difference, we would conclude that had everyone in our cohort been treated with ART, the risk of all-cause mortality would have been 6.9% points lower than had no one been treated.\n",
"Interpreting the risk difference, we would conclude that had everyone in our cohort been treated with ART, the risk of all-cause mortality would have been 8.5% points lower than had no one been treated.\n",
"\n",
"### Confidence Intervals\n",
"To obtain correct confidence intervals, we need to use a bootstrap procedure. Influence curves are an alternative, but not currently available"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"95% LCL: -0.12324970574432371\n",
"95% UCL -0.005298084807482341\n"
"95% LCL: -0.14683185675036045\n",
"95% UCL -0.014802615734624436\n"
]
}
],
Expand All @@ -272,7 +275,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Under the counterfactual of everyone receiving treatment with ART, the risk of all-cause mortality was 6.9% points lower (95% CL: ) than the counterfactual where no one had been treated.\n",
"Under the counterfactual of everyone receiving treatment with ART, the risk of all-cause mortality was 8.5% points lower (95% CL: -0.15, -0.01) than the counterfactual where no one had been treated.\n",
"\n",
"# Conclusion\n",
"In this tutorial, I introduced the concept of doubly-robust estimators and detailed augmented-IPTW. I demonstrated estimation with `AIPTW` using *zEpid* and how to obtain confidence intervals. Please view other tutorials for information on other functionality within *zEpid*\n",
Expand Down

0 comments on commit 09cfd77

Please sign in to comment.