BookmarkSubscribeRSS Feed
eee100
Calcite | Level 5

Please help my macro code has errors and I cannot figure it out. this is very time sensitive! Here is the question I am asked: Use a single macro with two parameters to assess the correlation between mean fasting glucose and age, body composition, blood pressure and lipid concentrations a. Obtain unadjusted correlations between mean fasting plasma glucose and age, weight, weight at age of 20, percent weight change, waist to hip ratio, BMI, HDL cholesterol, total cholesterol, the ratio of total to HDL cholesterol (as a continuous variable), systolic blood pressure and diastolic blood pressure. b. Obtain age-adjusted correlation coefficients for the above-mentioned correlation tests (except for the correlation between mean fasting plasma glucose and age)

 

 

 

Here is my code: %macro mycorr(&a=, &b=); proc corr data=PJ123 spearman; var meanFG; with &a; only &b; run; %mend mycorr; %mycorr(a=Age weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP); %mycorr(a=weight20 WTPCT WHR BMI HDL CHOL TCHDL SBP DBP, b=age);

1 REPLY 1
WarrenKuhfeld
Rhodochrosite | Level 12

Remove the ampersands from this line:

%macro mycorr(&a=, &b=); 

 

I have never heard of an ONLY statement in PROC CORR.  

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 314 views
  • 0 likes
  • 2 in conversation