fmd_scaled_mixedtwANOVA: Allometric scaling for flow-mediated dilation: Mixed two-way...

View source: R/fmd_scaled_mixedtwANOVA.R

fmd_scaled_mixedtwANOVAR Documentation

Allometric scaling for flow-mediated dilation: Mixed two-way ANOVA

Description

This function calculates allometrically-scaled flow-mediated dilation responses for a mixed two-way ANOVA study design and returns pairwise comparisons between groups with a conservative Tukey post-hoc correction. The function will also return transformed means, standard errors, and 95% confidence intervals.

Usage

fmd_scaled_mixedtwANOVA(dat)

Arguments

dat

Data frame object; does not have to be named 'dat', but the columns that correspond to peak artery diameter, baseline artery diameter, group (or condition), and time must be labeled "dpeak", "dbase", "group", and "time", respectively.

Value

This function returns the following:

modelcoef

A dataframe that contains the model coeficients from a linear mixed effects model

tf.emmeans

Backtransformed estimated marginal means

maingroup

Frequentist comparisons accross groups or conditions

maintime

Frequentist comparisons accross times or conditions.

interactiongroup

Linear and quadratic contrasts of group for each time. From the emmeans package.

interactiontime

Linear and quadratic contrasts of time for each group. From the emmeans package.

all.comparisons

Pairwise comparisons accross main effects and interactions. Treated with Tukey post-hot correction method and Kenward-Roger degrees of freedom method. Output from the emmeans package.

plot

Graphical representation using ggplot syntax

Examples

Simulated exercise intervention data consisting of an independent grouping (CON, MICT, SIT) x repeated measures at different times (0, 6 weeks):

dat <- data.frame(dbase = rnorm(300, 4.1, 1.2), dpeak = rnorm(300, 4.3, 1.1), group = as.factor(sort(rep(c("CON", "SIT", "MICT"), 100))), time = as.factor(rep(sort(rep(c("0wk", "6wk"), 50)), 3)), pid = as.factor(c(rep(1:50, 2), rep(51:100, 2), rep(101:150, 2))))
dat <- dat |>
dplyr::arrange(pid)

res <- fmd_scaled_mixedtwANOVA(dat)


jcherubini/Rtery documentation built on April 17, 2025, 3:07 p.m.