-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
31 lines (20 loc) · 884 Bytes
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# SurvSetup
Finds features of spells that are useful for estimating survival models.
[![Build Status](https://travis-ci.org/christophergandrud/SurvSetup.svg?branch=master)](https://travis-ci.org/christophergandrud/SurvSetup)
## Examples
```{r}
library(SurvSetup)
# Create fake data ----------------------------------------------
group_id <- c(rep('aa', 7), rep('bb', 4))
x <- c(rep('a', 4), rep('b', 3), 'c', rep('a', 2), 'c')
fake_data <- data.frame(group_id = group_id, spell = x)
head(fake_data)
# Find spell features -------------------------------------------
## Non-grouped data
spell_features(fake_data, var = 'spell')
## Grouped data
spell_features(fake_data, var = 'spell', group = 'group_id')
## Last observation treated as an event (e.g. not right-censored)
spell_features(fake_data, var = 'spell', group = 'group_id',
right_censored = FALSE)
```