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
0 answers

Place the result of t test within box-plot in R

I have this: fibr <- degs$pathol == "fibrosis" val01 <- degs$value %in% c(0, 1) ttest <- t.test(logFC ~ value, data = degs, subset = fibr & val01) ttest and I would like to add the results to the box-plot in which have the code: degs$id <-…
Francesca C
  • 177
  • 1
  • 9
0
votes
1 answer

Perform T test on DE genes pathologies in R

I have this: subset_1 <- degs[degs$pathol=='fibrosis'°s$value==1,] mean_1 <- mean(subset_1$logFC) sd_1 <- sd(subset_1$logFC) tsub_1 <- t.test(mean_1, sd_1 alternative = c(“two.sided”, “less”, “greater”)) subset_0 <-…
Francesca C
  • 177
  • 1
  • 9
0
votes
0 answers

Anova reject null hypothesis but T-test accept null hypothesis

I tested my data using anova and the result is reject the null hypothesis, meaning that there are significance in my data. So, I tested the same data again using T-test but it then the result said that the null hypothesis is accepted. My data has 3…
0
votes
1 answer

ttest_ind returning nan from arrays of different lengths

I have this dataframe in pandas passes: euc_dist abs_time time_bin 100329 16.0 79.0 0-15 100466 20.0 575.0 0-15 100512 56.0 729.0 0-15 100637 48.0 1314.0 15-30 100744 62.0 1791.0 …
0
votes
1 answer

Writing for loop or function to calculate p values for different dataframes

I am trying to iteratively carry out a T test on Value 1, row1, column1 in dataframe1 in comparison to Value 1 in dataframe 2. Simulation dataframe 1 and 2 DF1<- data.frame(Sample.Name = c("A1_VAR_A", "A2_VAR_A", "A3_VAR_A",…
Akki
  • 3
  • 2
0
votes
0 answers

R: How to perform student's t-test?

I want to perform student's t-test on the res.gs dataframe, where the samples are either is.mut or is.wt. # Students' T-test without KMT2C gene is.mut <- grepl('^[^0]', nokmt2c.res.gs$n_mutated_group1) is.wt <- !grepl('^[^0]',…
melolili
  • 1,237
  • 6
  • 16
0
votes
0 answers

How to add analysis of variance to a Bioconductor plot that combines jitter and boxplots?

I made a plot that shows median expression of some markers across different cell populations. I made it using a Bioconductor package that is based on ggplot and the final result is a ggplot object. Here is the plot and I want to be able to show an…
Cam
  • 1
  • 1
  • 2
0
votes
1 answer

Errors in independent t-test in R

I'm just getting started with R and I need your help on performing an independent sample t-test. I have tried different codes but I keep getting errors. The dataset is a pretty big one, provided by my teacher, and it's essentially about how people…
0
votes
1 answer

R - Multiple t-tests, multiple groups against different controls

So I'm trying to perform multiple t-tests (or ANOVA if that works too) against multiple interventions (compared to a control) at multiple concentrations. Below is a mock-up of my data that I've gotten into long-form (but I have multiple rows for…
mikephel
  • 30
  • 6
0
votes
1 answer

match.arg(alternative) error appearing while trying to carry out t-test - R

Hello everyone :) I'm quite new to R so having quite a few difficulties atm but after trying to do a t-test I'm getting this error: Error in match.arg(alternative) : 'arg' must be NULL or a character vector This is the code I've used: data %>% …
STRhythm
  • 113
  • 8
0
votes
1 answer

Getting an error when performing t-test on log-transformed data

I want to run two t-tests on some data I have on crab and lobster landed weight in North and South Wales, one separate test for each species at the moment. I have log-transformed both weight columns as both had lots of very low values. I run the…
Kiran B
  • 11
  • 2
0
votes
1 answer

Python: How to apply TTEST_IND to multiple columns and multiple variants in a Dataframe?

Need a quick way to apply a t-test to multiple groups and multiple variables. Let's assume I have a table like this: df = pd.DataFrame({'group': 'a a b b'.split(), 'B': [1,2,3,4], 'C': [4,6, 5,10]}) print(df) The group column has a control and…
Alx
  • 1
  • 2
0
votes
2 answers

How to save t-test output with names of columns into a dataframe in R?

I have a dataframe df with following data: df <- structure(list(group = c("cluster2", "cluster2", "cluster1", "cluster2", "cluster2", "cluster2", "cluster2", "cluster1", "cluster1", "cluster2" ), One = c(-0.614639315096381, 0.88834977627436,…
beginner
  • 1,059
  • 8
  • 23
0
votes
0 answers

How perform a t-test on an isobole

I'm trying to perform a t-test on an isobole, to see if the curvature of the line is significantly different from the additive line. Curved Isobole figure I'm using the isobole function in R to make this figure. What I am struggling with is most…
0
votes
2 answers

Convert two lists to dataframe in R

I conducted t test on two data frames and stored results in two separate variables. They turned out to be lists. Now, I want to make a dataframe of t scores and p-values but I am not sure how to do that. I guess the lists are s3 class. The…
user17978261