MDunatten: Unattenuation of Correlation Matrices

Description Usage Arguments Details Value Note References Examples

Description

Correct for attentuation. Operates on a list of correlation matrices.

Usage

1
  MDunatten(cor.mats, reals)

Arguments

cor.mats

A list of correlation matrices. Length of this list will be equal to the number of rows in the object passed to the reals argument.

reals

A matrix/data.frame of reliabilities. The column names must match the column/rownames of the correlation matrices exactly (order does not matter).

Details

Uses Spearman's (1904) formula:

ρ = \frac{r_{xy}}{√{r_{xx}r_{yy}}}

If a realibility is missing (NA) 1 will be used as a conservative estimate.

Value

Returns a list of correlation matrices corrected for attentuation.

Note

Reliability column names must match exactly(including case) the row/column names of the correlation matrices. If needed add a column of NAs.

References

Spearman, C. (1904) The proof and measurement of association between two things. The American Journal of Psychology, 15(1), 72-101.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
path <- system.file("extdata/bibTest.bib", package = "metaDAT")
dat <- read.MD(path)
realiabilities <- do.call(cbind, lapply(MDget(dat, c("disc_phi",
    "dp_phi", "ee_phi", "pa_phi")), as.numeric))
rownames(realiabilities) <- names(dat)
correlations <- MDapply(dat, "correlation_triangle", MDlist2matrix)
#matching reliability column names to correlation row/col names
colnames(realiabilities) <- c("disc", "EE", "PA", "DP")
rownames(realiabilities) == names(correlations) #sanity check
MDunatten(correlations, realiabilities)
#reassign
dat <- MDassign(dat, "att.cor", MDunatten(correlations, realiabilities))
dat

trinker/metaDAT documentation built on May 31, 2019, 8:52 p.m.