powered by
This function calculates the optimal interval length for regularizing irregular longitudinal data based on the given subject ID and time columns.
intlen(data, subject_col, time_col)
Computed preferred interval length.
A data frame containing the irregular longitudinal data.
The column name for unique subject IDs.
The column name for time points.
The function calculates the optimal interval length based on the observed range of time points and the average number of measurements per subject.
sdata <- sdata[1:100,] intlen(sdata, "subject_id", "time")
Run the code above in your browser using DataLab