BookmarkSubscribeRSS Feed
Shaha13
Calcite | Level 5

Hi all,

I need to run a pretty large multinomial comparison. I have a list of 2,000 different medicines, and I have computed their frequency "pre" and "post" (relative to a change in the experiment). I want to do a Pearson's test to see which of these medicines have significantly different proportional representations in the "post" sample.

So, my data look like:

Drug:     Pre:     Post:

A          x1%         y1%

B          x2%          y2%

...

If I had a smaller list -- say 3 medicines -- I would use:

PROC FREQ data=tmp

tables drug / chisq testp=( X Y Z )

RUN;

But, I have around 2000 levels, and I don't want to type them out. I don't think proc freq can take the hypothesized values from inside the data, as I need. Is there another procedure that can handle such an input method? Or, is there a way I can batch/script this to produce the needed output?

Thanks.

1 REPLY 1
Ksharp
Super User

Why not make a macro variable to hold these X Y Z ?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1158 views
  • 0 likes
  • 2 in conversation