set.seed(888)
y<-sample(c(0,1), 100, replace = TRUE)
x1<-rnorm(100,2,3)
x2<-rnorm(100,1,4)
library(rms)
f1<-lrm(y~x1,,x=TRUE,y=TRUE)
f2<-lrm(y~x2,,x=TRUE,y=TRUE)
plot(calibrate(f1))
plot(calibrate(f2),add=TRUE)
with the above code, it is supposed to add both calibrate plots to the same figure. However, It reported errors:
Warning messages:
1: In plot.window(...) : "add" is not graphical parameter
2: In plot.xy(xy, type, ...) : "add" is not graphical parameter
3: In axis(side = side, at = at, labels = labels, ...) : "add"is not graphical parameter
4: In axis(side = side, at = at, labels = labels, ...) : "add"is not graphical parameter
5: In box(...) : "add"is not graphical parameter
6: In title(...) : "add"is not graphical parameter
Or are there any other methods for this purpose? also I want to specify different colors for x1 and x2 curves. I don't know how to specify the argument par.corrected=list(col="blue")
. It does not work.
plot(calibrate(f2),par.corrected=list(col="blue",lwd=2))
#n=100 Mean absolute error=0.061 Mean squared error=0.00541
#0.9 Quantile of absolute error=0.109
Warning messages:
1: In plot.window(...) : "par.corrected"is not graphical parameter 2: In plot.xy(xy, type, ...) : "par.corrected"is not graphical parameter 3: In axis(side = side, at = at, labels = labels, ...) :
"par.corrected"is not graphical parameter 4: In axis(side = side, at = at, labels = labels, ...) : "par.corrected"is not graphical parameter 5: In box(...) : "par.corrected"is not graphical parameter 6: In title(...) : "par.corrected"is not graphical parameter