Hello All, I have a data set of 3,924 rows and I need to get mean every 500 rows. So, I need the mean for row 1 to 500, then 501-1000, 1001 to 1500 and so on. I have been working on the following codes for a week now and still cannot figure it out. Any suggestions? I appreciate and thank you for your time and help in advance. Code 1: %macro meanrating; %do i=1 %to 3924; from rec=i+1 to rec=(i+1)*500; proc means data=work.query_for_nh_query3; var overallrating; %end; %mend; %meanrating Code 2: %MACRO mean; %DO I = 1 %TO 3924 %by 500; PROC MEANS DATA=work.query_for_nh_query3; VAR overallrating; TITLE "Mean Every 500 Rows"; RUN; %END; %MEND; %mean; What am I doing wrong? Thanks.
... View more