prepare_data: prepare data for sfpca model

Description Usage Arguments Value Examples

View source: R/prepare_data.R

Description

prepare data for sfpca model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
prepare_data(
  data,
  unique_subject_id,
  time_name,
  response_name,
  transform_y = NULL,
  scale_time = FALSE,
  group_name = NULL,
  average = FALSE
)

Arguments

data

target longitudinal data for analysis (must be a data frame)

unique_subject_id

the column name corresponding to unique subject id in the data (string)

time_name

the column name corresponding to the time variable in the data (string)

response_name

the column name of the intersted response variable (string)

transform_y

the ways of transforming the response variable: standardize/center/NULL

scale_time

the option of whether or not to scale the time variable to be within 0, 1 (True/False)

group_name

the column name of group id, set to NA if no input

average

the option to average duplicate response values

Value

A list containing the prepared data for sfpca model

Examples

1
2
3
4
data("ECAM")
ECAM <- ECAM[!duplicated(ECAM[, c('studyid', 'month_of_life')]), ]
dat <- prepare_data(ECAM, unique_subject_id = 'studyid', time_name = 'month_of_life',
                   response_name = 'shannon', transform_y='standardize', scale_time=T)

biocore/bayestime documentation built on Nov. 15, 2020, 5:40 p.m.