tableone icon indicating copy to clipboard operation
tableone copied to clipboard

Table one in r not showing test name

Open EddieItelman opened this issue 4 years ago • 1 comments

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.

EddieItelman avatar May 08 '20 19:05 EddieItelman

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

SimonStolz avatar Jul 29 '20 09:07 SimonStolz