data( ox )
ox <- Meth( ox )
# The simplest possible Bland-Altman plot
BA.plot( ox )
## With bells and whistles, comparing the naive and model
par( mfrow=c(2,2) )
BA.plot( ox, model=NULL, repl.conn=TRUE, col.lines="blue",
axlim=c(0,100), diflim=c(-50,50), xaxs="i", yaxs="i",
las=1, eqn=TRUE, dif.type="lin", pl.type="BA", sd.type="lin",
grid=1:9*10, digits=3,font.eqn=1)
par(new=TRUE)
BA.plot( ox, model="linked", repl.conn=TRUE, col.lines="red",
axlim=c(0,100), diflim=c(-50,50), xaxs="i", yaxs="i",
las=1, eqn=FALSE, dif.type="lin", pl.type="BA", sd.type="lin",
grid=1:0*10, digits=3)
BA.plot( ox, model=NULL, repl.conn=TRUE, col.lines="blue",
axlim=c(0,100), diflim=c(-50,50), xaxs="i", yaxs="i",
las=1, eqn=TRUE, dif.type="lin", pl.type="conv", sd.type="lin",
grid=1:9*10, digits=3,font.eqn=1)
par(new=TRUE)
BA.plot( ox, model="linked", repl.conn=TRUE, col.lines="red",
axlim=c(0,100), diflim=c(-50,50), xaxs="i", yaxs="i",
las=1, eqn=FALSE, dif.type="lin", pl.type="conv", sd.type="lin",
grid=1:9*10, digits=3)
# The same again, but now logit-transformed
BA.plot( ox, model=NULL, repl.conn=TRUE, col.lines="blue",
axlim=c(0,100), diflim=c(-50,50), xaxs="i", yaxs="i",
las=1, eqn=TRUE, dif.type="lin", pl.type="BA", sd.type="lin",
grid=1:9*10, digits=3,font.eqn=1,Transform="pctlogit")
par(new=TRUE)
BA.plot( ox, model="linked", repl.conn=TRUE, col.lines="red",
axlim=c(0,100), diflim=c(-50,50), xaxs="i", yaxs="i",
las=1, eqn=FALSE, dif.type="lin", pl.type="BA", sd.type="lin",
grid=1:0*10, digits=3,Transform="pctlogit")
BA.plot( ox, model=NULL, repl.conn=TRUE, col.lines="blue",
axlim=c(0,100), diflim=c(-50,50), xaxs="i", yaxs="i",
las=1, eqn=TRUE, dif.type="lin", pl.type="conv", sd.type="lin",
grid=1:9*10, digits=3,font.eqn=1,Transform="pctlogit")
par(new=TRUE)
BA.plot( ox, model="linked", repl.conn=TRUE, col.lines="red",
axlim=c(0,100), diflim=c(-50,50), xaxs="i", yaxs="i",
las=1, eqn=FALSE, dif.type="lin", pl.type="conv", sd.type="lin",
grid=1:9*10, digits=3,Transform="pctlogit")
## Model data frame generation
a <- data.frame(x=seq(1, 30)+rnorm(mean=0, sd=1, n=30),
y=seq(1, 30)*rnorm(mean=1, sd=0.4, n=30))
## Call to PBreg
x <- PBreg(a)
print(x)
par(mfrow=c(2,2))
plot(x, s=1:4)
## Or the same using "Meth" object
a <- Meth(a, y=1:2)
x <- PBreg(a)
print(x)
par(mfrow=c(2,2))
plot(x, s=1:4)
Run the code above in your browser using DataLab