Skip to content

Commit ab32789

Browse files
committed
Doc and vignette updates
1 parent 67af704 commit ab32789

File tree

7 files changed

+455
-12
lines changed

7 files changed

+455
-12
lines changed

README.Rmd

+5-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ knitr::opts_chunk$set(
1313
)
1414
```
1515

16-
# `apm`: Averaged Prediction Models
16+
## `apm`: Averaged Prediction Models
1717

1818
<!-- badges: start -->
1919
<!-- badges: end -->
@@ -23,7 +23,7 @@ library(apm)
2323
data("ptpdata")
2424
```
2525

26-
## Supplying models
26+
### Supplying models
2727

2828
We can specify the models to test using `apm_mod()`. This create a full cross of all supplied arguments, which include model formula, families, whether the outcome is logged or not, whether fixed effects are included or not, whether the outcome should be a difference, and whether outcome lags should appear as predictors. Below, we create a cross of 9 models.
2929

@@ -50,7 +50,7 @@ models
5050

5151
This leaves us with 10 models.
5252

53-
## Fitting the models
53+
### Fitting the models
5454

5555
Next we fit all 10 models to the data. We do so once for each validation time to compute the average prediction error that will be used to select the optimal model. All models are fit simultaneously so the simulation can use the full joint distribution of model parameter estimates. For each validation time, each model is fit using a dataset that contains data points prior to that time.
5656

@@ -67,15 +67,14 @@ fits <- apm_pre(models,
6767
fits
6868
```
6969

70-
## Computing the ATT
70+
### Computing the ATT
7171

7272
We compute the ATT using `apm_est()`, which uses bootstrapping to compute model uncertainty due to sampling along with uncertainty due to model selection.
7373

7474
```{r}
7575
est <- apm_est(fits,
7676
post_time = 2008,
77-
M = 1,
78-
R = 50)
77+
M = 1)
7978
8079
est
8180

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ model selection.
260260
``` r
261261
est <- apm_est(fits,
262262
post_time = 2008,
263-
M = 1,
264-
R = 50)
263+
M = 1)
265264

266265
est
267266
#> An `apm_est` object
@@ -272,12 +271,12 @@ est
272271
#> - validation times:
273272
#> - post-treatment time: 2008
274273
#> - sensitivity parameter (M): 1
275-
#> - bootstrap replications: 50
274+
#> - bootstrap replications: 1000
276275
#>
277276
#> Use `summary()` or `plot()` to examine estimates and uncertainty bounds.
278277

279278
summary(est)
280279
#> Estimate Std. Error CI low CI high z_value Pr(>|z|)
281-
#> ATT 60.12 40.13 -18.54 138.78 1.498 0.134
282-
#> M = 1 . . -115.24 179.47 . .
280+
#> ATT 61.65 39.80 -16.36 139.66 1.549 0.121
281+
#> M = 1 . . -113.19 180.71 . .
283282
```

vignettes/demo.Rmd _dev/demo.Rmd

File renamed without changes.

man/apm-package.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/apm.Rmd

+362
Large diffs are not rendered by default.

vignettes/apm_summary.png

253 KB
Loading

vignettes/apm_vignette_bib.bib

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
@book{gelmanhill2006,
2+
address = {New York, NY},
3+
author = {Gelman, Andrew and Hill, Jennifer},
4+
date-added = {2019-11-19 13:50:34 -0500},
5+
date-modified = {2019-11-19 13:51:33 -0500},
6+
publisher = {Cambridge University Press},
7+
title = {Data Analysis Using Regression and Multilevel/Hierarchical Models},
8+
year = {2006}}
9+
10+
@article{manskipepper2018,
11+
author = {Manski, Charles F and Pepper, John V},
12+
date-added = {2020-01-17 21:32:17 -0400},
13+
date-modified = {2020-04-07 11:34:02 -0400},
14+
journal = {The Review of Economics and Statistics},
15+
number = {2},
16+
pages = {232-244},
17+
title = {How Do Right-to-Carry Laws Affect Crime Rates? {C}oping with Ambiguity Using Bounded-Variation Assumptions},
18+
volume = {100},
19+
year = {2018}}
20+
21+
@article{rambachanroth2023,
22+
author = {Rambachan, Ashesh and Roth, Jonathan},
23+
date-added = {2020-01-17 19:44:15 -0400},
24+
date-modified = {2024-06-30 21:17:36 -0400},
25+
journal = {Review of Economic Studies},
26+
number = {5},
27+
pages = {2555-2591},
28+
title = {A More Credible Approach to Parallel Trends},
29+
volume = {90},
30+
year = {2023}}
31+
32+
@book{gelmanhill2006,
33+
address = {New York, NY},
34+
author = {Gelman, Andrew and Hill, Jennifer},
35+
date-added = {2019-11-19 13:50:34 -0500},
36+
date-modified = {2019-11-19 13:51:33 -0500},
37+
publisher = {Cambridge University Press},
38+
title = {Data Analysis Using Regression and Multilevel/Hierarchical Models},
39+
year = {2006}}
40+
41+
@article{antonellietal2022,
42+
author = {Antonelli, Joseph and Papadogeorgou, Georgia and Dominici, Francesca},
43+
date-added = {2024-04-14 22:09:15 -0400},
44+
date-modified = {2024-04-14 22:10:21 -0400},
45+
journal = {Biometrics},
46+
number = {1},
47+
pages = {100-114},
48+
title = {Causal inference in high dimensions: A marriage between {B}ayesian modeling and good frequentist properties},
49+
volume = {78},
50+
year = {2022}}
51+
52+
@article{websteretal2014,
53+
author = {Webster, Daniel and Crifasi, Cassandra Kercher and Vernick, Jon S},
54+
date-added = {2022-07-16 17:07:41 -0400},
55+
date-modified = {2022-07-16 17:08:58 -0400},
56+
journal = {Journal of Urban Health: Bulletin of the {N}ew {Y}ork {A}cademy of {M}edicine},
57+
number = {2},
58+
pages = {293-302},
59+
title = {Effects of the Repeal of {M}issouri's Handgun Purchaser Licensing Law on Homicides},
60+
volume = {91},
61+
year = {2014}}
62+
63+
@article{hasegawaetal2019,
64+
author = {Hasegawa, Raiden B and Webster, Daniel W and Small, Dylan S},
65+
date-added = {2020-07-14 18:53:21 -0400},
66+
date-modified = {2020-09-02 00:03:23 -0400},
67+
journal = {Epidemiology},
68+
number = {3},
69+
pages = {371-379},
70+
title = {Evaluating {M}issouri's Handgun Purchaser Law: A Bracketing Method for Addressing Concerns About History Interacting with Group},
71+
volume = {30},
72+
year = {2019}}
73+
74+
@article{xuetal2020,
75+
author = {Xu, Li and Gotwalt, Chris and Hong, Yili and King, Caleb B and Meeker, William Q},
76+
date-added = {2023-12-08 23:38:35 -0500},
77+
date-modified = {2023-12-08 23:39:46 -0500},
78+
journal = {The American Statistician},
79+
number = {4},
80+
pages = {345-358},
81+
title = {Applications of the Fractional-Random-Weight Bootstrap},
82+
volume = {74},
83+
year = {2020}}

0 commit comments

Comments
 (0)