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

Multiple t.test between one column and different columns in a table

I've tried to do a loop for a t-test between different columns, with one in particular and different ones. I would like to do a multiple t.test and insert it in a table to summarize the p-values and show with which columns I did the t.test. I tried…
0
votes
1 answer

Loop through variables to produce balance table

I am creating a balance test table using rstatix. I can produce the outcome I want for each variable, but cannot get to loop over a number of variables to produce a table to my linking in one go. require(dplyr) require(rstatix) data <-…
MCS
  • 1,071
  • 9
  • 23
0
votes
0 answers

How to perform a paired paired Wilcoxon Rank Sum Test on imputated data

I would like to perform a paired Wilcoxon Rank Sum on imputated data. Unfortunately, the testEstimates function of the mitml package needs estimates and standard errors of each imputation. I can extract these data from the result of a t.test but…
Gurkenhals
  • 29
  • 7
0
votes
1 answer

One-Tailed Two Sample T-Test

I have a two sample with the size of 15 data points. Samples are blood pressures before and after the medication. I want to hypothesis testing for my data. before = np.array([12, 11, 10, 7 , 9, 9.5, 10, 12, 15, 10, 11, 11, 12, 13, 10]) after =…
rkd
  • 59
  • 1
  • 5
0
votes
0 answers

Multiple paired t-tests in R

This seems like it should be very simple but I just can't wrap my mind around it. Other questions/examples on here have dozens of variables, and I only have two, so I've been trying to figure out how to adapt them to my data but to no avail. df <-…
0
votes
1 answer

choosing healthy control from a very large dataset

I would like to run a unpaired t-test. I have a very large dataset of 500,000 participants and only 21 participants have a disease. how can I choose my healthy control from this large dataset? any thoughts would help. I am using R for analysis
EA90
  • 23
  • 5
0
votes
1 answer

Writing a function to compare differences of a series of numeric variables

I am working on a problem set and absolutely cannot figure this one out. I think I've fried my brain to the point where it doesn't even make sense anymore. Here is a look at the data ... sex age chol tg ht wt sbp dbp vldl hdl…
fiverings84
  • 153
  • 6
0
votes
0 answers

Cannot compute a t-test function in R Markdown

I am trying to read some data from a csv data in R and then compute a t-test function but I am getting an error that there is an unexpected symbol in label. This is my code : library(tidyverse) library(magrittr) library(dplyr) labels <-…
Anouar
  • 191
  • 4
  • 14
0
votes
2 answers

T-test for groups within a Pandas dataframe for a unique id

I have the following dataframe and I am performing a t-test between all days of the weekday and all days of a weekend in a month for every ID. > +-----+------------+-----------+---------+-----------+ | id | usage_day | dow | tow |…
Adam Merckx
  • 1,122
  • 1
  • 14
  • 31
0
votes
1 answer

Combine statistical tests with rstatix and color fill per category

I use this code to do violin plots with ggplot2: Cells1 %>% ggplot(aes(x=IR_time, y=AreaShape_Area, fill=IR_time)) + geom_violin(col=NA) + guides(fill=FALSE) + stat_summary(fun.data=data_summary, col = "black") + theme_gray() + …
Pauline
  • 3
  • 1
0
votes
2 answers

T test between two numbers(0.85,0.18) getting p value as Nan

t-test between two numbers (0.85,0.18) getting p-value as Nan along with the following error: Getting this error…
0
votes
1 answer

Performing multiple two sample t-tests on two lists of data frames that have many columns

I have two lists with four data frames each. The data frames in both lists ("loc_list_future" and "loc_list_2019) have 33 columns: "Year" and then mean precipitation values for 32 different climate models. The data frames in loc_list_future look…
0
votes
2 answers

different results between VBA t_test and native excel t_test

this is my first foray into VBA. the follow subroutine computes a t-test for two columns of data on Sheet1. the problem is this subroutine returns a value different from what i get when i manually run "=T.TEST(A1:A41,B1:B96,2,3)" in, say, cell D1 on…
4mla1fn
  • 169
  • 1
  • 15
0
votes
0 answers

Applying t-test to matrix without using a loop

I am trying to apply a t-test to a matrix of TPM values for RNAseq data and I am getting an error with my code. I am new to R so I am still learning writing scripts. My file has 7 columns - the first is a list of genes, 2:4 are replicates in…
panda86
  • 13
  • 1
  • 4
0
votes
1 answer

T-test on two columns in R

I am trying to do a t-test to see if the values in two columns on two dfs are statistically different. I am trying to run a code that compares the "Duration" column in two dfs -- "Tokens" and "Tokens.Single". Both dfs have the same number of values…
Lee Drown
  • 35
  • 2
  • 6