BookmarkSubscribeRSS Feed
CrisJ
Calcite | Level 5

Plotting Component(before this there was special section for means procedure)

  1. Create a set of box-plots that make sense for this data. Choose two variables that are not subject/sessions/reps.

  2. Be sure to include proper titles including the Subject ID and your chosen variables.

  3. Consider that you are using a single subject. How are you going to handle the sessions and reps?

  4. As text printed out in your SAS results, please explain, in full sentences, what subject you used and how you handled the sessions and reps. Discuss what the plots are telling you

Here is my code, but I don't know why it is not showing up on the screen, when I run the code. Could you help me to figure it out, please

options validvarname=V7;
proc import out = aa
datafile = "/PW_typing"
dbms = csv
replace;
getnames = YES;
run;
data mydata;
set aa;
where subject = "s020";
drop rep;
run;

proc means data=mydata mean;
var H.period DD.period.t UD.period.t H.t DD.t.i UD.t.i H.i DD.i.e UD.i.e H.e DD.e.five UD.e.five H.five DD.five.Shift.r UD.five.Shift.r H.Shift.r DD.Shift.r.o UD.Shift.r.o H.o DD.o.a UD.o.a H.a DD.a.n UD.a.n H.n DD.n.l UD.n.l H.l DD.l.Return UD.l.Return H.Return;
class sessionIndex;
run;

title "Means for subject s020";
proc print data=mydata(obs=5);
run;
proc means data = mydata;
run;

proc sgplot data=mydata;
vbox H.period / category=SessionIndex group=Rep
title="H.period Typing Speeds for Subject &subject.";
vbox DD.period.t / category=SessionIndex group=Rep
title="DD.period.t Typing Speeds for Subject &subject.";
run;
3 REPLIES 3
PaigeMiller
Diamond | Level 26

Its not clear to me what your question is. Could you state a specific thing or two you want help with?

--
Paige Miller
CrisJ
Calcite | Level 5

Task: Create a set of box plots that make sense for this data. Choose two variables that are not subject/sessions/reps.

I tried to run the program but plots did not appear.

options validvarname=V7;
proc import out = aa
datafile = "PW_typing"
dbms = csv
replace;
getnames = YES;
run;

%let subject = s020;
/* Create dataset for given subject */
data mydata;
  set aa;
  where subject = "s020";
  drop rep;
run;

/* Compute means for each session index */
proc means data=mydata mean;
var H.period DD.period.t UD.period.t H.t DD.t.i UD.t.i H.i DD.i.e UD.i.e H.e DD.e.five UD.e.five 
H.five DD.five.Shift.r UD.five.Shift.r H.Shift.r DD.Shift.r.o UD.Shift.r.o H.o DD.o.a UD.o.a H.a 
DD.a.n UD.a.n H.n DD.n.l UD.n.l H.l DD.l.Return UD.l.Return H.Return;
class sessionIndex;
run;

/* Add personalized title */
title "Means for subject s020";

/* Print results */
proc print data=mydata(obs=5);
run;
proc means data = mydata;
run;


proc sgplot data=mydata;
    vbox H.period / category= sessionIndex title="H.period Typing Speeds for Subject &subject.";
    vbox DD.period.t / category= sessionIndex y=DD.period.t title="DD.period.t Typing Speeds for Subject &subject.";
run;

My code: 

PaigeMiller
Diamond | Level 26

Are there errors or warnings in the log? Whenever code isn't working you should check the log. If there are problems indicated in the log, please show us the log for the step (PROC or DATA step) that has the problem. We need to see all of the log for that step, every single line, not selected portions.

--
Paige Miller

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!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 564 views
  • 0 likes
  • 2 in conversation