gen_cor {CMHNPA} | R Documentation |
gen_cor
returns the generalised correlations and associated p-values
together with tests of normality.
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
)
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. |
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.
This function calculates the generalised correlations for up to three input variables.
Rayner, J.C.W and Livingston, G. C. (2022). An Introduction to Cochran-Mantel-Haenszel Testing and Nonparametric ANOVA. Wiley.
attach(intelligence)
gen_cor(x = rank(score), y = age, U = 2, V = 2)