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

Table one in r not showing test name #63

Open
EddieItelman opened this issue May 8, 2020 · 1 comment
Open

Table one in r not showing test name #63

EddieItelman opened this issue May 8, 2020 · 1 comment

Comments

@EddieItelman
Copy link

EddieItelman commented May 8, 2020

Under "Test" the result is not showing the name of the test performed (chi square, ANOVA etc).

nor did I find documentation on how to make this happen.

I would like to know the statistical method performed to obtain the P value.

@SimonStolz
Copy link

SimonStolz commented Jul 29, 2020

I agree! "Normal" test is left unspecified and just "blank" by default (?). This is somewhat confusing. There should be also something written in it (not only for exceptions).

It would be ideal to write specific test names here and provide a clearer overview which R function is behind which test in the documentation: For example, documentation of CreateTableOne suggests for normal to be by default "oneway.test", and "is equivalent of the t-test when there are only two groups.". Maybe one could write stata::oneway.test() instead to make clear referring to the functions and provide an example:

I tried and found to be equivalent:

set.seed(1)
x <- rnorm(50, 50, 34)
set.seed(2)
y <- rnorm(50, 70, 34)
d <- rbind(cbind(G = 1, x),
           cbind(G = 0, y)) %>% as.data.frame()

Then
CreateTableOne(vars = "x", strata="G", data = d)
gives me

p < 0.006

oneway.test(x ~ G, d) gives me

F = 7.8826
p-value < 0.006119

t.test(x ~ G, data = d, var.equal=TRUE) gives me

t = 2.8076
p-value < 0.006119

Also helpful would be to have optionally display columns for:

  • test statistics (e.g., t-statistic score)
  • differences between mean values of the strata

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