BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
samcd
Calcite | Level 5

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;

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
samcd
Calcite | Level 5

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

Reeza
Super User

1. Yes

2. No

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 2 replies
  • 642 views
  • 3 likes
  • 2 in conversation