Tags:
create new tag
, view all tags, tagging instructions
Return to Statistical Graphics Home

Please rate the graphic:

  • 5 stars = highest rating
  • 1 star = lowest rating
  • SCORE = average of all votes

Graph Rating
Score: 0, My vote: 0, Total votes: 0

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

 

OriginalStatGraphicsForm edit

Image
Efficacy by Subgroup
Click on image to enlarge.
Title Efficacy by Subgroup
Graph_Subgroup General Principles
Code Added Yes
Description For each study (conditioned variable) depicts unadjusted 95% confidence intervals of each treatment group by race. In addition the tabular information is presented in the bottom portions of each panel.
Contributor/Email Mat Soukup (email: Mat.Soukup@fda.hhs.gov)
Background Endpoint is binary and 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 R-script: Efficacy by Subgroup - Attached
R-Code dat <- read.csv('//cdsnas/oebdbdms/Graphics/Datasets/CleanTrial.csv')
base <- subset(dat, visit==2)
eot <- subset(dat, visit==6)
eot$binep <- ifelse(base$catvar-eot$catvar >= 2, 1, 0)
# Suppose this actually is from two studies
eot$study <- rep(c('Study 1','Study 2', 'Study 1', 'Study 2'),
c(450,300,450,300))

ss <- with(eot, summarize(100*binep, llist(racef, study, trtf),
smean.cl.normal))

ss$xaxis <- rep(1:4, each=4)+rep(c(-.1,.1), 8)
names(ss)[4] <- 'binep'

# Calculate counts and sample sizes for the table
a1 <- with(eot[eot$study%in%'Study 1',], ftable(trtf, racef, binep))
xs1 <- a1[,2]
n1 <- a1[,1]+a1[,2]

a2 <- with(eot[eot$study%in%'Study 2',], ftable(trtf, racef, binep))
xs2 <- a2[,2]
n2 <- a2[,1]+a2[,2]

xpos <- c(.85,1.85,2.85,3.85,1.15,2.15,3.15,4.15)
cols <- rep(c('black','seagreen2'),each=4)

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

new.line <- trellis.par.get('superpose.line')
new.line$col <- c('black','seagreen2')
new.line$lty <- c(1,1,1,1)
new.symbol <- trellis.par.get('superpose.symbol')
new.symbol$col <- c('black', 'seagreen2')
new.symbol$pch <- c(1, 4, 16, 8)
trellis.par.set('superpose.line', new.line)
trellis.par.set('superpose.symbol', new.symbol)

xYplot(Cbind(binep,Lower,Upper)~xaxis|study, groups=trtf, data=ss,
xlab='Race',
ylab='Percent Responders',
ylim=c(ss$Lower-15,ss$Upper+1),
aspect=1,
scales=list(x=list(at=1:4, labels=(unique(ss$racef))),
y=list(at=seq(20,60,10), labels=as.character(seq(20,60,10)))),
key=list(type='p',
points=list(pch=trellis.par.get('superpose.symbol')$pch[1:2],
col=trellis.par.get('superpose.symbol')$col[1:2]),
text=list(levels(base$trtf),
col=trellis.par.get('superpose.symbol')$col[1:2]),
columns=2, cex=1.25, title='Treatment'))

# Overall means of the study
oo <- with(eot, summarize(100*binep, llist(study,trtf), mean))

trellis.focus('panel',1,1, highlight=FALSE)
panel.abline(h=oo[1:2,3], col=trellis.par.get('superpose.symbol')$col[1:2], lty=c(2,2))
for(i in 1:8){
ltext(x=xpos[i], y=8, labels=bquote(frac(.(xs1[i]),.(n1[i]))),
cex=.95, col=cols[i])
}
panel.abline(h=14, col='grey60')
trellis.unfocus()

trellis.focus('panel',2,1, highlight=FALSE)
panel.abline(h=oo[3:4,3], col=trellis.par.get('superpose.symbol')$col[1:2], lty=c(2,2))
for(i in 1:8){
ltext(x=xpos[i], y=8, labels=bquote(frac(.(xs2[i]),.(n2[i]))),
cex=.95, col=cols[i])
}
panel.abline(h=14, col='grey60')
trellis.unfocus()

t1 <- with(eot[eot$study%in%'Study 1',], table(trtf))
t2 <- with(eot[eot$study%in%'Study 2',], table(trtf))

trellis.focus('strip', 1, 1, highlight=FALSE)
ltext(x=0.025, y=.5, paste('N=', t1[1], sep=''),
col=c('black'), adj=c(0,NA), cex=.9)
ltext(x=0.975, y=.5, paste('N=', t1[2], sep=''),
col=c('seagreen2'), adj=c(1,NA), cex=.9)
trellis.unfocus()
trellis.focus('strip', 2, 1, highlight=FALSE)
ltext(x=0.025, y=.5, paste('N=', t2[1], sep=''),
col=c('black'), adj=c(0,NA), cex=.9)
ltext(x=0.975, y=.5, paste('N=', t2[2], sep=''),
col=c('seagreen2'), adj=c(1,NA), cex=.9)
trellis.unfocus()
#dev.off()
SAS-Code - Attachment

SAS-Code

Stata-Code - Attachment

Stata-Code

Other Code - Attachment

Other Code

Keywords subgroup analysis, conditioned variable, confidence intervals, treatment groups
OPTIONAL FIELDS

References This graphic relies extensively on the use of the trellis.focus function which allows one to zoom into parts of the trellis graphic and add annotations.
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 plottable_referemce_200.jpg
Topic revision: r13 - 30 Mar 2012 - 13:43:18 - MaryBanach
 

Copyright & by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CTSPedia? Send feedback