Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upsmall 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.00116i.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