-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
small issue: prettify digits problem in CI upper #40
Comments
First of all sorry that I didn't reply earlier. I didn't receive any notification. Unfortunatley, I cannot check your example as there is no (reproducible) code. Could you please provide a minimal working example which displays the behavior? Thx. |
# Load data set ovarian
data(ovarian, package = "survival")
## fit a Cox model
mod5 <- coxph(Surv(futime, fustat) ~ age, data=ovarian)
summary(mod5)
## Make pretty summary
prettify(summary(mod5),digit=3)
you can find |
There is some strange behavior of Using format(exp(confint(mod5)), digits = 3) returns the correct results: ## 2.5 % 97.5 %
## age "1.07" "1.30" Yet, if one runs debugonce("prettifyPValue")
prettify(summary(mod5), digits=3)
format(object, digits = 3) one gets coef Hazard Ratio CI (lower) CI (upper) se(coef) z Pr(>|z|)
1 age 0.162 1.18 1.07 1.3 0.0497 3.25 0.00116 i.e. the 0 is again removed in CI (upper). The reason is that |
So in short, the real issue is that trailing zeros are droped despite not requested to do this: format(1.299, digits = 3, drop0trailing = FALSE) The option is simply ignored. |
cox regression model, using
digits=3
, CI (upper) show only 2 digitsmy code
prettify(summary(mcox.fit1.train),digits = 3)
my result
The text was updated successfully, but these errors were encountered: