presmooth_data {longsurr}R Documentation

Pre-smooth sparse longitudinal data

Description

Pre-smooth sparse longitudinal data

Usage

presmooth_data(obs_data, ...)

Arguments

obs_data

data.frame or tibble containing the observed data, with columns id identifying the individual measured, tt identifying the time of the observation, x the value of the surrogate at time tt, and a indicating 1 for treatment arm and 0 for control arm.

...

additional arguments passed on to fpca

Value

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

Examples

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)

[Package longsurr version 1.0 Index]