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

not enough 'x' or 'y' observations in ggplot2 for t-tests or Wilcoxon test

I'm able to run a t-test or a Wilcoxon test on the data with no warnings, but I get an error when I try to plot in with ggpubr 's function stat_pvalue_manual() in ggplot2 The t-test works fine: ### running a t-test (no problem): t.test(SUJ_PRE ~…
Larissa Cury
  • 806
  • 2
  • 11
0
votes
1 answer

t-test between two groups based on a condition

I have the following fake-dataset, very similar to the real one: Country <- c("Italy", "Italy", "Germany", "Germany", "Spain", "Spain", "France", "France") Specialisation <- c("Cooperative", "Savings", "Cooperative", "Savings", "Cooperative",…
0
votes
0 answers

Can't run student t_test using combinations

I've been trying to implement a t_student test in a DataFrame but I always end up with an error like raise KeyError(key) KeyError: 'patid' This is my DataFrame: df = pd.DataFrame.from_records(data=[ dict(id=1, rd=True, drk=True, hn=True,…
0
votes
0 answers

Why do I keep getting an error: TypeError: 'method' object is not subscriptable

stats.ttest_ind(med_df.dropna['age'], med_df.dropna['sex'], equal_var= True) Trying to do a ttest on age and sex shown above but keep getting this error: TypeError: 'method' object is not subscriptable. What am I doing wrong? I tried it like…
0
votes
0 answers

Paired Samples t-test or Two-sample (heteroschedastic)?

My dataset consists of many patients who went through a treatment and I want to understand if there is a difference between before and after taking it. By far it appears clearly as a Paired Samples t-test, the problem is that I have different…
Angela
  • 1
0
votes
0 answers

T-test oppostite test

I was trying t-test in r to compare mean difference between yes-no but the t-test shows the result for no-yes. A contains continous variables while B cotains factor variable Yes and No. I used the following code t.test(A~b, data=df, var.equal=TRUE,…
najuspy
  • 91
  • 1
  • 8
0
votes
0 answers

Statistical testing of classifier performance on different populations subsets

I have a dataset of people's medical records which contains people of different races, income levels, genders, etc. I have a binary classification problem, and want to compare the accuracy of the two models: Model 1: I have trained and tested a…
0
votes
0 answers

Test the difference in PROVISION

I have a dataset which includes data of countries BELGIUM and Netherlands. I need to perform the t test, however I receive the following error SyntaxError: invalid syntax. Hope that somebody can help me with this. from scipy.stats import…
Hendrik
  • 11
  • 1
0
votes
0 answers

How to run ATPVBAEN.Xlam for t-test equal variance assuming?

I found a code for t-test for comparing 2 variances as below: Application.Run "ATPVBAEN.XLAM!Pttestv", Range("B50:B289"), Range("C50:C228"), Range("O3"), False, 0.05 But it uses for un-equal variance, how about equal variance?
Dat09
  • 1
  • 2
0
votes
0 answers

Paired t test with multiple time points

I have a dataset with 6-time points and I hope to do multiple paired sample t-tests to compare the scores. The data has been transformed into the long one I want to achieve something like this table: I tried to use the following code, but it does…
Zhen
  • 1
  • 4
0
votes
1 answer

Two sample t-test in a dataframe using R

I made a data as follows: data<-data.frame(weight=c(78,89,90,45,57,89,67,56,78,50), height=c(170,158,162,190,193,190,167,169,170,175), bmi=c(23,24,35,19,25,29,30,34,32,31), …
Bae
  • 97
  • 1
  • 6
0
votes
0 answers

I am trying to test if non-random samples from a population are 'valid' (statistically significant)

My problem is best explained by example. Imagine you have a data set that has the details of 100,000 vehicles giving the vehicle type (car, motorcycle, truck) and their colour (red, green, blue) as well as top speed, weight, etc. Let's say 40,000…
0
votes
1 answer

How to exract specific values from the lists created by a statistical model (t-test)?

How can extract statistics from this model. To conduct several T-tests I used this: A<-lapply(merged_DF_final[2:6], function(x) t.test(x ~ merged_DF_final$Group)) How can I extract information about the p-value, t statistics, confidence interval,…
lotus
  • 87
  • 5
0
votes
0 answers

Error in FUN(X[[i]], ...) : object 'estimate' not found

I am tryin to add p-values of 3 factors T-test on ggplot. But it keeps warning me this kind of error calls 'Error in FUN(X[[i]], ...) : object 'estimate' not found'. My coding is following: Fisrt, I did a t-test mixt.test_others<-studymix_fit %>% …
YUE ZHAO
  • 1
  • 2
0
votes
0 answers

Multiple T-Tests in one go in R

I have a data frame like this: diagnosis A B C D 1 yes 1 1 0 1 2 no 0 1 0 1 3 yes 0 1 0 1 4 yes 1 1 1 1 5 yes NA 1 NA 0 6 no 1 NA 0 1 7 yes 1 0 0 0 8 no 0 0…
dplyr
  • 83
  • 5