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

Suggestion: support for t-tests #52

Open
cschwem2er opened this issue Mar 1, 2017 · 3 comments
Open

Suggestion: support for t-tests #52

cschwem2er opened this issue Mar 1, 2017 · 3 comments

Comments

@cschwem2er
Copy link

Hi,

as sd-tests and t-tests in R do not provide a lot of information, adding a table function in sjPlot would be very useful.

This is the output of a paired t-test in Stata (see #189):
image
It includes everything that is of interest (group specific and difference wise), means, standard deviations, confidence intervals, nr. of observations, df's, p values.
In comparison this is the t-test in R:
image

For independent two sample t-tests, there could either be a separate function to check for equal variances (var.test in base R), or the t-test function could have a parameter, e.g.var.equal, with options auto, TRUE, or FALSE. In the case of auto, the function could automatically check for variance equality and adjust the degrees of freedom computation if necessary.

@jemus42
Copy link

jemus42 commented Jun 20, 2017

In the meantime, you can pipe that t.test output into broom::tidy, which should give you all the information you might need. You can then pretty up the output via sjt.df or pixiedust, as I do in tadaatoolbox::tadaa_t.test.

@strengejacke
Copy link
Owner

Do you have a reproducible example that resembles the Stata output?

@cschwem2er
Copy link
Author

Hi,
should be easier with the efc dataset:

library(sjmisc)
data(efc)
t.test(c82cop1 ~ e16sex, data = efc, var.equal = TRUE)

	Two Sample t-test

data:  c82cop1 by e16sex
t = 0.11281, df = 898, p-value = 0.9102
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.07671384  0.08607089
sample estimates:
mean in group 1 mean in group 2 
       3.122034        3.117355 

image

@strengejacke strengejacke transferred this issue from strengejacke/sjPlot Nov 18, 2018
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

3 participants