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

How to create a boxplot from t -test

this is the code and data i already have: library(tidyverse) t.test(BMIS ~ CONDITION, var.equal =TRUE, data = BMIS_DATA) descriptive_statistics = BMIS_DATA %>% group_by(CONDITION) %>% …
Iesha Tucker
  • 3
  • 1
  • 3
0
votes
1 answer

R studio paired t-test on only 1 group of 2 groups

Good day. I am an R beginner. I have a data set with 2 different groups (group 1 and group 2) and I would like to do paired t-tests on only group 1 or only group 2. I calculated energy at time point 1 and at time point to for members of each…
0
votes
2 answers

Back calculating t-statistic in R

I have these information from an independent samples t-test. p-value=0.989 sample size for group 1 (n1)= 17 sample size for group 2 (n2)= 18 mean difference= 0.30 I need the t-statistic for this test. I did trial and error with the code for…
Jazmin2252
  • 11
  • 2
0
votes
0 answers

Compare mean of a variable between two group in RStudio

This may be the wrong place to ask this question. If so, I apologize. I have a variable named qualitymean which is the mean of a bunch of likert answer variables: qualitymean <- rowMeans(subset(please, select = c(PSTFDQ, PHTUDQ, PFOCDQ, PSWIDQ,…
user14840934
0
votes
1 answer

T-test comparing multiple columns to other columns

I am relatively new to R and need some help with my data analysis. In the attached table, Master Protein Accession column consists of a list of proteins that are increased or decreased in the cortex(C) under three conditions, i.e., control (C),…
0
votes
1 answer

Significance testing in r 5% level

If a variable in a regression is statistically significant at the 0.1% level does that automatically mean it's also significant at the 5% level? I got the output for my variables with *** and now want to find out whether that automatically infers…
rstudy123
  • 1
  • 2
0
votes
1 answer

Multiple t-tests over columns

I'm still very novice to R. data.frame(treatment = c("D", "E", "F", "G"), group = c(rep(c("A", "B"), each = 4)), effect = c(1, 4, 5, 6, 8, 9, 10, 11)) treatment group effect 1 D A 1 2 E A 4 3 …
0
votes
1 answer

Is there a way to run multiple t.tests that produce results that can be easily stored in table format?

I'm working with a set of data that I want to subset and compare t-tests for. The end goal is to have an easily readable table as an output that can be presented to a reader. Currently I am using individual t-tests that give results one at a time,…
Auresm
  • 139
  • 8
0
votes
1 answer

statistical test in r to show significant difference between groups

I am working with small scale survey data in r. I would be grateful for input on what would be best/most simple test to use to show any row-wise significance between group differences for a series of options (opt1-opt9). When my data is…
adame
  • 137
  • 7
0
votes
1 answer

Can't apply t-test for data frame in R

I tend to apply t-test for each row in my data frame, which is the microarray data, comparing columns 2:13 and 14:67 by these code: t_test = apply(Df, 1, function(x) { t.test(x[2:13], x[14:67])$p.value } ) However, I got this error: Error in if…
0
votes
1 answer

Hotellings T2 in R

I am trying too use the Hotellings T2 test in r too compare two vectors. Will the hotellings t2 test automatically calculated the mean of the 2 vectors I am comparing or will I have too do it myself? Many thanks The function I am using…
0
votes
1 answer

A subtle problem with t-tests over multiple columns

I have a dataframe with responses to multiple questions (reproducible example with 2 questions below) set.seed(1) df <- data.frame ( UserId = c(rep("A", 4), rep("B", 4), rep("C", 4), rep("D", 4)), Sex = c(rep("Female", 8),…
Thomas Philips
  • 935
  • 2
  • 11
  • 22
0
votes
1 answer

Error in Shinyapp :grouping factor must have exactly 2 levels

Recently, I try to learning shinyapp, and I try to do a shinyapp for t-test: library(shiny) shinyUI(fluidPage( # Application title titlePanel("t test shinyapp"), # Sidebar set sidebarLayout( sidebarPanel( …
0
votes
0 answers

How to do a t-test for dependent variable by groups

i want to show, if there is there a significant change in VO2max between the two groups (Experimentalgruppe and Kontrollgruppe). Therefor i have to make zwo t-tests (betwenn t0/t1 and t1/t2) for dependet variables with the following data: # A…
Jugglerz
  • 15
  • 4
0
votes
1 answer

T test in R and problems with run

When I want to make a t- test in result console gives me feedback: Błąd w poleceniu 'var(x)':Calling var(x) on a factor x is defunct. Use something like 'all(duplicated(x)[-1L])' to test for a constant vector. Dodatkowo: Komunikat ostrzegawczy: W…
Marcin Sajdak
  • 55
  • 1
  • 5