Skip to content

Commit

Permalink
Added packages to enhances for shiny application.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbryer committed Jul 6, 2023
1 parent a5ed8da commit c629473
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 44 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ Enhances:
mice,
badger,
BART,
randomForest
randomForest,
stargazer,
gdata
VignetteBuilder:
knitr
Encoding: UTF-8
Expand Down
4 changes: 2 additions & 2 deletions Slides/Intro_PSA.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
################################################################################
##### Setup
# Installing the `psa` package with dependencies = 'Enhances' should install
# all the dependencies for the workshop. Uncomment to run the command once per
# R installation.
# all the dependencies for the workshop. Remove the comment to run the command
# once per R installation.

# remotes::install_github('jbryer/psa', build_vignettes = TRUE, dependencies = 'Enhances')

Expand Down
4 changes: 2 additions & 2 deletions Slides/Intro_PSA.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Estimating Causal Effects with Observational Data"
subtitle: "Propensity Score Analysis with R"
title: "Introduction to Propensity Score Analysis with R"
# subtitle: "Propensity Score Analysis with R"
author: "Jason Bryer, Ph.D."
# date: "`r format(Sys.Date(), '%B %d, %Y')`"
output:
Expand Down
79 changes: 40 additions & 39 deletions Slides/Intro_PSA.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<title>Estimating Causal Effects with Observational Data</title>
<title>Introduction to Propensity Score Analysis with R</title>
<meta charset="utf-8" />
<meta name="author" content="Jason Bryer, Ph.D." />
<script src="libs/header-attrs/header-attrs.js"></script>
Expand All @@ -20,10 +20,10 @@



# Estimating Causal Effects with Observational Data
## Propensity Score Analysis with R
# Introduction to Propensity Score Analysis with R
##
### Jason Bryer, Ph.D.
### Last updated: July 04, 2023
### Last updated: July 06, 2023


---
Expand Down Expand Up @@ -504,12 +504,13 @@

```
## # A tibble: 4 × 11
## x1 x2 x3 treatment outcome ps strata5 ate_weight att_weight atc_weight atm_weight
## &lt;dbl&gt; &lt;dbl&gt; &lt;lgl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;fct&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
## 1 1.35 0.744 FALSE 0 1.46 0.725 C 3.63 2.63 1 1
## 2 0.149 1.55 TRUE 0 -0.924 0.790 D 4.76 3.76 1 1
## 3 2.47 2.39 TRUE 1 -0.0527 0.982 E 1.02 1 0.0181 0.0181
## 4 2.29 1.66 TRUE 1 1.05 0.922 D 1.08 1 0.0844 0.0844
## x1 x2 x3 treatment outcome ps strata5 ate_weight att_weight
## &lt;dbl&gt; &lt;dbl&gt; &lt;lgl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;fct&gt; &lt;dbl&gt; &lt;dbl&gt;
## 1 1.35 0.744 FALSE 0 1.46 0.725 C 3.63 2.63
## 2 0.149 1.55 TRUE 0 -0.924 0.790 D 4.76 3.76
## 3 2.47 2.39 TRUE 1 -0.0527 0.982 E 1.02 1
## 4 2.29 1.66 TRUE 1 1.05 0.922 D 1.08 1
## # ℹ 2 more variables: atc_weight &lt;dbl&gt;, atm_weight &lt;dbl&gt;
```


Expand Down Expand Up @@ -1272,56 +1273,56 @@
## Stratification Results:
## Complete estimate = 1587
## Complete CI = [224, 2950]
## Bootstrap pooled estimate = 1581
## Bootstrap weighted pooled estimate = 1529
## Bootstrap pooled CI = [258, 2904]
## 69% of bootstrap samples have confidence intervals that do not span zero.
## 69% positive.
## Bootstrap pooled estimate = 1636
## Bootstrap weighted pooled estimate = 1659
## Bootstrap pooled CI = [269, 3002]
## 62% of bootstrap samples have confidence intervals that do not span zero.
## 62% positive.
## 0% negative.
## ctree Results:
## Complete estimate = 1598
## Complete CI = [-6.62, 3203]
## Bootstrap pooled estimate = 1517
## Bootstrap weighted pooled estimate = 1533
## Bootstrap pooled CI = [249, 2785]
## 40.5% of bootstrap samples have confidence intervals that do not span zero.
## 40.5% positive.
## Bootstrap pooled estimate = 1506
## Bootstrap weighted pooled estimate = 1485
## Bootstrap pooled CI = [84.4, 2927]
## 41.3% of bootstrap samples have confidence intervals that do not span zero.
## 41.3% positive.
## 0% negative.
## rpart Results:
## Complete estimate = 1332
## Complete CI = [-295, 2959]
## Bootstrap pooled estimate = 1455
## Bootstrap weighted pooled estimate = 1492
## Bootstrap pooled CI = [-200, 3110]
## 29% of bootstrap samples have confidence intervals that do not span zero.
## 29% positive.
## Bootstrap pooled estimate = 1506
## Bootstrap weighted pooled estimate = 1537
## Bootstrap pooled CI = [-250, 3262]
## 34% of bootstrap samples have confidence intervals that do not span zero.
## 34% positive.
## 0% negative.
## Matching Results:
## Complete estimate = 1827
## Complete CI = [1210, 2444]
## Bootstrap pooled estimate = 1445
## Bootstrap weighted pooled estimate = 1460
## Bootstrap pooled CI = [-353, 3243]
## 87% of bootstrap samples have confidence intervals that do not span zero.
## 86% positive.
## 1% negative.
## Bootstrap pooled estimate = 1564
## Bootstrap weighted pooled estimate = 1539
## Bootstrap pooled CI = [-154, 3282]
## 90% of bootstrap samples have confidence intervals that do not span zero.
## 90% positive.
## 0% negative.
## MatchIt Results:
## Complete estimate = 2031
## Complete CI = [797, 3266]
## Bootstrap pooled estimate = 1862
## Bootstrap weighted pooled estimate = 1866
## Bootstrap pooled CI = [571, 3153]
## Bootstrap pooled estimate = 1874
## Bootstrap weighted pooled estimate = 1858
## Bootstrap pooled CI = [427, 3321]
## 77% of bootstrap samples have confidence intervals that do not span zero.
## 77% positive.
## 0% negative.
## Weighting Results:
## Complete estimate = 1641
## Complete CI = [380, 2902]
## Bootstrap pooled estimate = 1587
## Bootstrap weighted pooled estimate = 1547
## Bootstrap pooled CI = [239, 2934]
## 72% of bootstrap samples have confidence intervals that do not span zero.
## 72% positive.
## Bootstrap pooled estimate = 1614
## Bootstrap weighted pooled estimate = 1570
## Bootstrap pooled CI = [234, 2993]
## 70% of bootstrap samples have confidence intervals that do not span zero.
## 70% positive.
## 0% negative.
```

Expand Down
Binary file modified Slides/Intro_PSA_files/figure-html/unnamed-chunk-59-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Slides/Intro_PSA_files/figure-html/unnamed-chunk-60-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Slides/Intro_PSA_files/figure-html/unnamed-chunk-61-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Slides/Intro_PSA_files/figure-html/unnamed-chunk-62-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c629473

Please sign in to comment.