BookmarkSubscribeRSS Feed
Pallavi_B
Calcite | Level 5

Hello, I am new to SAS. I have outcome variable "titer" grouping variable "treatment"  how I can use macros to perform independent sample's t test (Mann-Whitney U test)?? I have no idea of macros. so if possible please give explaination

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I don't think macros are needed here. SAS Documentation has examples of performing this test, for example: https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_power_examples16.htm&docsetVersio...

--
Paige Miller
Pallavi_B
Calcite | Level 5
Even though we have some more methods, I need macros. Because I need to
check for normality and have to do corresponding parametric or non
parametric tests.
Cynthia_sas
SAS Super FREQ

Hi:
Before you can write a SAS macro program, you need to have working code. The SAS Macro facility is ONLY a text generator. All the Macro facility does is write code for you. So the Macro facility in and of itself will NOT "check for normality ...and do corresponding parametric or non-parametric tests" -- SAS procedures do that work. If you wanted to repeat the same SAS procedure 100 times, changing the variable every time, THEN you would take your working SAS program that generates the results for 1 variable and you would "macro-ize" the program to work for any variable name you pass in. The Macro facility would generate the code for you, switching the variable name and the regular SAS processor would compile and execute the code.

Do you have a working SAS program? It is extremely hard to do anything with the Macro facility if you don't have a working program to start with.

But, here's a paper that shows the overall concepts of the Macro facility:

https://support.sas.com/resources/papers/proceedings13/120-2013.pdf

Hope this helps,
Cynthia

Pallavi_B
Calcite | Level 5
thank you

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 875 views
  • 1 like
  • 3 in conversation