gen_cor {CMHNPA} | R Documentation |
gen_cor Test
Description
gen_cor
returns the generalised correlations and associated p-values
together with tests of normality.
Usage
gen_cor(
x,
y,
z = NULL,
U,
V,
W = NULL,
x_scores = NULL,
y_scores = NULL,
z_scores = NULL,
n_perms = 0,
perms_info = FALSE,
rounding = 4
)
Arguments
x |
a numeric vector or factor, commonly a response variable. |
y |
a numeric vector or factor, commonly a treatment variable. |
z |
an optional numeric vector or factor, commonly a block variable. |
U |
the maximum degree of correlation relating to the variable |
V |
the maximum degree of correlation relating to the variable |
W |
the maximum degree of correlation relating to the variable |
x_scores |
optional scores related to the variable |
y_scores |
optional scores related to the variable |
z_scores |
optional scores related to the variable |
n_perms |
an optional numeric value indicating the number of permutations required. |
perms_info |
a TRUE of FALSE flag to indicate whether information regarding the progress on the number of permutations should be printed. |
rounding |
the number of decimal places the output should be rounded to. The default is 4. |
Details
This function calculates up to three way generalised correlations. The function calculates three tests by default to test if the correlations are statistically significantly different from 0 with an option to run permuation testing.
Value
This function calculates the generalised correlations for up to three input variables.
References
Rayner, J.C.W and Livingston, G. C. (2022). An Introduction to Cochran-Mantel-Haenszel Testing and Nonparametric ANOVA. Wiley.
Examples
attach(intelligence)
gen_cor(x = rank(score), y = age, U = 2, V = 2)