Learn R Programming

pervasive (version 1.0)

OPCP: Calculate Observed Proportion of Concordant Pairs (OPCP)

Description

This function calculates the Observed Proportion of Concordant Pairs (OPCP) using Kendall's Tau as a measure of association. The pervasive functions also provide the OPCP.

Usage

OPCP(formula, data)

Value

A numeric value representing the OPCP.

Arguments

formula

A formula specifying the dependent and independent variables.

data

A data frame containing the variables specified in the formula.

Examples

Run this code
# Example using the spi dataset from the psychTools package
sc <- psych::scoreVeryFast(psychTools::spi.keys, psychTools::spi)
spi_sc <- cbind(psychTools::spi, sc)
spi_sc_vars <- spi_sc |>
  dplyr::select(age, Agree, Consc, Neuro, Extra, Open)

formula <- age ~ Agree + Consc + Neuro + Extra + Open
OPCP(formula = formula, data = spi_sc_vars)

Run the code above in your browser using DataLab