BookmarkSubscribeRSS Feed
SusanParker
Calcite | Level 5
Hi!

My statistician has a 3 row by 7 column data lattice. She wants to have what would amount to the x-axis line on each row, but she doesn't want the column borders. Is it possible to do that? This version of the code that I've included turns on all of the borders with the walldisplay=(outline) on the layout prototype. She'd settle for being able to put a reference line at y=0, but wasn't able to figure out how to do that. If she uses walldisplay=(fill) she gets no column borders, but also no borders between the rows.

Thanks in advance for any assistance.

proc format;
VALUE groupf
1 = "Group 1"
2 = "Group 2"
3 = "Group 3"
4 = "Group 4"
5 = "Group 5"
6 = "Group 6"
7 = "Group 7";

value timeptf
1='Pre-Dose'
2='Post-Dose';

value daysf 1='Visit 1'
2='Visit 2'
3='Visit 3'
;
run;

data test;
attrib armcd length=8. label='Group' format=groupf.;
attrib testcd length=$3. label='Test';
attrib lbtptnum length=8. label='Time point' format=timeptf.;
attrib means length=8. label='Mean Value';
attrib visit length=8. label='Visit' format=daysf.;
infile datalines dsd;
input armcd testcd lbtptnum means visit ;
datalines4;
1,C3A,1,933.16666667,1
1,C3A,2,1138.6666667,1
2,C3A,1,594.28571429,1
2,C3A,2,1062.2857143,1
3,C3A,1,940.85714286,1
3,C3A,2,3914,1
4,C3A,1,945.75,1
4,C3A,2,3182.375,1
5,C3A,1,981.61538462,1
5,C3A,2,4023.2307692,1
6,C3A,1,815.33333333,1
6,C3A,2,4126.5,1
7,C3A,1,1112.1666667,1
7,C3A,2,7599.1666667,1
1,C3A,1,808.5,2
1,C3A,2,964.33333333,2
2,C3A,1,619,2
2,C3A,2,1164.1428571,2
3,C3A,1,999.14285714,2
3,C3A,2,8225.5714286,2
4,C3A,1,1111.625,2
4,C3A,2,10011.875,2
5,C3A,1,1295.4166667,2
5,C3A,2,9587.0833333,2
6,C3A,1,1190,2
6,C3A,2,10221.166667,2
7,C3A,1,1259.1666667,2
7,C3A,2,11695,2
1,C3A,1,845.33333333,3
1,C3A,2,1066.8333333,3
2,C3A,1,566.85714286,3
2,C3A,2,1251.1428571,3
3,C3A,1,853.14285714,3
3,C3A,2,3199.5714286,3
4,C3A,1,1373.3333333,3
4,C3A,2,4659,3
5,C3A,1,941.33333333,3
5,C3A,2,4191.7272727,3
6,C3A,1,762.5,3
6,C3A,2,3514.1666667,3
7,C3A,1,1116.6666667,3
7,C3A,2,6369,3
;;;;
run;


ODS path (prepend) work.tempgrap;

proc template;
define statgraph prepost2/store=work.tempgrap;
begingraph;
layout gridded / border=false;
layout datalattice columnvar=armcd rowvar=visit/ rows=3 columns=7
headerlabeldisplay=value rowdatarange=union cellwidthmin=60
columnheaders=bottom border=true columndatarange=union
columnaxisopts=(display=(line) DISPLAYSECONDARY=(line))
rowdatarange=union rowgutter=2px
headerbackgroundcolor=GraphAltBlock:color

rowdatarange=union
rowheaders=right
headerlabelattrs=(weight=bold)
headeropaque=true

rowaxisopts=(offsetmin=0 linearopts=(viewmax=14000 tickvaluepriority=true
tickvaluesequence=(start=0 end=14000 increment=2000) )
display=(line ticks tickvalues) DISPLAYSECONDARY=(line)
label='Mean Concentration (ug/dL)' griddisplay=on display=all);

layout prototype / walldisplay=(outline) cycleattrs=false;
barchart x=LBTPTNUM y=means/ group=LBTPTNUM name='a' skin=modern
outlineattrs=(color=black) primary=true;
endlayout;
endlayout;
entry ' ';
discretelegend 'a' / title='Time: ' border=true across=2;
endlayout;
endgraph;
end;
run;

ods listing close;

ods rtf file='test.rtf';

proc sgrender data=test template=prepost2;
run;

ods listing;
ods rtf close;
run;
2 REPLIES 2
DanH_sas
SAS Super FREQ
This prototype should give you what you want:

[pre]
layout prototype / walldisplay=(fill) cycleattrs=false;
referenceline y=0;
barchart x=LBTPTNUM y=means/ group=LBTPTNUM name='a' skin=modern
outlineattrs=(color=black) primary=true;
endlayout;
[/pre]

Cool graph, btw 🙂

Dan
SusanParker
Calcite | Level 5
Thanks Dan! That did the trick. The statistician is very proud of her graph. 🙂 She's really been taking to the whole GTL thing.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 742 views
  • 0 likes
  • 2 in conversation