Skip to content

Commit a0e75ba

Browse files
gvegayonCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 6201c1f commit a0e75ba

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Our methods can also handle outcomes missing at random. Details about
1010
the study design, assumptions, methodology and implementation can be
1111
found in the vignettes and paper.
1212

13-
## Installment
13+
## Installation
1414

1515
Users can install `comprehensivecohort` using the
1616
<a href="https://cran.r-project.org/package=remotes"
@@ -25,7 +25,7 @@ Or install from CRAN:
2525
## Example
2626

2727
The package includes a simulated dataset based on the TOIB study, a
28-
comprehensive cohort study aiming to determine whether to advice older
28+
comprehensive cohort study aiming to determine whether to advise older
2929
adults with chronic knee pain to apply either topical or oral
3030
non-steroidal anti-inflammatory drugs (NSAIDs) for knee pain management.
3131
The dataset include 563 observations with outcome $Y$ as Western Ontario

README.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ format: gfm
77
The `comprehensivecohort` package provides functions for estimating the comprehensive cohort causal effects (CCCE) in comprehensive cohort studies. We develop a semiparametric sensitivity analysis framework for assessing the impact of unmeasured confounding in the observational arm. Our methods can also handle outcomes missing at random. Details about the study design, assumptions, methodology and implementation can be found in the vignettes and paper.
88

99

10-
## Installment
10+
## Installation
1111

1212
Users can install `comprehensivecohort` using the [`remotes`](https://cran.r-project.org/package=remotes){target="_blank"} R package:
1313

@@ -21,7 +21,7 @@ Or install from CRAN:
2121

2222
## Example
2323

24-
The package includes a simulated dataset based on the TOIB study, a comprehensive cohort study aiming to determine whether to advice older adults with chronic knee pain to apply either topical or oral non-steroidal anti-inflammatory drugs (NSAIDs) for knee pain management. The dataset include 563 observations with outcome $Y$ as Western Ontario and McMaster Universities Osteoarthritis Index (WOMAC) pain score ($0-100$) at 12 months. Some outcome observations might be missing (denoted as NA in $Y$). Column $M$ is a outcome missingness indicator: $1$ if $Y$ is observed, $0$ if $Y$ is missing. Other variables in the dataset include $t$ the treatment indicator ($1$ for topical NSAIDs, $0$ for oral NSAIDs), and $R$ the randomization consent indicator ($1$ for RCT, $0$ for OBS). Rest of the columns are baseline covariates (age, baseline WOMAC pain score, expected pain one year later, chronic pain grade).
24+
The package includes a simulated dataset based on the TOIB study, a comprehensive cohort study aiming to determine whether to advise older adults with chronic knee pain to apply either topical or oral non-steroidal anti-inflammatory drugs (NSAIDs) for knee pain management. The dataset include 563 observations with outcome $Y$ as Western Ontario and McMaster Universities Osteoarthritis Index (WOMAC) pain score ($0-100$) at 12 months. Some outcome observations might be missing (denoted as NA in $Y$). Column $M$ is a outcome missingness indicator: $1$ if $Y$ is observed, $0$ if $Y$ is missing. Other variables in the dataset include $t$ the treatment indicator ($1$ for topical NSAIDs, $0$ for oral NSAIDs), and $R$ the randomization consent indicator ($1$ for RCT, $0$ for OBS). Rest of the columns are baseline covariates (age, baseline WOMAC pain score, expected pain one year later, chronic pain grade).
2525

2626
```{r}
2727
#| error: true

vignettes/Intro.qmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,16 @@ The dataset has 563 observations and 8 variables, which include:
129129

130130
## Application
131131

132-
The primary function is `est_psi()`, which returns point estimates, estimated variance and $95\%$ Walds confidence interval for $\psi_t(\widetilde{P}; \gamma_t)$, $\psi_{t, 0}(\widetilde{P}; \gamma_t)$ and $\psi_{t, 1}(\widetilde{P})$ under one or more pre-specified $\gamma_t$.
132+
The primary function is `est_psi()`, which returns point estimates, estimated variance and $95\%$ Wald confidence interval for $\psi_t(\widetilde{P}; \gamma_t)$, $\psi_{t, 0}(\widetilde{P}; \gamma_t)$ and $\psi_{t, 1}(\widetilde{P})$ under one or more pre-specified $\gamma_t$.
133133

134134
Users need to input data and specify several parameters:
135135

136-
* Data: <span style="color: blue;">Y</span>, <span style="color: blue;">M</span>, <span style="color: blue;">R</span>, <span style="color: blue;">t</span>, <span style="color: blue;">M</span> (baseline covariates in the form of data frame)
136+
* Data: <span style="color: blue;">Y</span>, <span style="color: blue;">M</span>, <span style="color: blue;">R</span>, <span style="color: blue;">t</span>, <span style="color: blue;">X</span> (baseline covariates as a data frame)
137137
* Estimand of interest: <span style="color: blue;">trt</span>=1 if estimating $E[Y(1)]$, $E[Y(1)|R=0]$ and $E[Y(1)|R=1]$; <span style="color: blue;">trt</span>=0 if estimating $E[Y(0)]$, $E[Y(0)|R=0]$ and $E[Y(0)|R=1]$
138138
* Sensitivity parameters: <span style="color: blue;">gamma</span>, a vector of $\gamma_t$ value.
139-
* Single index model settings [@redd2025sensiatrpackageconducting]: <span style="color: blue;">kernel</span>, kernel smoothing, choices of Gaussian and Epanechnikov kernel; <span style="color: blue;">single_index_method</span>, types of constraints in estimation, choices of setting first coefficient to 1, norm of coefficients to 1, and bandwidth to 1; <span style="color: blue;">method</span>, optimization methods, default to `optim`; <span style="color: blue;">use_mave</span>, whether to apply MAVE [@mave_xia_2002; @mave_wang_2008] or cumulative sliced inverse regression method [@slice_zhu_2010] to estimate initial value of the coeffficients, default to TRUE.
139+
* Single index model settings [@redd2025sensiatrpackageconducting]: <span style="color: blue;">kernel</span>, kernel smoothing, choices of Gaussian and Epanechnikov kernel; <span style="color: blue;">single_index_method</span>, types of constraints in estimation, choices of setting first coefficient to 1, norm of coefficients to 1, and bandwidth to 1; <span style="color: blue;">method</span>, optimization methods, default to `optim`; <span style="color: blue;">use_mave</span>, whether to apply MAVE [@mave_xia_2002; @mave_wang_2008] or cumulative sliced inverse regression method [@slice_zhu_2010] to estimate initial value of the coefficients, default to TRUE.
140140
* Truncation methods: <span style="color: blue;">simple_trunc</span>=TRUE to apply quantile truncation of $\frac{1}{\pi_{t, r}(X)}$ and $\frac{1}{\eta_m(X, r, t)}$, <span style="color: blue;">simple_trunc</span>=FALSE to apply tuning-free Huberization procedure [@tuning_wang_2021] to influence functions. If <span style="color: blue;">simple_trunc</span>=TRUE, specify quantile truncation by setting <span style="color: blue;">quant</span> from 0 to 1.
141-
* K-fold sample splitting: <span style="color: blue;">fold</span>=K, a integer. <span style="color: blue;">seed</span>, set.seed(seed).
141+
* K-fold sample splitting: <span style="color: blue;">fold</span>=K, an integer. <span style="color: blue;">seed</span>, set.seed(seed).
142142

143143
Here is an example of inferences for $\psi_1(\widetilde{P}; \gamma_1)$, $\psi_{1, 0}(\widetilde{P}; \gamma_1)$ and $\psi_{1, 1}(\widetilde{P})$ under $\gamma_1=0, 0.5$, using 5-fold sample splitting, influence function truncation procedure and specific single index model settings.
144144

0 commit comments

Comments
 (0)