diff --git a/.DS_Store b/.DS_Store index 8075fce..83c4c42 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/NEWS.md b/NEWS.md index 536c0b3..df080fc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000..0c2c234 --- /dev/null +++ b/cran-comments.md @@ -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. + diff --git a/vignettes/ciccr-vignette.Rmd b/vignettes/ciccr-vignette.Rmd index 5988ef6..e32af8e 100644 --- a/vignettes/ciccr-vignette.Rmd +++ b/vignettes/ciccr-vignette.Rmd @@ -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 @@ -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`. @@ -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 @@ -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} @@ -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. diff --git a/vignettes/ciccr-vignette.pdf b/vignettes/ciccr-vignette.pdf index f42c829..21a46d3 100644 Binary files a/vignettes/ciccr-vignette.pdf and b/vignettes/ciccr-vignette.pdf differ