Skip to content

Commit

Permalink
Vignette is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sokbae committed Oct 29, 2020
1 parent 0301385 commit ebcf991
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
* The first version is released.
* Check ([Jun and Lee, 2020](https://arxiv.org/abs/2004.08318)) for details.
* It is on CRAN: https://CRAN.R-project.org/package=ciccr/.

# ciccr 0.2.0 (2020-10-29)
* The second version is submitted to CRAN.
* This version includes the following updates:
* estimation and inference methods for causal relative and attributable risk,
* handling of both case-control and case-population studies.
15 changes: 15 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Test environments
* local x86_64-apple-darwin15.6.0, using R 3.6.2
* travis-ci: x86_64-pc-linux-gnu, using R 4.0.2
* win-builder: x86_64-w64-mingw32, using using R Under development (unstable) (2020-10-27 r79379)

## R CMD check results
There were no ERRORs or WARNINGs.

## This version
This version includes the following updates:

* estimation and inference methods for causal relative and attributable risk,

* handling of both case-control and case-population studies.

14 changes: 7 additions & 7 deletions vignettes/ciccr-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ library(MASS)
```


To illustrate the usefulness of the package, we use the dataset ACS_CC that is included the package. This dataset is an extract from American Community Survey (ACS) 2018, restricted to white males residing in California with at least a bachelor's degree. The ACS is an ongoing annual survey by the US Census Bureau that provides key information about US population. We use the following variables:
To illustrate the usefulness of the package, we use the dataset ACS_CC that is included in the package. This dataset is an extract from American Community Survey (ACS) 2018, restricted to white males residing in California with at least a bachelor's degree. The ACS is an ongoing annual survey by the US Census Bureau that provides key information about the US population. We use the following variables:

```{r}
y = ACS_CC$topincome
Expand Down Expand Up @@ -90,7 +90,7 @@ We carry out causal inference on relative risk by
results = cicc_RR(y, t, x, 'cc', 0.95)
```

Here, 'cc' refers to case-control sampling and 0.95 refers to the level of the uniform confidence band (0.95 is the default choice).
Here, 'cc' refers to case-control sampling and 0.95 refers to the level of the uniform confidence band; 0.95 is the default choice.

The S3 object `results` contains estimates `est`, standard errors `se`, and one-sided confidence bands `ci` at `p = 0` and `p = 1`.

Expand All @@ -109,7 +109,7 @@ It is handy to examine the results by plotting a graph.
cicc_plot(results)
```

To interpret the results, we assume both marginal treatment response (MTR) and marginal treatment selection (MTS). In this setting, MTR means that everyone will not earn less by obtaining a degree higher than bachelor's degree; MTS indicates that those who selected into higher education have higher potential to earn top incomes. Based on the MTR and MTS assumptions, we can conclude that the treatment effect lies in between 1 and the upper end point of the one-sided confidence interval with high probability. Thus, the estimates in the graph above suggest that the effect of obtaining a degree higher than bachelor's degree is anywhere between 1 and the upper end points of the uniform confidence bands. This roughly implies that the chance of earning top incomes may increase up to by a factor as large as the upper end points of the uniform confidence band, but allowing for possibility of no positive effect at all. The results are shown over the range of the unknown true case probability. See [Jun and Lee, 2020](https://arxiv.org/abs/2004.08318) for more detailed explanations regarding how to interpret the estimation results.
To interpret the results, we assume both marginal treatment response (MTR) and marginal treatment selection (MTS). In this setting, MTR means that everyone will earn no less by obtaining a degree higher than bachelor's degree; MTS indicates that those who selected into higher education have higher potential to earn top incomes. Based on the MTR and MTS assumptions, we can conclude that the treatment effect lies in between 1 and the upper end point of the one-sided confidence interval with high probability. Thus, the estimates in the graph above suggest that the effect of obtaining a degree higher than bachelor's degree is anywhere between 1 and the upper end points of the uniform confidence bands. This roughly implies that the chance of earning top incomes may increase up to by a factor as large as the upper end points of the uniform confidence band, but allowing for possibility of no positive effect at all. The results are shown over the range of the unknown true case probability. See [Jun and Lee, 2020](https://arxiv.org/abs/2004.08318) for more detailed explanations regarding how to interpret the estimation results.

### Comparison with Logistic Regression

Expand All @@ -126,11 +126,11 @@ exp(ci_logit)
```

Here, the relevant coefficient is 2.06 (`t`) and its two-sided 90% confidence interval is [1.75, 2.43]. If we assume strong ignorability, the treatment effect is about 2 and its two-sided confidence interval is between [1.75, 2.43]. However, it is unlikely that the higher BA treatment satisfies the strong ignorability condition.
Here, the relevant coefficient is 2.06 (`t`) and its two-sided 90% confidence interval is [1.75, 2.43]. If strong ignorability were plausible and causal relative risk were homogeneous, then the treatment effect would be about 2 and its two-sided confidence interval would be between [1.75, 2.43]. However, it is unlikely that the higher BA treatment satisfies the strong ignorability condition.

### Causal Inference on Attributable Risk Using Case-Control Samples

We now consider attributable risk, that is the absolute difference in probabilities.
We now consider attributable risk, that is the difference in probabilities.
We carry out causal inference on attributable risk by

```{r}
Expand All @@ -143,11 +143,11 @@ The results can be plotted as before.
cicc_plot(results_AR, parameter = 'AR')
```

The upper bounds are approximately inverted-U shaped. When $p = 0$ or $p=1$, there could no causal effect; the upper bound is maximized around $p-0.5$.
The upper bounds are approximately inverted-U shaped. When $p = 0$ or $p=1$, there can be no causal effect; the upper bound is maximized around $p=0.5$.

### Causal Inference on Relative Risk Using Case-Population Samples

We now consider an example of case-population samples. For this purpose, we use the dataset ACS_CP that is included the package. This dataset is again an extract from American Community Survey (ACS) 2018. The original ACS sample is not a case-population sample but we construct one by the following procedure.
We now consider an example of case-population samples. For this purpose, we use the dataset ACS_CP that is included in the package. This dataset is again an extract from American Community Survey (ACS) 2018. The original ACS sample is not a case-population sample but we construct one by the following procedure.

1. The case sample $(Y=1)$ is composed of 921 individuals whose income is top-coded.
2. The control sample $(Y=0)$ of equal size is randomly drawn with replacement from all observations and its top-coded status is coded missing.
Expand Down
Binary file modified vignettes/ciccr-vignette.pdf
Binary file not shown.

0 comments on commit ebcf991

Please sign in to comment.