Finds features of spells that are useful for estimating survival models.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.