stan-dev / stan-dev/posterior

Pretty printing MCSE

Open
#120 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
R
Stars
171
Forks
26
Avg merge
2d 18h
Merged PRs (30d)
3

Description

In #117 I wrote

I don't know if this would make sense but adding here, that there could be something that would show the mcse in compact format. I assume it would require new variable type, like expectation variable evar, but I guess that could cause too much trouble even if it would look nice

E(eight_schools_rvars$mu, MCSE=TRUE)
evar[1] E ± MCSE:
[1] 4.2 ± .2

Pr(eight_schools_rvars$mu>0, MCSE=TRUE)
evar[1] Pr ± MCSE:
[1] 0.9 ± 0.02

Instead of an option, I guess different function name would be safer.

More I think it, more I dislike having yet another variable type, but I open the issue if there are ideas for otherwise make it easy to pretty print MCSE. Maybe a variant of summarize_draws or option for that, that would choose the numbers of digit to show best on MCSE and would show MCSE using ± as above?

The current way is to do

> summarize_draws(eight_schools_rvars$mu, mean, mcse_mean, quantile2, mcse_quantile)
# A tibble: 1 x 7
  variable                mean mcse_mean     q5   q95 mcse_q5 mcse_q95
  <chr>                  <dbl>     <dbl>  <dbl> <dbl>   <dbl>    <dbl>
1 eight_schools_rvars$mu  4.18     0.150 -0.854  9.39   0.551    0.415

and the difference would be that with pretty printing we could get something like

  variable                mean ± mcse   q5 ± mcse   q95 ± mcse 
1 eight_schools_rvars$mu  4.2 ± 0.2     0.9 ± 0.6   9.4 ± 0.4

where ± helps to group together the related information.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing summarize_draws entry point and the compact MCSE examples in this issue. Decide whether the presentation belongs in summarize_draws or a separate function, including how digits and ± grouping should work. Done means a documented API produces the proposed compact summaries without introducing another variable type.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.