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

Compute critical value T-Score using Math.NET

Any thoughts on how I can compute critical value in a t-distribution using Math.NET? More concretely, I am looking for how to compute the following excel function using Math.NET. =T.INV.2T(0.05, 8)
Dr. Strangelove
  • 2,725
  • 3
  • 34
  • 61
2
votes
0 answers

Error in BESTmcmc(y1, y2) : could not find function "BESTmcmc" in Rstudio

I am learning how to use Bayesian t-tests using the R package "BEST", and practicing with the example on page two from https://cran.r-project.org/web/packages/BEST/BEST.pdf It looks like this: ## Comparison of two groups: ##…
Kitty Depa
  • 21
  • 2
2
votes
2 answers

Julia language: Redirecting stdout does not affect every println // How to extract value from stdout

My original aim was to perform a ttest and gaining a pvalue. I used OneSampleTTest which looked promising yet the results ended up in stdout like this: julia> OneSampleTTest([1,2,3,4,5],3.1) One sample t-test ----------------- Population details: …
grimbar
  • 35
  • 4
2
votes
2 answers

Why data constructor is not in scope here

I am trying to do Student T-test as provided here: import Data.Vector as V import Statistics.Test.StudentT sampleA = V.fromList [1.0,2.0,3.0,4.0,1.0,2.0,3.0,4] sampleB = V.fromList [2.0,4.0,5.0,5.0,3.0,4.0,5.0,6] main = print $ StudentT sampleA…
rnso
  • 23,686
  • 25
  • 112
  • 234
2
votes
1 answer

T-test with bootstrap in R

I am trying to run a t-test with bootstrap in R. I have a sample of 50 participants, 39 are females. I have a dependent variable, d' and want to see if males and females differ on this var. As I only have 11 male participants, I want to use a…
Glu
  • 327
  • 3
  • 14
2
votes
1 answer

How can I compare two lists of means in a dataframe, by row

I am trying to compare with t-test, two list of gene expressions mean values. My matrix is built like this col1 <- c(6.7 , 8.4, 3.1) col2 <- c(7.7, 8.8, 3.6) matrix <- cbind(col1, col2) rownames(matrix) <- c("gene1", "gene2", "gene3") I want to get…
Alain_LU
  • 21
  • 1
2
votes
1 answer

How to perform (modified) t-test for multiple variables and multiple models

I have created and analyzed around 16 machine learning models using WEKA. Right now, I have a CSV file which shows the models' metrics (such as percent_correct, F-measure, recall, precision, etc.). I am trying to conduct a (modified) student's…
2
votes
2 answers

Trouble using ttest_ind on pandas dataframe

I'm currently working with a dataframe in the form: import pandas as pd import numpy as np df = pd.DataFrame([['A', 12.1, 11.4, 15.1, 9.9], ['B', 8.3, 10.3, 16.6, 7.8], ['B', 7.8, 11.1, 16.3, 8.4], ['B', 8.6, 10.9, 16.4, 8.1],…
user987443
  • 35
  • 3
2
votes
0 answers

For loop paired to t tests returning matrix error

I have a large set of data frames and would like to conduct a series of t-tests between different columns to find significance. Each data frame has identical headers but a different number of rows. This is my code: fileNames <- Sys.glob("*.txt") for…
A. Palmer
  • 139
  • 10
2
votes
1 answer

Running a two-sample t.test with unequal sample size in R

I am trying to run a two-sample t-test for a difference between a treatment and control group. Data is not paired. When I subset my original dataframe, I found that I have unequal sample sizes (not an issue by hand, but R seems to make it an issue).…
Trying2Learn
  • 23
  • 1
  • 1
  • 3
2
votes
1 answer

One sample T-TEST IN R within groups

I have been doing one sample t-tests in R but today I have got one big challenge. I have data grouped in by one variable and I want to perform a one sample t-test per group. I can do this perfectly well in SPSS but it's now a headache in R, whoever…
user322203
  • 101
  • 7
2
votes
2 answers

Conducting a t-test across two different data frames with switched rows/columns?

Sorry for the confusing title, this one's a bit hard to describe. Basically, I've got two data tables which look similar to this: df1 <- data.frame(SNP=c("W", "X", "Y", "Z"), Gene.ID=c("A", "B", "C", "B"), pval=NA) df2 <-…
2
votes
1 answer

two sample t test in R: direction of comparison?

Let's say I have data of the lung capacity of smokers and non-smokers. So we have the variable "lungCap" with a numeric value, and the variable "smoking" with the values "yes" or "no". Now I want to see if the capacity of non-smokers is bigger than…
E_H
  • 131
  • 7
2
votes
0 answers

Welch t-test, adjust p-value on permutation based FDR in R

I would need some help to find a way to compute q-values from Welch p-values in R, using permutation FDR method, as for SAM technique. Assuming my data are as follow x = matrix(rnorm(1000*3),nrow=1000) y = matrix(rnorm(1000*3),nrow=1000) I can…
pisistrato
  • 375
  • 2
  • 14
2
votes
1 answer

R: t-test between rows within each factor level

This is the data frame I'm trying to work on: m <- matrix(rnorm(108, mean = 5000, sd = 1000), nrow = 36) colnames(m) <- paste('V', 1:3, sep = '') df <- data.frame(type = factor(rep(c('T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8',…
Tpg333
  • 33
  • 6