effect_metrics_items_cor {volker}R Documentation

Output correlation coefficients for items and one metric variable

Description

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 itemwise correlations:

If method = "pearson":

If method = "spearman":

Examples

library(volker)
data <- volker::chatgpt

effect_metrics_items_cor(
  data, starts_with("cg_adoption_adv"), sd_age
)


[Package volker version 3.1.0 Index]