presmooth_data {longsurr} | R Documentation |
Pre-smooth sparse longitudinal data
presmooth_data(obs_data, ...)
obs_data |
data.frame or tibble containing the observed data, with columns |
... |
additional arguments passed on to |
list containing matrices X_t
and X_c
, which are the smoothed surrogate values for the treated and control groups, respectively, for use in downstream analyses
library(dplyr)
data(full_data)
obs_ds <- group_by(full_data, id)
obs_data <- sample_n(obs_ds, 5)
obs_data <- ungroup(obs_data)
head(obs_data)
presmooth_X <- presmooth_data(obs_data)