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.

%COMMENT%

OriginalStatGraphicsForm edit

Image %LIGHTBOX{ image="efficacybysite.jpg" thumbnail="tn_efficacybysite.jpg" caption="Efficacy by Site"}% Click on image to enlarge..
Title Efficacy Across Sites
Graph_Subgroup General Principles
Code Added Yes
Description Treatment Effects and the corresponding sample sizes are plotted for each site in a multi-center trial in addition to the overall treatment effect (horizontal lines).
Contributor/Email Mat Soukup (email: Mat.Soukup@fda.hhs.gov)
Background The endpoint is binary with higher proportions corresponding to increased efficacy. The data set is from a randomly generated data set located on the OB network drive.
Special Considerations
Date Original
Original Date 2007
Modified Date
Use/Suitability Exploration
Software Program R
Software
R-Code - Attachment Efficacy by Site - Attached
R-Code library(Hmisc)

dat <- read.csv('C:/RGraphicsTutorial/Datasets/CleanTrial.csv')<br />
base <- subset(dat, visit%in%2)<br />eot <- subset(dat, visit%in%6)<br />
# binary endpoint is success if at least 2 grade improvement
eot$binep <- ifelse(base$catvar-eot$catvar >= 2, 1, 0)
# Also create a site id (25 total sites)
set.seed(42)
eot$site <- sample(1:25, 1500, replace=TRUE)<br />
ss <- with(eot, summarize(binep, llist(site, trtf), mean))<br /> n <- with(eot, summarize(binep, llist(site, trtf), length))<br />
sdat <- data.frame(ss, n[,3])<br /> names(sdat) <- c("Site", "Trt", "Mean", "N")<br /> so <- with(eot, summarize(binep, llist(trtf), mean))<br />
nsn <- length(unique(sdat$Site))<br /> ut <- unique(sdat$Trt)<br /> rnx <- tabulate(as.factor(sdat$Site))<br /> sdat$plotx <- rep(1:nsn, rnx[rnx>0])
# Creation of the figure.

#png('C:/Research/Graphics/Graphs4Display/webpages/classes/pages/images/efficacybysite.png',
# width=670, height=500)

plot(c(.5, nsn+.5), c(min(sdat$Mean)-.05, max(sdat$Mean)+.05),
type="n", ylab='Response Rate', xlab='', axes=FALSE)
axis(1, at=1:nsn, labels=as.character(unique(sdat$Site)), cex.axis=1, las=3)
axis(2)
box()
sdat$plotx <- sdat$plotx + rep(c(-.05,.05), length(sdat[,1])/2)<br /> coluers <- c('seagreen2','grey60')<br /> pchs <- c(1,16)<br /> for(k in 1:length(ut)){
subdat <- subset(sdat, sdat$Trt==ut[k])<br /> points(subdat$plotx, subdat$Mean,
pch=pchs[k],
col=coluers[k])
# Add overall means as horizontal lines
abline(h=so[k,2], col=coluers[k], lty=3, lwd=2)
for(j in 1:length(subdat$N)){
text(subdat$plotx[j]+.4, subdat$Mean[j], labels=subdat$N[j],
col=coluers[k], cex=1)
}
}
for(i in 1:nsn){
subdat <- subset(sdat, sdat$Site==unique(sdat$Site)[i])<br /> lines(c(i,i), c(min(subdat$Mean), max(subdat$Mean)), lty=2,col='gray60')
}
legend("topleft", legend=as.character(sort(unique(eot$trtf))),
pch=pchs,
col=coluers,
cex=1.25, xjust=0)
#dev.off()
SAS-Code - Attachment
SAS-Code
Stata-Code - Attachment
Stata-Code
Other Code - Attachment
Other Code
Keywords treatment effects, multi-centered clinical trial, efficacy
OPTIONAL FIELDS
References
Datasets
Data
Attached Data
CATEGORIZATIONS
Classification-Evaluation Efficacy
Classification-Graph Type Scatterplot
Graph_Type Scatterplot
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 efficacybysite_Referemce_200.jpg
This topic: CTSpedia > WebHome > StatGraphHome > ContributeGraphics > StatGraphTopic007
Topic revision: 30 Mar 2012, MaryBanach
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