Skip to contents

The correlation is calculated using stats::cor.test.

Usage

effect_metrics_items_cor(
  data,
  cols,
  cross,
  method = "pearson",
  labels = TRUE,
  clean = TRUE,
  ...
)

Arguments

data

A tibble containing item measures.

cols

Tidyselect item variables (e.g. starts_with...).

cross

The column holding metric values to correlate.

method

The output metrics, pearson = Pearson's R, spearman = Spearman's rho.

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 table containing correlations.

Examples

library(volker)
data <- volker::chatgpt

effect_metrics_items_cor(
  data, starts_with("cg_adoption_adv"), sd_age
)
#> 
#> 
#> |Expectations: Correlation with Age                          | R squared|  n| Pearson's r| ci low| ci high| df|     t|     p| stars|
#> |:-----------------------------------------------------------|---------:|--:|-----------:|------:|-------:|--:|-----:|-----:|-----:|
#> |ChatGPT has clear advantages compared to similar offerings. |      0.01| 99|       -0.12|  -0.31|    0.08| 97| -1.16| 0.249|      |
#> |Using ChatGPT brings financial benefits.                    |      0.01| 99|       -0.09|  -0.29|    0.11| 97| -0.93| 0.356|      |
#> |Using ChatGPT is advantageous in many tasks.                |      0.00| 99|       -0.06|  -0.25|    0.14| 97| -0.56| 0.579|      |
#> |Compared to other systems, using ChatGPT is more fun.       |      0.01| 99|       -0.12|  -0.31|    0.08| 97| -1.18| 0.239|      |
#> 
#> 2 missing case(s) omitted.
#>