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
0
votes
1 answer

Need help to perform an automated unpaired t-test over different columns from CSV document in R

I would like to perform an automated paired t-test between column 2 and 3, 4 and 5, 6 and 7 and so on. When I use the code below, I am able to perform a t-test, but not an unpaired t-test. data: patient weight_1 weight_2 BMI_1 BMI_2 chol_1…
0
votes
1 answer

how is it that a corrected pairwise comparison yields a p.value < then a single t.test?

Hi suppose I have these results df <- structure(list(len = c(4.2, 11.5, 7.3, 5.8, 6.4, 10, 11.2, 11.2, 5.2, 7, 15.2, 21.5, 17.6, 9.7, 14.5, 10, 8.2, 9.4, 16.5, 9.7, 16.5, 16.5, 15.2, 17.3, 22.5, 17.3, 13.6, 14.5, 18.8, 15.5, 19.7, 23.3, 23.6,…
Ahdee
  • 4,679
  • 4
  • 34
  • 58
0
votes
1 answer

Error in svyttest.default(y ~ x, survey_obj) : group must be binary -> how do I handle this problem?

I have some problems concerning the svytest function of the survey package. My goal is to perform a simple t-test of the hypothesis: Lower-educated people have greater concerns over the immigration of immigrants. The dependent variable is coded as a…
Bacher
  • 1
  • 2
0
votes
1 answer

t-test for two clusters Python

I am doing kmeans clustering, and want to test the resultant clusters are statistically different. In 3 level clustering, I test cluster 0 with cluster 1 and then with cluster 2. Then I test cluster 2 with cluster 3. I tried to apply t-test…
Saif
  • 95
  • 8
0
votes
0 answers

Convert t-test summary to a dataframe in python?

I performed a t-test on my dataframe and want to access the p-values from the t-test results. Some have suggested to use .summary of the t-test results shown below: cat1 = df[df['Drug']=='Drug A'] cat2 = df[df['Drug']=='Drug B'] results =…
user17304179
0
votes
0 answers

T-test after running sentiment analysis

I am trying to run a t-test after doing the sentiment analysis. I did the sentiment analysis, and grouped my data into two parts: library(textdata) afinn_dictionary <- get_sentiments("afinn") news_tokenized <- full_data %>% unnest_tokens(word,…
monete
  • 19
  • 5
0
votes
1 answer

Difference in T-distribution value calculated from excel and manually checked from table

I want to find the value of a T-distribution for a level of significance set at 5% and degrees of freedom equaling 10 in an excel sheet. When manually calculating from a table, I found the value is 2.228, but Excel gives a value of 0.961. Am I doing…
Madhav
  • 9
  • 1
  • 5
0
votes
0 answers

Generate grouped std deviation columns with summarise() and t.test() results

I am performing many t-tests with similar grouping variables called group (0 or 1) to test the difference in means, for 2* instruments. The groups are defined differently according to external. To streamline output, I am using dplyr() to perform…
Cassandra
  • 137
  • 1
  • 9
0
votes
1 answer

Error in t.test of independent groups: data are esentially constant

I am getting this error when I performed t.test of independent groups created from terciles of several variables. It is strange because when I coded first time it worked, and suddenly has stopped working I post a sample of my database where I am…
0
votes
1 answer

T-test between a group of columns and a sorted list

This is my situation: 11 variables columns vs 1 column. I want to test the single column[which it's sorted into 0 and 1s to create two groups] for each of the 11 columns. Single column and 11 columns have different lenghts and are not…
Filippo
  • 33
  • 1
  • 7
0
votes
1 answer

R: creating a matrix using two id columns and the value column

Purpose I am trying to create a matrix using two id columns (period1, period2) and the value column (p) for each combination of ids. They are results of t-tests. I want to make a square matrix that shows p-value for each combination of ids, similar…
J.K.
  • 325
  • 2
  • 8
0
votes
0 answers

Difference between Bayesian T-Test and Bayesian Informative Hypotheses Evaluation (BAIN) on JASP?

I have three friends in an honours project and we are trying to perform a Bayesian Analysis. I am doing a Welch’s T-Test due to very uneven group sizes, one is doing a linear regression and another is doing a one-way ANOVA. After performing these…
0
votes
1 answer

Run a series of post-hoc t-tests ANOVAs in R

I have run a series of ANOVAs that examine the link between group membership and a range of dependent variables, with a dataframe generated containing the results of each ANOVA model (one row = one ANOVA model). I would now like to run a series of…
M_Oxford
  • 361
  • 4
  • 11
0
votes
3 answers

Multiple t-test on independent group with a large dataframe

I've seen many similar posts but the vast majority of them are at least 3 years old and I'm not really sure they apply to my situations, so here we go. A colleague asked for my help on a multiple t-test on her project. Basically she has 20…
Yo Pomdpin
  • 11
  • 2
0
votes
0 answers

Different output for group mean when comparing t-test and mean() function

I guess this is a trivial concern but I can't figure it out... When performing an independent t-test I always get slightly different results for the mean of group 1 when comparing it to the calculated mean with the simple mean(x, ...) function. Is…
Newby
  • 1