Skip to content

Commit

Permalink
Update vignettes + NEWS w.r.t. new interface change in as_ped. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adibender committed Nov 4, 2019
1 parent 3b908cb commit e8d8361
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pammtools
Title: Piece-Wise Exponential Additive Mixed Modeling Tools for Survival Analysis
Version: 0.1.14
Date: 2019-09-05
Version: 0.1.15
Date: 2019-11-02
Authors@R: c(
person("Andreas", "Bender", , "[email protected]", role = c("aut", "cre"), comment=c(ORCID = "0000-0001-5628-8611")),
person("Fabian", "Scheipl", , "[email protected]", role = c("aut")))
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# pammtools 0.1.15
* Interface for specification of data transformation in `as_ped` changed. The vertical bar `|` is no longer necessary to indicate concurrent or cumulative effects

# pammtools 0.1.14

* Support for new interface to tidyr
Expand Down
2 changes: 1 addition & 1 deletion vignettes/cumulative-effects.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ and need to be considered at the beginning of the analysis as this information
goes into the code for the data transformation:

```{r, message = FALSE}
ped <- as_ped(list(event_df, tdc_df), Surv(time, outcome)~ . |
ped <- as_ped(list(event_df, tdc_df), Surv(time, outcome)~ . +
cumulative(latency(day), SOFA, tz_var = "day",
ll_fun = function(t, tz) t >= tz & t <= tz + 5),
cut = 0:49, # administrative censoring at t = 49
Expand Down
14 changes: 7 additions & 7 deletions vignettes/data-transformation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Using the `pammtools` package this is easily achieved with the `as_ped` function
as follows:

```{r}
ped <- as_ped(Surv(time, status)~., data = veteran, id = "id")
ped <- as_ped(Surv(time, status) ~ ., data = veteran, id = "id")
ped %>% filter(id %in% c(42, 85, 112)) %>% select(-diagtime, -prior)
```

Expand Down Expand Up @@ -114,7 +114,7 @@ $\kappa_0 = 0, \kappa_1 = 50, \kappa_2 = 200, \kappa_3 = 400$,
resulting in $J = 3$ intervals:

```{r}
ped2 <- as_ped(Surv(time, status)~., data = veteran, cut = c(0, 50, 200, 400),
ped2 <- as_ped(Surv(time, status) ~ ., data = veteran, cut = c(0, 50, 200, 400),
id = "id")
ped2 %>% filter(id %in% c(42, 85, 112)) %>% select(-diagtime, -prior)
```
Expand Down Expand Up @@ -162,7 +162,7 @@ updated.
```{r}
ped_pbc <- as_ped(
data = list(pbc, pbcseq),
formula = Surv(time, status) ~ . | concurrent(bili, protime, tz_var = "day"),
formula = Surv(time, status) ~ . + concurrent(bili, protime, tz_var = "day"),
id = "id")
```

Expand All @@ -172,7 +172,7 @@ lags. This will increase the data set, as an (additional) split point will be ge

```{r, eval = FALSE}
pbc_ped <- as_ped(data = list(pbc, pbcseq),
formula = Surv(time, status) ~ . | concurrent(bili, tz_var = "day") +
formula = Surv(time, status) ~ . + concurrent(bili, tz_var = "day") +
concurrent(protime, tz_var = "day", lag = 10),
id = "id")
```
Expand Down Expand Up @@ -292,7 +292,7 @@ however, you can override the suffix by specifying the
```{r}
ped <- as_ped(
data = list(patient, daily),
formula = Surv(survhosp, PatientDied) ~ . |
formula = Surv(survhosp, PatientDied) ~ . +
cumulative(latency(Study_Day), caloriesPercentage, tz_var = "Study_Day"),
cut = 0:30,
id = "CombinedID")
Expand All @@ -316,7 +316,7 @@ $t-t_z$ occurs in both partial effects, we only need to specify one `cumulative`
```{r}
ped <- as_ped(
data = list(patient, daily),
formula = Surv(survhosp, PatientDied) ~ . |
formula = Surv(survhosp, PatientDied) ~ . +
cumulative(survhosp, latency(Study_Day), caloriesPercentage, proteinGproKG,
tz_var = "Study_Day"),
cut = 0:30,
Expand Down Expand Up @@ -355,7 +355,7 @@ specifications as illustrated below:
```{r}
ped_sim <- as_ped(
data = simdf_elra,
formula = Surv(time, status) ~ . |
formula = Surv(time, status) ~ . +
cumulative(time, latency(tz1), z.tz1, tz_var = "tz1") +
cumulative(latency(tz2), z.tz2, tz_var = "tz2"),
cut = 0:10,
Expand Down
Binary file removed vignettes/pamtutorial.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion vignettes/smj-tutorial.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ In: Statistical Modelling 18.3-4 (Jun. 2018), pp. 299-321. ISSN: 1471-082X. DOI:

<br>&nbsp;

<embed src="pamtutorial.pdf" width="100%" height="600" type="application/pdf">
<embed src="https://adibender.netlify.com/files/pamtutorial.pdf" width="100%" height="600" type="application/pdf">

<!-- \includepdf[pages=-]{pamtutorial.pdf} -->
2 changes: 1 addition & 1 deletion vignettes/tdcovar.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ pbc <- pbc %>% filter(id <= 312) %>%
mutate(status = 1L * (status == 2))
pbc_ped <- as_ped(
data = list(pbc, pbcseq),
formula = Surv(time, status) ~ . | concurrent(bili, protime, tz_var = "day"),
formula = Surv(time, status) ~ . + concurrent(bili, protime, tz_var = "day"),
id = "id")
```

Expand Down

0 comments on commit e8d8361

Please sign in to comment.