Skip to content

Commit

Permalink
added quick start example
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsantiagoquevedo authored Dec 4, 2024
1 parent b786924 commit 9cf6f87
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions posts/vaccineff_v1.0.0/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,46 @@ maintainability.
* **`cohortdata`** has been simplified and reduced to improve examples and
reduce computation time.

## Quick start

To start with `{vaccineff 1.0.0}`, run the following example.
This example estimates VE using the package's example dataset, adjusted
for confounders (age and sex) via the iterative matching strategy.

The `summary()` method for the `vaccineff_data` object provides details
on cohort balance and composition before and after applying the matching
strategy, as well as general cohort features.

When called on the `vaccineff` object (`ve`), the `summary()` method
returns the estimation summary, including results from the Schoenfeld
test for proportional hazards.


```{r}
library(vaccineff)
# Create `vaccineff_data`
data(cohortdata)
vaccineff_data <- make_vaccineff_data(
data_set = cohortdata,
outcome_date_col = "death_date",
censoring_date_col = "death_other_causes",
vacc_date_col = "vaccine_date_2",
vaccinated_status = "v",
unvaccinated_status = "u",
immunization_delay = 15,
end_cohort = as.Date("2021-12-31"),
match = TRUE,
exact = "sex",
nearest = c(age = 1)
)
summary(vaccineff_data)
# Estimate VE
ve <- estimate_vaccineff(vaccineff_data, at = 180)
summary(ve)
```

## Acknowledgements

```{r ctbs, results='asis', echo=FALSE, message = FALSE}
Expand Down

0 comments on commit 9cf6f87

Please sign in to comment.