Return to Statistical Graphics Home

Please rate the graphic:

%VOTE{id="Evalgraph" stars1="Graph Rating" global="off" open="off" secret="off" format="| $key | $small
Score: $score, My vote: $mylast, Total votes: $sum |" }%

Please add comments and then click on the "Add comment" button.

The format is very good but continuous variables have been arbitrarily binned. The best display would preserve the continuous nature of all continuous variables.

-- FrankHarrell - 18 May 2016 %COMMENT%

OriginalStatGraphicsForm edit

Image %LIGHTBOX{ image="DotplotSOC.png" thumbnail = "tn_DotplotSOC.jpg" caption="Dotplot SOC"}% Click on image to enlarge.
Title Dotplot of Primary SOC
Graph_Subgroup General Principles
Code Added Yes
Description The following example is a dotplot of the percent of events occurring within a system organ classification for a single treatment group. The SOC are sorted according to the relative frequency.
Contributor/Email Mat Soukup (email: Mat.Soukup@fda.hhs.gov)
Sanjay Matange (email: Sanjay.Matange@sas.com)
Background
Special Considerations
Date Original
Original Date 2007
Modified Date
Use/Suitability Presentation
Software Program R, SAS
Software R version 2.10
SAS Version 9.40M3
R-Code - Attachment R-script: Dotplot of Primary SOC
R-Code library(lattice)

set.seed(26)
soc <- c('Infections and infestations',<br /> 'Neoplasms benign and malignant (incl. cysts and polyps)',
'Blood and the lymphatic system disorders',
'Immune system disorders',
'Endocrine disorders',
'Metabolism and nutrition disorders',
'Psychiatric disorders',
'Nervous system disorders',
'Eye disorders',
'Ear and labyrinth disorders',
'Cardiac disorders',
'Vascular disorders',
'Respiratory, thoracic and mediastinal disorders',
'Gastrointestinal disorders',
'Hepato-biliary disorders',
'Skin and subcutaneous tissue disorders',
'Musculoskeletal, connective tissue and bone disorders',
'Renal and urinary disorders',
'Pregnancy, puerperium and perinatal conditions',
'Reproductive system and breast disorders',
'Congenital and familial/genetic disorders',
'General disorders and administration site conditions',
'Investigations',
'Injury and poisoning',
'Surgical and medical procedures',
'Social circumstances')
rate <- round(rnorm(length(soc), 8, 3), 1)<br />ratec <- as.character(rate)<br /># order by most frequent
dat <- data.frame(soc, rate, ratec)<br />
sortmat <- function (Mat, Sort) { <br /> m <- do.call("order", as.data.frame(Mat[, Sort])) <br /> Mat[m, ]
}

sdat <- sortmat(dat, 2)<br />
# Set up the plot
levpt <- unique(sdat$soc)<br /> npt <- length(levpt)<br />
png('C:/Research/Graphics/Graphs4Display/webpages/classes/pages/images/DotplotSOC.png',
width=600, height=400)

# Set-up Layout
mylayout <- layout(matrix(c(1,2,3), byrow=TRUE, ncol=3),<br /> widths=c(4/10,1/10,5/10))

par(mar=c(5,1,2,0))
plot(x=c(0,max(nchar(as.character(sdat$soc)))+1), y=c(.9,npt+.1), ann=FALSE, axes=FALSE, type='n')
title('System Organ Classification')
text(x=rep(max(nchar(as.character(sdat$soc))), npt), y=1:npt, label=sdat$soc, adj=c(1,0.5))

par(mar=c(5,0,2,0))
plot(x=c(0,1), y=c(.9,npt+.1), ann=FALSE, axes=FALSE, type='n')
title('%')
text(x=rep(.5, npt), y=1:npt, label=sdat$ratec, adj=c(0.5,0.5))

par(mar=c(5,0,2,2))
plot(x=c(0,max(sdat$rate)+.25), y=c(.9,npt+.1), type='n', axes=FALSE,
xlab='Relative Frequency of an Event (%)', ylab='',
ylim=c(.9,npt+.1))
axis(1)
#box()
abline(v=c(0,5,10,15), col='grey80', lty=3, lwd=2)
for(i in 1:npt){
lines(c(0,sdat$rate[i]),c(i,i), lty=1, col='grey60', lwd=2)
}
points(sdat$rate, 1:npt, pch=16, col='black', cex=2)
dev.off()
SAS-Code - Attachment
SAS-Code %let gpath='.';
%let dpi=200;
ods html close;
ods listing gpath=&gpath image_dpi=&dpi;

/*--Create data set--*/
data dot;
format Pct percent8.1;
label pct='%';
label classification='System Organ Classification';
input Value Classification $6-65;
Pct=Value/100;
datalines;
1.6 Infections and infestations
11.4 Neoplasms benign and malignant (incl. cysts and polyps)
6.5 Blood and the lymphatic system disorders
10.5 Immune system disorders
6.8 Endocrine disorders
8.4 Metabolism and nutrition disorders
8.4 Psychiatric disorders
10.7 Nervous system disorders
7.9 Eye disorders
9.3 Ear and labyrinth disorders
12.8 Cardiac disorders
7.9 Vascular disorders
6.3 Respiratory, thoracic and mediastinal disorders
15.1 Gastrointestinal disorders
8.5 Hepato-biliary disorders
11.0 Skin and subcutaneous tissue disorders
8.1 Musculoskeletal, connective tissue and bone disorders
4.7 Renal and urinary disorders
2.8 Pregnancy, puerperium and perinatal conditions
10.4 Reproductive system and breast disorders
6.2 Congenital and familial/genetic disorders
9.3 General disorders and administration site conditions
15.7 Investigations
9.1 Injury and poisoning
8.8 Surgical and medical procedures
5.3 Social circumstances
;
run;

/*--Sort by descending pct--*/
proc sort data=dot out=dot_Sort;
by descending pct;
run;

/*--Create Dot Plot using SAS 9.40M3--*/
ods graphics / reset width=5in height=3in imagename='Dotplot_of_Primary_SOC';
proc sgplot data=dot_sort noborder;
dropline y=classification x=pct / dropto=y;
scatter y=classification x=pct / markerattrs=(symbol=circlefilled);
yaxistable classification pct / location=outside position=left pad=10
valuejustify=right valueattrs=(size=7) labelattrs=(size=8);
xaxis min=0 grid offsetmin=0 label='Relative Frequency of an Event';
yaxis fitpolicy=none valueattrs=(size=7) reverse display=none;
run;
Stata-Code - Attachment
Stata-Code
Other Code - Attachment
Other Code
Keywords safety, events, system organ classification, treatment group
OPTIONAL FIELDS
References
Datasets
Data
Attached Data
CATEGORIZATIONS
Classification-Evaluation Safety
Classification-Graph Type Dotplot
Graph_Type Dotplot
Variable Relationship Continuous versus Categorical
Data Types Categorical and Continuous
Special Cases
Disclaimer The views expressed within CTSpedia are those of the author and must not be taken to represent policy or guidance on the behalf of any organization or institution with which the author is affiliated.
Permission Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT OLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Reference Image DotplotSOC_reference_200.png
This topic: CTSpedia > WebHome > StatGraphHome > ContributeGraphics > StatGraphTopic005
Topic revision: 18 May 2016, FrankHarrell
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback