split_data {trajmsm} | R Documentation |
Split observed data into multiple subsets
Description
Function to split the data into multiple subsets of size s each one subset corresponding to one time-interval.
Usage
split_data(
obsdata,
total_followup,
ntimes_interval,
time,
time_values,
identifier
)
Arguments
obsdata |
Observed data in wide format. |
total_followup |
Total length of follow-up. |
ntimes_interval |
Number of measuring times per interval. |
time |
Name of the time variable. |
time_values |
Measuring times. |
identifier |
Identifier of individuals. |
Value
all_df |
All subsets, list of time intervals. |
Author(s)
Awa Diop Denis Talbot
Examples
obsdata = gendata(n = 1000, format = "long", total_followup = 8, seed = 945)
years <- 2011:2018
res = split_data(obsdata = obsdata, total_followup = 8,
ntimes_interval = 6,time = "time", time_values = years,identifier = "id")
[Package trajmsm version 0.1.0 Index]