Comments (4)
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.
from paper.
# 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)
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.001 **
you can find CI(upper)
has less digits
from paper.
There is some strange behavior of format
, which is (at least part of) the underlying problem.
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 format.data.frame
applies format by columns. I need to check how to fix this.
from paper.
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.
from paper.
Related Issues (20)
- Create merge function
- summary.coxph might already provide CI
- Allow to change main and other plot parameters in plot.ldf
- include.rownames = TRUE breaks table layout
- Allow scientific p-values with proper numbers
- Wrap numeric values in $...$
- Fix scoping in summarize function
- Fix warning on CRAN: not overwrite nlme:::confint.lme
- error while using knitr with papeR HOT 5
- Move part on xtable from markdown to LaTeX vignette HOT 1
- Error in UseMethod("prettify") : no applicable method for object of class "c('lmerMod', 'merMod')" HOT 1
- Error in prettify(): Model can't be refitted and no labels are specified HOT 1
- Do not check error message
- knitr::kable() summary output gives variable names *and* labels
- set labels via named vector
- summarise() masks dplyr::summarise() HOT 7
- Would prettify be updated to be applied to objects of class "crr"? HOT 1
- Passing group when summarizing factor variables HOT 1
- Hello! I was wondering if the function "prettify" would be implemented for objects of class 'aov' and 'listof'? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paper.