Learn R Programming

pervasive (version 1.0)

OPCP_glm: 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_glm(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(sex, Agree, Consc, Neuro, Extra, Open)
  spi_sc_vars$sex = spi_sc_vars$sex -1

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

Run the code above in your browser using DataLab