Hi, I am new to the forum and have a simple request. I am a student taking a test on SAS and was given an assignment, however I do not have access to my PC and I am working with a Mac (no SAS access). I have two program that I need to run to check their accuracy and was wondering if anyone might be kind enough to help? If so, it would be greatly appreciated.
The value of sum (line 5) should be 14:
data repeat;
array alp(3) a1-a3 (3*2);
do i=anyalpha("&$#a987a") to "07jan1960"d;
dif=i-3;
alp(dif)=alp(dif)**dif;
sum + alp(dif);
end;
drop i ;
run;
My second question is as to whether or not this is a valid procedure, specifically the MEAN, MEDIAN, MIN and MAX portions of the TABLE function in line 10 (I am trying to calculate the mean, median and interquartile range for the data set scores):
PROC IMPORT DATAFILE = 'c:\MyComputer\Documents\demo_info.xls' OUT = scores DBMS = excel GETNAMES = yes; SHEET = hallo;
quarter = QTR(birth_date);
IF LENGTH(gender) <= 5 THEN gender = Male;
IF LENGTH(gender) >= 5 THEN gender = Female;
RUN;
PROC TABULATE DATA = scores;
CLASS gender quarter;
VAR score
TABLE gender ALL, MEAN*score* (quarter ALL) MEDIAN*score* (quarter ALL) MIN*score* (quarter) MAX*score* (quarter);
TITLE 'Mean, Median and Inter Quartile Range of scores by Gender';
RUN;
I would like to add that I am not looking for any help beyond yes/no answers, as this is for a school exam, and I am simply looking to replicate the resources I would have if I were operating on my own computer
1. Yes
2. No
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.