I am new to R and have been trying to solve this problem by myself for many hours without success.
I am conducting logistic regression and have used the glm() function for univariable analysis.
I have 15 categorical variables that I need to test for colinearity using a Cramer's V function I would like to select these variables from my data set and put them into a matrix so that I could then apply the Cramers V function to the matrix rather than performing each analysis individually.
For example, my data set is called qfdisease and it contains the variables: age, occupation, education, vetclinic, animals, state, years, gender, practice type (all these variables are categorical).
I have found age, occupation, state, education and vetclinic with a p<0.2 in my univariable analysis and would like to test them for colinearity using a Cramers V test prior to building a multivariable mode.
I am currently creating a 2x2 contingency table for each comparison then running that through the Cramers V function.
Is there any way that I can extract age, occupation, state, education and vetclinic form my qfdisease data set and create a matrix/dataframe of some description (not too sure if I have used the correct terminology) which I can then feed into the CramersV function to perform all these calculations at once?