s-news
[Top] [All Lists]

Invidual scaling when using xyplot - overwriting ylim in a panel

To: <s-news@lists.biostat.wustl.edu>
Subject: Invidual scaling when using xyplot - overwriting ylim in a panel
From: "TKT (Thomas Klitgaard)" <tkt@novonordisk.com>
Date: Fri, 14 Dec 2007 10:23:49 +0100
Thread-index: Acg+MwjROx+v3UEtRpmK8Z24SwOMtg==
Thread-topic: Invidual scaling when using xyplot - overwriting ylim in a panel

Dear all,

As part a modelling problem that I'm currently working on, I need to make plots of
responses DV (observed data value), fittet curve IPRE and fitted curve #2 PRED,
for two groups PK and PD of analysis (indexed by CMT, see below), all in the samme plot, and with
one plot per individual (ID). That the easy bit, however.

Group PK and PD generally in the same range, but the between-ID varation in Ymax is
considerable. Using xyplot (see below), I chose scales=list(y=list="free") to
accommodate this. However, even if individually scaled, still it is max(DV) that
determines the ylim on the individual panels and in those cases where the
max(IPRE) or max(PRED) are > max(DV) within in a panel, lines for IPRE and/or PRED are
cut-off.

I would like overwrite/set, for each panel, ylim to the max(DVgroupPK,IPREgroupPK,PREDgroupPK,
DVgroupPD,IPREgroupPD,PREDgroupPD) in that panel (ie. for that ID). How do I do this?

Thanks in advance!

Thomas Klitgaard
Principal Scientist
Biomodelling, Novo Nordisk A/S, Denmark

----

xyplot(DV~TIME|ID,data="">
                {
                        panel.superpose(x,y,type="p",subscripts,...);
                        panel.superpose(AllResults[subscripts,]$TIME,log10(AllResults[subscripts,]$PRED),type="l",subscripts,...);

                        panel.superpose(AllResults[subscripts,]$TIME,log10(AllResults[subscripts,]$IPRE),type="l",lty=4,subscripts,...);

                        mtext(side=3,line=-1,cex=.8,adj=.95,paste("Dose (ug/kg)=",AllResults[subscripts,]$DOSE))
                },
       
                strip=function(...) strip.default(...,style=1, strip.names=c(T,F),strip.var.names=c("Subject ID")),
                scales=list(y=list(relation="free"),x=list(at=c(0,xGrid),
                labels=c("0","","","","","","","","","","24","","","","","","48","","","","72","","","","96","","","120","","","144","","","168","192","216","240"))),

                main="PK (blue) and PD (red) vs. time (full line: population mean, dashed line: individual mean)",
                xlab="Time after dose (h)",     ylab="Concentration (ng/mL)",xlim=c(0,x.lim), ylim=c(0,y.lim),
                layout=c(2,2),as.table=T)


<Prev in Thread] Current Thread [Next in Thread>