I am doing an exploratory analysis to see if any variables are associated with someone “switching” from one type of treatment to another. I am running fisher’s exact tests (because of a small sample size) to test associations before coming back to my team with any recommendations on how to proceed with the analysis.
The issue I am running into is that there are 22 variables that need to be compared to the “switch” variable and while I could hardcode every combination, it would be concise and cleaner if I could use an array or do loop to code these 22 tests in just a few lines.
I was able to successfully create an array with the variables I need.
Any advice would be greatly appreciated!! I had tried to code the following
proc freq data=dataset;
tables switch_var*comp_vars(22)/fisher;
run;
When I did it returned with the following error :
“ERROR 22-322: Syntax error, expecting one of the following: a name, ALL, CHARACTER, CHAR, NUMERIC.
ERROR 200-322: The symbol is not recognized and will be ignored.”