View source: R/pointbiserial.R
pointbiserial | R Documentation |
Estimates the point-biserial correlation coefficient between dichotomous items and the person's score.
pointbiserial(x, wt = NULL, exclude = FALSE, listwise = FALSE, recScore = TRUE)
x |
a numeric data frame or matrix containing only two categories. |
wt |
a numeric vector of total weights. Default is |
exclude |
a logical value indicating if the point-biserial correlation
should be calculated excluding the item from the total score.
Defaulft is |
listwise |
only consider complete data (remove rows with NAs).
Defaulft is |
recScore |
a logical value indicating if the total score for
should be calculated based only on valid values. Thus,
if |
A numeric vector with the point-biserial correlation coefficients by item.
data(dichodata)
data(dichokey)
# Data preparation
## Corrected data
corr <- correct(x = dichodata, key = dichokey, navalue = NA)
## Random weights creation
set.seed(1919)
wt <- sample(x = 1:4, size = nrow(corr), replace = TRUE)
# Correlations without weights
pointbiserial(x = corr, wt = NULL)
# Correlations with weights
pointbiserial(x = corr, wt = wt)
# Correlations if item is excluded
pointbiserial(x = corr, exclude = TRUE)
# Correlations if NAs are considered 0s (recScore)
pointbiserial(x = corr, recScore = FALSE)
# Correlations with listwise
pointbiserial(x = corr, listwise = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.