LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 20 Mar 2006 08:11:53 -0800
Reply-To:   Irin later <irinfigvam@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Irin later <irinfigvam@YAHOO.COM>
Subject:   Re: Diagram with MEAN
Comments:   To: Arthur Tabachneck <art297@NETSCAPE.NET>
In-Reply-To:   <200603172317.k2HIe94k018000@mailgw.cc.uga.edu>
Content-Type:   text/plain; charset=iso-8859-1

Art,

Thank you so much for your help! It works just perfect for this case!

Now I am trying to generate another graph which differs from the one you helped me with. I tried to apply the same logic but try as I might it didn’t work for diagram…….

At this time I need 2 lines. One is for Mean of Physical score and another is for Emotional.

It should be like three axises (two Y_axises! Mean for Physical score on the left hand while Mean of the Emotional score on the right hand)

My URL is the following and the sketch shows the diagram in need:

http://www.geocities.com/irinaroscom

My question is: how to create a diagram so that axis-Y on the LEFT shows MEAN of Physical score while axis-Y ON THE RIGHT shows Mean of Emotional score while X-axis shows the months alon studybase. (I do not have Gapmonth anymore. Neither I have a parallel line for entire population).

I have data=studybase

My variables are the followings:

physical_score Emotional_score MonthSurvey

Could you please give me a hand? This forum is extremely helpful for me! Thank you very much!

Irin

Arthur Tabachneck <art297@NETSCAPE.NET> wrote: I responded to Irin with the following, off-line, admitting that I am definitely not well versed in SAS/GRAPH. Is there a better way to accomplish what Irin is trying to achieve?

data b_1; input gapmonth difftotal; cards; 1 3 1 4 1 5 1 6 2 5 2 6 2 7 3 6 3 7 3 8 4 7 4 8 4 9 ; run;

proc means data=b_1 mean nway; var difftotal; class gapmonth; output out=b_2 mean=; run;

proc sql noprint; select mean(difftotal) into :average from b_1; quit;

TITLE 'Line Chart difftotal by gapmonth';

symbol1 interpol=join value=dot height=1;

proc gplot data=b_2; plot difftotal*gapmonth / haxis=1 to 4 by 1 vaxis=0 to 8 by 2 vref=&average.; run; quit;

Art ---------- On Fri, 17 Mar 2006 11:59:07 -0800, Irin later wrote:

>David, > > My URL is the following: > > http://www.geocities.com/irinaroscom > > This is my very first experience in html and paint software. So forgive me for an ugly sketch! > Horizontal X-axis represents a gap month between two survey (baseline and first survey) > Vertical Y-axis represents mean survey score difference. Below is how I calculated them: > data B_1; > merge studyFstFollowup (in=a) > studyBase(in=b); > by memberid; > if a=1 and b=1 ; > Gapmonth_B_F=monthFst-monthBase; > diffTotal= Sb - S1; * Sb-Baseline score while S1-1ST FOLLOWUP SCORE > run; > > proc means data=B_1 n mean std t prt; > var diffTotal; > title 'Is the Total Score on StudyFstfollowup higher than StudyBase'; > run; > ********************************************************** > Therefore my dataset b_1 contains 2 columns : DiffTotal and Gapmonth_B_f > > I need to create a DIAGRAM (chart) with the following axises: > >1.Mean of DiffTotal differences for each gap month >2.Gapmonth_b_f > >My question is: how to create a diagram so that axis Y show MEAN of Difftotal while axis X show gap month and in addition there would be a line parallel to horizontal x-axis which should represent MEAN for the entire population (while a thin line should represent Means for each gapmonth) ? > > Actually the code below which Art gave me illustrated how it goes too, but I need a diagram instead a histogram and in addition I need a single (parallel line of MEAN for entire population (which I do not know how to implement) > > PROC GCHART data=b_1 ; > VBAR gapmonth_b_f / SUMVAR=difftotal TYPE=MEAN; > TITLE 'Gapmonth_b_f between Baseline and First Followup surveys'/SUMVAR=difftotal TYPE=MEAN; > run; > quit; > > Thank you! > > Irin > > >David L Cassell wrote: irinfigvam@YAHOO.COM wrote back: >> Thank you very much , I got the result but it looks more like a >>histogram (vertical bars) while I am looking for a diagram/grahic?…which >>means one line from the top to the top of each vertical bar. Sorry for the >>confusion. I am not sure how to name it in English. >> While I need means for each gapmonth I also need another line (parrallel >>to the x_axis) on the graphic which shows one value of Mean for the entire >>population. >> >> Is there any way to do it as this kind of diagram? > >[1] Your English is great. Better than some people who are *supposed* >to write English clearly. Don't worry about your English. > >[2] You need to write back to the list and describe very carefully exactly >what you want your graph to look like. If you have a picture, you can >give the URL so we can look at the desired form. (Don't try to attach >anything. Attachments get removed at the listserv.) > >[3] If you don't want something like a histogram or a vertical bar chart, >then you need to give us the exact details on how your needs differ from >what the various SAS/GRAPH output give you. > >[4] A single line going across the chart is easy. There's a REF= option >that lets you draw a line at any Y value you want. You can even control >whether the line goes behind the bars (normal behavior) or goes in front >of the bars (option FRONTREF). But you have to tell us all your >requirements before we can tell oyu how to get them. > >HTH, >David >-- >David L. Cassell >mathematical statistician >Design Pathways >3115 NW Norwood Pl. >Corvallis OR 97330 > >_________________________________________________________________ >Don’t just search. Find. Check out the new MSN Search! >http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > > > >--------------------------------- >Yahoo! Mail >Bring photos to life! New PhotoMail makes sharing a breeze.

--------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments.


Back to: Top of message | Previous page | Main SAS-L page