RAR_CorrByTime: RAR Correlation by Localized Measures

View source: R/RAR_CorrByTime.R

RAR_CorrByTimeR Documentation

RAR Correlation by Localized Measures

Description

This function correlates 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.

Usage

RAR_CorrByTime(df_measures, df_outcome = NULL, id_column = NULL,
  second_var, corr_type = c("pearson", "kendall", "spearman"))

Arguments

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

second_var

specifies the column name in the dataframe that contains the outcome of interest.

corr_type

specifies the type of correlation, e.g. ("pearson", "kendall", "spearman"). Remaining options are defaults of cor.test with exact p-value = FALSE

Author(s)

Jessica Graves


JessLGraves/RAR documentation built on April 5, 2025, 3:42 p.m.