harrelfe / rms

Regression Modeling Strategies
https://hbiostat.org/R/rms
Other
172 stars 48 forks source link

Calibration not working for ols #61

Closed tamas-ferenci closed 6 years ago

tamas-ferenci commented 6 years ago

This example (taken from the help file):

set.seed(1)
x1 <- runif(200)
x2 <- sample(0:3, 200, TRUE)
distance <- (x1 + x2/3 + rnorm(200))^2
d <- datadist(x1,x2)
options(datadist="d") 
f <- ols(sqrt(distance) ~ rcs(x1,4) + scored(x2), x=TRUE, y=TRUE)
calibrate(f)

results in Error in !fail : invalid argument type. (But validate(f) works fine.)

harrelfe commented 6 years ago

Sorry about that. Fix committed to Github and will be in next release to CRAN.

tamas-ferenci commented 6 years ago

I checked it on my original problem, and it works, thank you!