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

Test of Significance for dataset

I'm having trouble in the data analysis for this dataset. So there are clients for pre-enrollment period (-5 to 0) and post-enrollment period (0-5) and I'd like to know the effect of cost between these periods. For example, does the cost increase or…
0
votes
1 answer

how to compare t-test in certain date ranges?

I have a standard group for date i.e. 4-30-7.2005 and my reference dates are 4-30.7.2003 and 4-30.7.2004 Now i have to compare the mean of my standard group with mean of reference dates. i.e. 4-30.7.2004 to 4-30.7.2004. I am using t-test to…
hasan arshad
  • 41
  • 2
  • 6
0
votes
1 answer

R function to find which of 3 variables correlates most with another value?

I am conducting a study that analyzes speakers' production and measures their average F2 values. What I need is an R function that allows me to find a relationship for these F2 values with 3 other variables, and if there is, which one is the most…
thatstea
  • 1
  • 1
0
votes
1 answer

Run a T.test on a data frame and group the results by col1 and col3

Hello everyone I am new to R and i am trying to use the statistical power of R for my analysis. Below is an example of the data frame I have Gene_Name Expression Cell Type Gene_1 1 A Gene_1 1.1 A Gene_1 1.2 A Gene_2 …
0
votes
1 answer

Conditional t-test based on column headers

I am trying to run multiple t-tests between column data read from two separate files. The two data frames look like: df1 = A C D 1 2 3 4 5 6 7 8 9 df2 = A B E 10 11 12 13 14 15 …
Jozin
  • 25
  • 3
0
votes
1 answer

Creating a matrix with t-statistics in R

I have a panel data set and want to create a matrix similar to a correlation matrix but only with the differences of the t-test estimates as well as the t-statistic. Using the toothgrowth data, I first subgroup supp ids according to their dose…
Jj Blevins
  • 355
  • 1
  • 13
0
votes
0 answers

How to calculate effect_size for statsmodels TTestIndPower solve_power function

I am trying to automate A/B-test results using GCP datalab. I am using both https://abtestguide.com/calc/ and https://www.surveymonkey.com/mp/ab-testing-significance-calculator/ as examples. I can easily calculate significance levels, Z-scores,…
vincentp
  • 31
  • 6
0
votes
0 answers

Testing whether the regression coefficient is significantly less than 1 (one-tailed t-test)

I performed a simple linear regression and using summary() I get the result of a two-tailed t-test testing whether the regression coefficient is significantly different from 0. lmb <- lm(logspec ~ logfreq) I would like to perform a one-tailed…
0
votes
2 answers

How do I program tests in R so that they print nicely?

Statistical tests in R generate lists, but then when you call the test, the printing of these lists gives a special user-friendly structure to assist the reader. To see what I'm talking about, consider an example where you use the t.test function…
Ben
  • 1,051
  • 8
  • 26
0
votes
0 answers

How to run Monte Carlo using two vectors to obtain t-statistic?

I am trying to use a Monte Carlo simulation to obtain a t statistic on two vectors. I don't know how to put a specific vector in. I tried using the MonteCarlo package and minrunif() noNBA <- c(7.2, 10.5, 6, 8, 8, 9.5, 9, 11, 11.2, 8.3) NBA <- c(8,…
Collin
  • 11
  • 2
0
votes
1 answer

How to write a loop to simulate sampling distribution of t-statistic under null using a true model?

What I currently have a problem with this problem is understanding how to fimulate 10,000 draws and fix the covariates. Y X1 X2 X3 1 4264 305.657 7.17 0 2 4496 328.476 6.20 0 3 4317 317.164 4.61 0 4 …
0
votes
0 answers

t-test vs my own t-test function with/without nan values

I did a t-test analysis using scipy library and wanted to cross check with my own made t-test function. To my suprise I found out that when my series did not include any nan values my function and scipy library gave same t-value and p-value. If the…
user3776800
  • 57
  • 1
  • 7
0
votes
1 answer

Creating function with output table from t-test in R

I would like to write a function for a neat output table from a t-test as I'm conducting numerous post-hoc t-tests however, writing functions are not my strong suit so I'd like some help. My current code looks like…
Julia M
  • 133
  • 1
  • 9
0
votes
1 answer

Bootstrap t.test: Using apply function for multiple grouping levels

I need to bootstrap my "automated' lapply t.test function to calculate Bootstrap statistics (original, bias, and standard error). Here's the basic t.test code I've gotten so far (no bootstrapping): # create data val<-runif(60, min = 0, max =…
TheSciGuy
  • 1,154
  • 11
  • 22
0
votes
1 answer

Running R t.test in nested loops

I'm new to R Studio. For class, I have pulled the US Census 2016 election dataset and want to run a series of T-Tests over the data set. Some specifics on the dataset. First, the data is coded - 1 through 4 - representing a state of Citizenship. …