Skip to contents

This function computes p-values using RM-ANOVA for each variable in vars and grouping (time) variable specified in group

Usage

ana_fn_rm_aov(df, vars, group, id, add_cohen = FALSE)

Arguments

df

data.frame (in long format)

vars

Vector of variable names

group

Name of grouping (time) variable

id

ID var (unique identifier)

add_cohen

(logical) Whether to add Cohen's d in addition to p-values

Value

data.frame with Var and p (formatted p-values) columns

Details

This should be passed as ana_fn when calling get_desc_table() with group and id arguments to obtain p-values. Alternatively, this is the ana_fn used in wrapper get_desc_time() when data.frame is not yet in long format.

Examples

df |>
   to_long(list(score=c("y1", "y2"))) |>
   ana_fn_rm_aov(vars="score", group="Time", id="id", add_cohen=TRUE)
#>     Var    p  Diff Cohen
#> 1 score .338 -0.03  -.04