-
Notifications
You must be signed in to change notification settings - Fork 7
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
Implement method to return a pretty table #22
Comments
Hello, thanks for creating such an amazing package for summarizing simulation results. I saw this issue so I want to add a small suggestion here. It seems the print.summary.simsum() function will only print those nice tables but the summary tables are not returned. This is somewhat inconvenient for channeling the R output for other uses. I know I can extract the "tidy" long table from the summary object directly or use the tidy() function but they are not good for presentation purposes. What are your thoughts on this? Thank you very much! |
Hi, thanks for your feedback! |
Yes. I'll be more specific. Allow me to explain. Currently the
|
Aha, now I see – something like the example below? library(rsimsum)
s2 <- simsum(data = relhaz, estvarname = "theta", true = -0.50, se = "se", methodvar = "model", by = c("baseline", "n"))
#> 'ref' method was not specified, Cox set as the reference
a <- print(summary(s2, stats = "bias"))
#> Values are:
#> Point Estimate (Monte Carlo Standard Error)
#>
#> Bias in point estimate:
#> baseline n Cox Exp RP(2)
#> Exponential 50 0.0215 (0.0328) 0.0239 (0.0326) 0.0183 (0.0331)
#> Exponential 250 -0.0215 (0.0149) -0.0214 (0.0151) -0.0227 (0.0149)
#> Weibull 50 -0.0282 (0.0311) 0.1509 (0.0204) -0.0348 (0.0311)
#> Weibull 250 -0.0120 (0.0133) 0.1482 (0.0093) -0.0139 (0.0137)
library(knitr)
#>
#> Attaching package: 'knitr'
#> The following object is masked from 'package:rsimsum':
#>
#> kable
kable(a[[1]], caption = names(a)[1], align = "r")
Bias in point estimate Created on 2021-09-16 by the reprex package (v2.0.1) |
Yes, that's fantastic! |
Awesome! I just pushed this updated version to GitHub, you can try it out with: library(remotes)
remotes::install_github("ellessenne/github") Let me know your thoughts it you get the chance to play around with it! 😃 |
This would be based on reshaping the output of
get_data()
and pass it toknitr::kable
, or something like that.The text was updated successfully, but these errors were encountered: