- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I need to add follwoing:
X axis visit
Y axis change
boxplot with each subjid overlay with different symbol and color
I also need to separate shaded area for first 4 visits as treated verus rest of the visits as non treated.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data adprop;
call streaminit(123);
do i=1 to 8;
do avisitn=1 to 8;
if avisitn in (1:4) then group='treat ';
else group='nontreat';
chg=rand('uniform');
output;
end;
end;
run;
data dattrmap;
id='id';
input value MarkerSymbol : $20. MarkerColor :$20.;
cards;
1 StarFilled Bisque
2 Asterisk Aqua
3 Circle Black
4 Triangle Blue
5 Diamond red
6 TriangleFilled green
7 DiamondFilled yellow
8 Hash Brown
9 Plus Chartreuse
10 X Coral
11 Square DeepPink
12 Y Fuchsia
13 Z Tomato
15 Star YellowGreen
;
proc sgplot data= adprop dattrmap=dattrmap;
vbox chg/ category= avisitn ; *group=avisitn;
scatter x=avisitn y=chg/jitter group=avisitn attrid=id;
block x=avisitn block=group / filltype=alternate fillattrs=(color=grey transparency=0.8)
altfillattrs=(color=white transparency=1) ;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Maybe we have a different idea of what a boxplot does, but if you have X as visit and Y as change, I guess its not obvious to me where the variable subject fits in. Could you show us an example of such a boxplot?
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How can i create different symbol and color of the jitter for each subjectid (small circles on box plots)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc sgplot data= adprop;
vbox chg/ category= avisitn;
scatter x=avisitn y=chg/jitter ;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In the VBOX statement you can label the outliers with the value of a variable (like an ID) by using the DATALABEL= option. I don't think you can have the outlier markers have a different color depending on the ID.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data adprop;
call streaminit(123);
do i=1 to 8;
do avisitn=1 to 8;
if avisitn in (1:4) then group='treat ';
else group='nontreat';
chg=rand('uniform');
output;
end;
end;
run;
data dattrmap;
id='id';
input value MarkerSymbol : $20. MarkerColor :$20.;
cards;
1 StarFilled Bisque
2 Asterisk Aqua
3 Circle Black
4 Triangle Blue
5 Diamond red
6 TriangleFilled green
7 DiamondFilled yellow
8 Hash Brown
9 Plus Chartreuse
10 X Coral
11 Square DeepPink
12 Y Fuchsia
13 Z Tomato
15 Star YellowGreen
;
proc sgplot data= adprop dattrmap=dattrmap;
vbox chg/ category= avisitn ; *group=avisitn;
scatter x=avisitn y=chg/jitter group=avisitn attrid=id;
block x=avisitn block=group / filltype=alternate fillattrs=(color=grey transparency=0.8)
altfillattrs=(color=white transparency=1) ;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
To get the values spaced as you described, trying setting TYPE=LINEAR on the XAXIS statement and see if you the desired results. By default, the category axis type for box plots is DISCRETE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content