Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

circ_compare_groups

Compare Repeated Measurements by Group


Description

Takes data and returns a summary table of continuous variable based on a categorical variable. This summary is repeat by time groups to help describe a circadian pattern.

Usage

circ_compare_groups(data, x, y, time)

Arguments

data

Dataframe containing all the following variables

x

Continuous variable of interest (x ~ y)

y

Grouping variable to apply to the cvar (x ~ y). Must be binary for t-test, otherwise will return data set without pvalues

time

Name of the time-dependent variable, usually hours

Details

Applies a simple data transformation to identify the summary statistics of the data frame by the stated variables. Results in a mean, standard deviation, and standard error term. This data is also used for making a t-test based table, which can then also be graphed in card::ggcircadian.

Value

Returns a dataframe that has the time variable, the categorical variable, and the statistics (including p-value) of the continuous variable

Examples

data("twins")
circ_compare_groups(data = twins, x = "rDYX", y = "sad_cat", time = "hour")

card

Cardiovascular and Autonomic Research Design

v0.1.0
MIT + file LICENSE
Authors
Anish S. Shah [aut, cre, cph] (<https://orcid.org/0000-0002-9729-1558>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.