Questions tagged [t-test]

Related to statistical hypothesis testing. Most software packages used for statistical analysis (including R) provide functions for performing the t-test. Use this tag for questions related to the t-test.

The t-test is also known as the "Student's t-test" after the pseudonym of its inventor. It is used for comparing the means of two samples, or the mean of one sample (or even parameter estimates) with a specified value. See the Wikipedia article for more details. Refer to the R documentation for details on the t.test function arguments and return values.

494 questions
1
vote
1 answer

two sample t-test in r

I have a dataframe like this df <- structure(list(ID = c(243, 292, 317, 388, 398, 404, 463, 473, 842, 844, 858, 862, 869, 871, 879, 888), Zone = c(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2), Gen = c("Male", "Male", "Other Gender Identity",…
Tathagato
  • 348
  • 1
  • 11
1
vote
1 answer

SPSS Independent Samples t Test with no grouping column & all of the date in one row

This might be quite basic question, but: Lets say I have a study where reaction times are measured twice before drinking alcohol and twice after drinking specific amount of alcohol, and hypothesis is that alcohol would increase the reaction time. I…
mpartan
  • 1,296
  • 1
  • 14
  • 30
1
vote
0 answers

Adding t-test value to grouped data set in r

When running stat_compare_means I am unable to run a t-test. If I leave the brackets empty it will attempt a Wilcoxen but I don't think it is accurate. I have tried editing several settings under stat_compare_means and tried changing to using…
saobregon
  • 11
  • 2
1
vote
1 answer

t-test for count data using stat_compare_means

I'm trying to run a simple t.test on a dataset counting the decision a beetle made between two options. I.E. a beetle walked toward or away from it's host tree. Is there a way to use stat_compare_means on count data in ggplot? ggplot(dat %>%…
twohats
  • 13
  • 4
1
vote
1 answer

confint vs intervals for gls (nlme package) models

There are two methods available to estimate confidence intervals for a gls model in R: using function confint and function intervals. The results are not the same and I want to know what are the causes of the differences and which one is the…
1
vote
1 answer

How to plot Two Sample t.test() means, medians, and CI in R?

With the data I have, this R code x <- t.test(Age ~ Completers, var.equal = TRUE, data = data) renders the following result: Two Sample t-test data: Age by Completers t = 0.93312, df = 1060, p-value = 0.351 alternative hypothesis: true…
pdeli
  • 436
  • 3
  • 13
1
vote
2 answers

How to Test the significance of difference in mean estimates in R?

Solved: I'm working on market research and want to conduct a Multinomial Logit Model by R based on the estimation below. It is designed to test whether consumers' exposure to specific advertisements could influence their preferences for the…
Sissie
  • 11
  • 2
1
vote
2 answers

Complex multiple t tests with data in 2 data.frames in R

I have two data.frames (code below). The row ids in the data.frames match. set.seed(12345) df1 <- data.frame(id=c(letters), g1=c(rep(0,7), rep(1,18), "NA"), g2=c(rep("NA", 3), rep(0,23)), g3=c(rep(0,5), rep("NA",20),1), …
Sylvia Rodriguez
  • 1,203
  • 2
  • 11
  • 30
1
vote
1 answer

Running multiple T-Test on variables with groupings in R (not using rstatix)

I've a data frame containing different items (and it's cost) and also it's subsequent groupings. I would like to run a T-Test for each item based on their groupings to see if their mean differs. Anybody knows how to do this in R without using the…
Luther_Proton
  • 348
  • 1
  • 7
1
vote
0 answers

R code for paired permutation t-test in a loop

I have some genetic data, which looks…
EmmaH
  • 85
  • 6
1
vote
1 answer

T-test on multiple dataframes and output into dataframe

I have multiple pandas data frames that I perform the t-tests on. All data frames consist of a specific column named count that I perform the t-tests on. def retrieve_name(var): callers_local_vars =…
nerd
  • 473
  • 5
  • 15
1
vote
2 answers

Running multiply Anova and/or T-Test on variables in one dataframe in R

I've the a data frame containing different items (and it's cost) and also it's subsequent groupings. I would like to run an Anova and/or T-Test for each item based on their groupings to see if their mean differs. Anybody knows how to do this in R? A…
Luther_Proton
  • 348
  • 1
  • 7
1
vote
1 answer

Multiple barplot along with t-test

I want a barplot based on the number of occurrences of a string in a particular column in a dataset in r. At the same time, I want to run a t-test and plot the significant p-values using stars on the top of the bars. The nonsignificant can be…
driver
  • 273
  • 1
  • 13
1
vote
1 answer

grouped box plot with t-test and printed p-values

I'm trying to visualize a grouped boxplot with p-values in r. I've tried plotting the box plot, and it works but while performing the t-test and then plotting the significant p-values, I'm facing an issue. Instead of the numerical p-values, it…
driver
  • 273
  • 1
  • 13
1
vote
0 answers

Tidyr: Paired t-test using a Bonferroni Correction using the pairwise_t_test() Function: Incorrect P-Value and Adjusted P-Value Outputs in R

Issue: During my analysis, I am having problems conducting a pairwise t-test (probably because I am a newbie to coding these types of statistical tests). I have nine parameters that are measurements of whistle types from dolphin species. I want to…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31