View source: R/RAR_RegByTime.R
RAR_RegByTime | R Documentation |
This function performs linear regression on localized RAR measures for an entire sample (mean, standard deviation, and relative activity) at each time bin against an outcome of interest. This function will take a dataframe that contains RAR_Localized() measures with an outcome of interest already merged in. Or, it will take two separate dataframes, one with the RAR_Localized() measures and one with the outcome. If using two dataframes, you must specifiy the ID column, which will be used to merge the two together within the funciton.
RAR_RegByTime(df_measures, df_outcome = NULL, id_column = NULL,
y_variable, formula, model_name = NULL, time_type = NULL,
plots = c(TRUE, FALSE))
df_measures |
dataframe containing columns from RAR_Localized() for each subject. Mean, Standard Deviation, and Relative Activity columns must be named mean.act, sd.act, and rel.act, respectively. This dataframe must also have an id column. If dataframe is already merged with outcome of interest, leave df_outcome |
df_outcome |
dataframe containing outcome of interest. This dataframe must also have an id column, which is named the same as df_measures id column. |
id_column |
specifies the column name in df_measures and df_outcome that corresponds to the id |
y_variable |
a string describing outcome of interest (e.g, "Depression score") |
formula |
formula to run lm model, e.g. score ~ mean.act. |
model_name |
a string describing the model predictors, e.g. "Mean Activity". Optional. |
time_type |
a string describing the time type, e.g. "Person Time" or "Clock Time". Optional. |
plots |
a logical specifying if the user would like plot to be outputted. Default is FALSE |
Jessica Graves
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.