RMS Discussions

Dear professor,

I would like to hear your thoughts on how the 95% CI is calculated in the summary.rms function.

I noticed that the method used in summary.rms is similar to the formula: effect ± 1.96 * SE, which is the same as confint.default. However, this method differs from confint (profile likelihood method).

The summary.rms does not seem to provide a profile likelihood method or other methods.

I have been using confint and found that the output of rms is different. I want to ask if the effect ± 1.96 * SE method is sufficient most of the time and there is no need to consider other methods (such as the profile likelihood method of confint).

I wrote an R example to confirm the difference between the two methods.

require(rms)
set.seed(1)
options(datadist =  datadist(iris))
iris$x <-  sample(0:1, 150, replace = TRUE)

f <- glm(x ~ Sepal.Length,iris, family = binomial)
ff <- lrm(x ~ Sepal.Length,  iris)

confint(f)[2,1]
Waiting for profiling to be done…
[1] -0.4335911
confint.default(f)[2,1]
[1] -0.4307842
summary(ff, Sepal.Length = c(1,2))[1,4]- qnorm(0.975)*summary(ff, Sepal.Length = c(1,2))[1,5]
[1] -0.4307842

confint(f)[2,2]
Waiting for profiling to be done…
[1] 0.346351
confint.default(f)[2,2]
[1] 0.3451433
summary(ff, Sepal.Length = c(1,2))[1,4]+ qnorm(0.975)*summary(ff, Sepal.Length = c(1,2))[1,5]
[1] 0.3451433

Profile likelihood is much preferred. The problem with confint is that you are limited to simple linear variables or binary covariates. Version 7.0 of rms now supports general likelihood profile CIs using the contrast.rms function (but not with summary.rms). For a simple linear effect, for example where you want an interval for changing x from a to b use

require(rms)
dd <- datadist(d); options(datadist='dd')
f <- lrm(y ~ x + x2, data=d, x=TRUE, y=TRUE)
contrast(f, list(x=b), list(x=a), conf.type='profile')

Sometimes you may want to add plot_profile=TRUE. You’ll find that this syntax gets no more complicated with you add nonlinear terms or interactions.

The more I compare likelihood intervals with Wald intervals the more I think we need to get away from Wald intervals. The same goes for hypothesis tests.

1 Like