Macro code is not working! Please help !

Reply
Occasional Contributor
Posts: 7

Macro code is not working! Please help !

[ Edited ]

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);

SAS Super FREQ
Posts: 479

Re: Macro code is not working! Please help !

Remove the ampersands from this line:

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

 

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

Ask a Question
Discussion stats
  • 1 reply
  • 82 views
  • 0 likes
  • 2 in conversation