Date: Fri, 17 Mar 2006 18:17:44 -0500
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: Diagram with MEAN
Content-Type: text/plain; charset=ISO-8859-1
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?
input gapmonth difftotal;
proc means data=b_1 mean nway;
output out=b_2 mean=;
proc sql noprint;
select mean(difftotal) into :average
TITLE 'Line Chart difftotal by gapmonth';
proc gplot data=b_2;
plot difftotal*gapmonth / haxis=1 to 4 by 1
vaxis=0 to 8 by 2
On Fri, 17 Mar 2006 11:59:07 -0800, Irin later <irinfigvam@YAHOO.COM>
> My URL is the following:
> 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)
> by memberid;
> if a=1 and b=1 ;
> diffTotal= Sb - S1; * Sb-Baseline score while S1-1ST FOLLOWUP SCORE
> proc means data=B_1 n mean std t prt;
> var diffTotal;
> title 'Is the Total Score on StudyFstfollowup higher than StudyBase';
> 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
>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
> 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
> PROC GCHART data=b_1 ;
> VBAR gapmonth_b_f / SUMVAR=difftotal TYPE=MEAN;
> TITLE 'Gapmonth_b_f between Baseline and First Followup
> Thank you!
>David L Cassell <davidlcassell@MSN.COM> wrote: irinfigvam@YAHOO.COM
>> 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
>>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
>> Is there any way to do it as this kind of diagram?
> Your English is great. Better than some people who are *supposed*
>to write English clearly. Don't worry about your English.
> 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.)
> 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.
> 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.
>David L. Cassell
>3115 NW Norwood Pl.
>Corvallis OR 97330
>Don’t just search. Find. Check out the new MSN Search!
>Bring photos to life! New PhotoMail makes sharing a breeze.