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.4307842confint(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