Skip to contents

The regression output comes from stats::lm. T-test is performed using stats::t.test. Normality check is performed using stats::shapiro.test. Equality of variances across groups is assessed using car::leveneTest. Cohen's d is calculated using effectsize::cohens_d.

Usage

effect_metrics_one_grouped(
  data,
  col,
  cross,
  method = "lm",
  labels = TRUE,
  clean = TRUE,
  ...
)

Arguments

data

A tibble.

col

The column holding metric values.

cross

The column holding groups to compare.

method

A character vector of methods, e.g. c("t.test","lm"). Supported methods are t.test (only valid if the cross column contains two levels) and lm (regression results).

labels

If TRUE (default) extracts labels from the attributes, see codebook.

clean

Prepare data by data_clean.

...

Placeholder to allow calling the method with unused parameters from effect_metrics.

Value

A volker list object containing volker tables with the requested statistics.

Examples

library(volker)
data <- volker::chatgpt

effect_metrics_one_grouped(data, sd_age, sd_gender)
#> 
#> 
#> |Term               | estimate| ci low| ci high| standard error|     t|     p| stars|
#> |:------------------|--------:|------:|-------:|--------------:|-----:|-----:|-----:|
#> |(Intercept)        |    37.52|  33.21|   41.84|           2.18| 17.24| 0.000|   ***|
#> |female (Reference) |         |       |        |               |      |      |      |
#> |male               |     3.69|  -1.88|    9.27|           2.81|  1.31| 0.192|      |
#> |diverse            |    -4.53| -32.18|   23.13|          13.94| -0.32| 0.746|      |
#> 
#> 
#> |Statistic                     | value|
#> |:-----------------------------|-----:|
#> |Adjusted R squared            |     0|
#> |Degrees of freedom            |     2|
#> |Residuals' degrees of freedom |    98|
#> |F                             |  0.98|
#> |p                             |  0.38|
#> |stars                         |      |