0

I'm trying to get the same result from this excel table, indicating that there's a link between the wight and the result (after going to the gym)

enter image description here

The result on the excel shows the p-value as 1.28% (for 2 tails) and 0.64% for 1 tail.

Given

weight = np.array([70,71,76,84,72,78,79,80,74,75])
result = np.array([67,70,77,80,70,79,70,77,70,70])

and then I do:

stats.ttest_ind(B,A)

and I get

Ttest_indResult(statistic=4.413795011355454, pvalue=0.00015789925499823287)

What am I doing wrong?

ProcolHarum
  • 721
  • 3
  • 17
  • If I run `ttest_rel(weight, result)` on your sample (which is a paired t-test, the same as what you appear to be implementing in Excel), I get the same t-statistic and p-value as in your Excel output. – AlexK May 17 '22 at 02:50
  • Also, you may know this, but t-tests examine whether there are significant differences between two group means for one variable. Based on your wording, you may need to calculate correlation between two variables instead. – AlexK May 17 '22 at 02:54
  • A paired t test is needed here, instead of the independent sample t-test that you have coded for. To understand the difference in the simplistic terms, a paired t-test is used in cases where the two samples belong to the same set of individuals or items, independent t-test means that the two samples are independent of each other (can't be the same individuals before and after any study) – srishtigarg Jul 16 '22 at 22:14

0 Answers0