Skip to content
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

Generate legend or summary text to accompany the table #26

Open
tompollard opened this issue Feb 22, 2018 · 2 comments
Open

Generate legend or summary text to accompany the table #26

tompollard opened this issue Feb 22, 2018 · 2 comments

Comments

@tompollard
Copy link
Owner

Consider generating a legend populated with details of the table. e.g. this might include:

@jraffa
Copy link
Collaborator

jraffa commented Feb 26, 2018

So, what I was think of was explainr. https://github.com/hilaryparker/explainr

ptest <- prop.test(x = 500, n = 1008)
explain(ptest)

Yields text generated from a template:

This was a one-sample proportion test of the null hypothesis that the true population proportion is equal to 0.5. Using a significance level of 0.05, we do not reject the null hypothesis, and cannot conclude that true population proportion is different than 0.5. The observed sample proportion is 0.496031746031746 (500 events out of a total sample size of 1,008).

The confidence interval for the true population proportion is (0.464746, 0.5273481). This interval will contain the true population proportion 95 times out of 100.

The p-value for this test is 0.8254979. This, formally, is defined as the probability -- if the null hypothesis is true -- of observing a sample proportion that is as or more extreme than the sample proportion from this data set. In this case, this is the probability -- if the true population proportion is 0.5 -- of observing a sample proportion that is greater than 0.503968253968254 or less than 0.4960317460

TBH, this is probably a separate package

@tompollard
Copy link
Owner Author

the explain() functionality is something that could be nice to implement. explain(var) could be a method called on the tableone object to give a more human readable explanation of the data for this particular variable (e.g. tableone.explain(age)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants