Learn R Programming

umx (version 4.9.0)

umx_r_test: Test the difference between correlations for significance.

Description

umx_r_test is a wrapper around the cocor test of difference between correlations.

Usage

umx_r_test(
  data = NULL,
  vars = vars,
  alternative = c("two.sided", "greater", "less")
)

Arguments

data

The dataset.

vars

Three or 4 variables forming the two pairs of columns.

alternative

A two (default) or one-sided (greater less) test.

Value

cocor result.

Details

Non-overlapping (no variable in common) correlations in the same dataset. If 4 variables are provided in vars, umx_r_test conducts a test of the correlation of var 1 & 2 differs in magnitude from the correlation of var 3 with var 4. (r.jk and r.hm in cocor speak).

Overlapping (1 variable in common) correlations in the same dataset. If 3 variables are provided in vars, umx_r_test conducts a test of whether the correlation of var 1 & 2 differs in magnitude from the correlation of var 1 with var 3. (r.jk and r.jh in cocor speak).

In the future it will be expanded to handle other correlations, and to take correlations as input.

See Also

Other Miscellaneous Stats Helpers: FishersMethod(), SE_from_p(), geometric_mean(), harmonic_mean(), oddsratio(), reliability(), umxCov2cor(), umxHetCor(), umxWeightedAIC(), umx_apply(), umx_cor(), umx_means(), umx_round(), umx_scale(), umx_var(), umx

Examples

Run this code
# NOT RUN {
# Is the correlation of mpg with cylinder count different from that 
# obtaining between disp and hp?
vars = c("mpg", "cyl", "disp", "hp")
umx_r_test(mtcars, vars)
umx_r_test(mtcars, c("mpg", "disp", "hp"))
# }

Run the code above in your browser using DataLab