stan-dev / stan-dev/posterior

Suggestion: Add alternative uncertainty notation for rvar

Open
#299 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

While the current rvar notation of mean ± sd is straightforward, I think it might be beneficial to offer alternative notations. I've found the mean(sd) style to be quite popular in some contexts, e.g. in physics and chemistry.

To give a bit of context, the R package errors offers a similar functionality to rvar, but it is only based on mean and standard deviation:

> library(posterior)
> library(errors)
> set.seed(19725654)
> rnorm(100, mean = 5, sd=10) -> x
> mean(x)
[1] 5.892738
> sd(x)
[1] 11.32585
> errors::set_errors(mean(x), sd(x))
6(10)
> posterior::rvar(x)
rvar<100>[1] mean ± sd:
[1] 5.9 ± 11 

Considering this, would it be possible to introduce an R option, say rvar.uncertainty.notation? This could let users choose between the current plusminus style and the alternative parenthesis notation.

Thanks for considering!

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 locating the rvar output/formatting entry point that currently renders mean ± sd. Check how an R option could select plusminus versus parenthesis notation, then verify that both styles produce the requested output for the example values and that the default remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.