Package 'recmetrics'

Title: Psychometric Evaluation Using Relative Excess Correlations
Description: Modern results of psychometric theory are implemented to provide users with a way of evaluating the internal structure of a set of items guided by theory. These methods are discussed in detail in VanderWeele and Padgett (2024) <doi:10.31234/osf.io/rnbk5>. The relative excess correlation matrices will, generally, have numerous negative entries even if all of the raw correlations between each pair of indicators are positive. The positive deviations of the relative excess correlation matrix entries help identify clusters of indicators that are more strongly related to one another, providing insights somewhat analogous to factor analysis, but without the need for rotations or decisions concerning the number of factors. A goal similar to exploratory/confirmatory factor analysis, but 'recmetrics' uses novel methods that do not rely on assumptions of latent variables or latent variable structures.
Authors: R. Noah Padgett [aut, cre, cph]
Maintainer: R. Noah Padgett <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2025-02-22 03:23:39 UTC
Source: https://github.com/noah-padgett/recmetrics

Help Index


Append Observed Correlations to Data

Description

Compute observed residuals for each variables in data and appends these newly created variables to the original dataset.

Usage

append_observed_residuals(data, na.rm = TRUE)

Arguments

data

A data.frame or tibble

na.rm

logical (defaults to TRUE)

Value

A numeric matrix of correlations among variable residuals.

Examples

# Use the SCWB data example
  data(SCWB)
  append_observed_residuals(SCWB[, 1:20])

Observed Residual Correlations

Description

Compute observed residual correlation (ORC) matrix among observed residuals for variables supplied data.

Usage

cor.orc(data, na.rm = TRUE)

Arguments

data

A data.frame or tibble

na.rm

logical (defaults to TRUE)

Details

[Experimental]

Value

A numeric matrix of correlations among variable residuals.

Examples

# Use the SCWB data example
  data(SCWB)
  cor.orc(SCWB[, 1:20])

Relative Excess Correlations

Description

Compute relative excess correlation (REC) matrix among variables in supplied data.

Usage

cor.rec(data, na.rm = TRUE)

Arguments

data

A data.frame or tibble

na.rm

logical (defaults to TRUE)

Details

[Experimental]

Value

A numeric matrix of correlations among variable residuals.

Examples

# Use the SCWB data example
  data(SCWB)
  cor.rec(SCWB[, 1:20])

Compute rowMeans of a correlation matrix

Description

A wrapper for computing the mean of the rows of a correlation matrix.

Usage

cor.rowMeans(x, na.rm = TRUE)

Arguments

x

A correlations

na.rm

logical (defaults to TRUE)

Value

A numeric vector of correlation means.

Examples

# Use the SCWB data example
  data(SCWB)
  mycor <- cor(SCWB)
  cor.rowMeans(mycor)

Observed Residual Covariances

Description

Compute observed residual covariances (ORC) matrix among observed residuals for variables supplied data.

Usage

cov.orc(data, na.rm = TRUE)

Arguments

data

A data.frame or tibble

na.rm

logical (defaults to TRUE)

Details

[Experimental]

Value

A numeric matrix of correlations among variable residuals.

Examples

# Use the SCWB data example
  data(SCWB)
  cov.orc(SCWB[, 1:20])

Relative Excess Covariances

Description

Compute relative excess covariances (REC) matrix among variables in supplied data.

Usage

cov.rec(data, na.rm = TRUE)

Arguments

data

A data.frame or tibble

na.rm

logical (defaults to TRUE)

Details

[Experimental]

Value

A numeric matrix of correlations among variable residuals.

Examples

# Use the SCWB data example
  data(SCWB)
  cov.rec(SCWB[, 1:20])

REC Metric 1

Description

The average of the absolute values of the C-REC matrix entries (this is essentially how much relative excess correlation there is still to distribute across groupings)

Usage

rec.average(data, na.rm = TRUE)

Arguments

data

A data.frame or tibble (required)

na.rm

logical (defaults to TRUE)

Details

[Experimental]

Value

A single numerical value

Examples

{
  # Use the SCWB data example
  # Metric 1 - item scores
  rec.average(SCWB[, 1:20])
  # Metric 4 - domain total scores
  my_rec <- rec.average(SCWB[, 21:25])
  my_rec
  # Metric 4 - averages
  mean(abs(my_rec[lower.tri(my_rec)]))
}

REC Metric 2

Description

For each domain i, the average of the REC entries within domain vs. the average of the REC entries when looking at correlations between indicators in domain D=i with indicators in domains other than i (note that this does NOT include correlations in domain j with other indicators in domain j; for a given domain, it is basically the average of the REC entries within the domain vs. the average of the REC entries for all of the other entries in the column of that domain). We might call this the REC domain coherence for domain i

Usage

rec.avg.wb.domains(data, domainlist = NULL, domainnames = NULL, na.rm = TRUE)

Arguments

data

A data.frame or tibble (required)

domainlist

A list of character vectors or numeric vectors denoting the columns for each domain (required)

domainnames

A character vector supplying updated names to be attached to output

na.rm

logical (defaults to TRUE)

Details

[Experimental]

Value

A single numerical value

Examples

# Use the SCWB data example
  mylist <- list(
    domain_goodrel = c("cwbcloserel", "cwbrespect", "cwbtrust", "cwbmutuality"),
    domain_prolead = c("cwbbeneficence", "cwbintegrity", "cwbcompetence", "cwbvision"),
    domain_healthyprac = c("cwbrelgrowth", "cwbfairness", "cwbsustenance", "cwbachieve"),
    domain_satcomm = c("cwbsatisf", "cwbvalue", "cwbbelonging", "cwbwelcome"),
    domain_strongmiss = c("cwbpurpose", "cwbcontrib", "cwbinterconn", "cwbsynergy")
  )
  rec.avg.wb.domains(SCWB, mylist)

REC Metric 3

Description

The average value of the REC domain coherence taken across domains (which, when the domains all have the same number of indicators, I believe will also equal the average within-domain REC vs. the average cross-domain REC); this gives a measure of the coherence of the partition formed by the various domains as a whole

Usage

rec.coherence(data, domainlist = NULL, domainnames = NULL, na.rm = TRUE)

Arguments

data

A data.frame or tibble (required)

domainlist

A list of character vectors or numeric vectors denoting the columns for each domain (required)

domainnames

A character vector supplying updated names to be attached to output

na.rm

logical (defaults to TRUE)

Details

[Experimental]

Value

A single numerical value

Examples

# Use the SCWB data example
  mylist <- list(
    domain_goodrel = c("cwbcloserel", "cwbrespect", "cwbtrust", "cwbmutuality"),
    domain_prolead = c("cwbbeneficence", "cwbintegrity", "cwbcompetence", "cwbvision"),
    domain_healthyprac = c("cwbrelgrowth", "cwbfairness", "cwbsustenance", "cwbachieve"),
    domain_satcomm = c("cwbsatisf", "cwbvalue", "cwbbelonging", "cwbwelcome"),
    domain_strongmiss = c("cwbpurpose", "cwbcontrib", "cwbinterconn", "cwbsynergy")
  )
  rec.coherence(SCWB, mylist)

REC Metric 3

Description

An (Number of Items)x(Number of Domains) matrix such that each row corresponds to an indicator, and the entry in column i is the average REC score for that indicator with the other indicators in domain i. This will allow one in some sense to see if certain indicators seem to have higher REC scores in a domain other than to the other in which they were assigned

Usage

rec.pattern.matrix(
  data,
  domainlist = NULL,
  domainnames = NULL,
  labels = NULL,
  na.rm = TRUE
)

Arguments

data

A data.frame or tibble (required)

domainlist

A list of character vectors or numeric vectors denoting the columns for each domain (required)

domainnames

A character vector supplying updated names to be attached to output

labels

A character vector supplying updated variable names to be attached to output

na.rm

logical (defaults to TRUE)

Details

[Experimental]

Value

A single numerical value

Examples

# Use the SCWB data example
  mylist <- list(
    domain_goodrel = c("cwbcloserel", "cwbrespect", "cwbtrust", "cwbmutuality"),
    domain_prolead = c("cwbbeneficence", "cwbintegrity", "cwbcompetence", "cwbvision"),
    domain_healthyprac = c("cwbrelgrowth", "cwbfairness", "cwbsustenance", "cwbachieve"),
    domain_satcomm = c("cwbsatisf", "cwbvalue", "cwbbelonging", "cwbwelcome"),
    domain_strongmiss = c("cwbpurpose", "cwbcontrib", "cwbinterconn", "cwbsynergy")
  )
  rec.pattern.matrix(SCWB, mylist)

Subjective Community Well-Being Dataset (25 Variables)

Description

These Subjective Community Well-Being (SCWB) data are a random subset from the full dataset used in the paper by Padgett et al. (in press). The SCWB dataset contains 501 responses to the 20 SCWB items plus 5 pre-computed total scores on the five theorized domains of Good Relationships, Proficient Leadership, Healthy Practices, Satisfying Community, and Strong Mission.

Usage

data(SCWB)

Format

SCWB A data frame with 501 observations of 25 variables.

cwbcloserel
cwbrespect
cwbtrust
cwbmutuality
cwbbeneficence
cwbintegrity
cwbcompetence
cwbvision
cwbrelgrowth
cwbfairness
cwbsustenance
cwbachieve
cwbsatisf
cwbvalue
cwbbelonging
cwbwelcome
cwbpurpose
cwbcontrib
cwbinterconn
cwbsynergy
total_goodrel

Mean of items cwbcloserel, cwbrespect, cwbtrust, cwbmutuality

total_prolead

Mean of items cwbbeneficence, cwbintegrity, cwbcompetence, cwbvision

total_healthyprac

Mean of items cwbrelgrowth, cwbfairness, cwbsustenance, cwbachieve

total_satcomm

Mean of items cwbsatisf, cwbvalue, cwbbelonging, cwbwelcome

total_strongmiss

Mean of items cwbpurpose, cwbcontrib, cwbintercon, cwbsynergy

Source

Data used in Padgett et al. (in press).

References

Padgett, R.N., ...

Examples

# SCWB example used in preprint
data(SCWB)