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

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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