blog/student-s-t-test-in-r-and-by-hand-how-to-compare-two-groups-under-different-scenarios/ #67
Replies: 13 comments 11 replies
-
Comment written by carmenanadb on June 03, 2020 12:36:30: Thanks! What a perfect summary! |
Beta Was this translation helpful? Give feedback.
-
Comment written by Antoine Soetewey on June 03, 2020 12:57:32: Glad you liked it! |
Beta Was this translation helpful? Give feedback.
-
Comment written by Ffigures on October 20, 2020 12:12:50: You relived my headache, thanks for clearing the concepts. |
Beta Was this translation helpful? Give feedback.
-
Comment written by Antoine Soetewey on October 20, 2020 12:25:51: Haha you're welcome! |
Beta Was this translation helpful? Give feedback.
-
Indeed, very good and organized information, thank Antoine for that summarized concise explanations. |
Beta Was this translation helpful? Give feedback.
-
You're welcome! |
Beta Was this translation helpful? Give feedback.
-
Hi Antoine, Thanks for creating such a helpful website, its awesome. However, I'm needing some additional advice running a T-test on two means. I'm completing a study focused on a sustainable finance initiative and investor behaviour. This means I have two groups of investors - signatories (who have signed up to this initiative) and non-signatories (normal investment companies). I need to complete a t-test of the mean USD invested each year by these two groups. Unfortunately, I am unsure how to write this in R as I have only ever done very basic t-tests. The group is designated in a column using 0 and 1. Any advice on how to lay this out in code would be incredibly helpful! |
Beta Was this translation helpful? Give feedback.
-
Hi Antoine,
Wow, I did not expect such a comprehensive answer with that much code.
That's very generous of you.
I will take heed of your advice, the data I sent you is a tiny fraction of
what I have - around 12,000 investors, but you are correct there will still
be outliers in that.
The main purpose of this first t test is to show that the two datasets are
very different. Then I will match the signatories to other control
investors, re-run the t test and show they are more balanced.
I appreciate your help - and let me know what your thoughts are regarding
my email about tutoring.
Kind regards,
Rory
|
Beta Was this translation helpful? Give feedback.
-
Hi Antoine,
I ran the code on my full dataset and got these results... Do you have a
minute to explain the meaning of a -14 t value to me? I was under the
impression I would see a positive number as this is what I have been
reading about online.
[image: image.png]
Best,
Rory
|
Beta Was this translation helpful? Give feedback.
-
Hi Antoine,
Thanks very much for your help, I really appreciate it.
I assume its also sensible to include the fact that the very low p value
helps with the rejection of the null?
Regards,
Rory
|
Beta Was this translation helpful? Give feedback.
-
IMO, in the first scenario, you can use By the way, great article! 👍 |
Beta Was this translation helpful? Give feedback.
-
A sincere thank you from me to you, Antoine, for this masterpiece! It helped me a lot to conceptualize t-test in general. Nevertheless, I might have a small objection: Given the homoscedasticity assumption of the t-test, Scenario 3 (Unequal and unknown variance) does not seem likely to happen at all. My best guess would be you did it for the sake of pedagogical reasons, unless I miss something. |
Beta Was this translation helpful? Give feedback.
-
Hi Antoine, Question regarding the normality assumption of samples. Under Assumptions --> Normality --> Second Bullet Point: it is mentioned that for large samples (n>=30) normality of data is not required because 'sample means' are well approximate by a normal distribution. I understand the implications of central limit theorem here, however, for small samples (n < 30), the normality condition is applicable to 'samples' not 'sample means'. Why? |
Beta Was this translation helpful? Give feedback.
-
Student's t-test in R and by hand: how to compare two groups under different scenarios - Stats and R
Learn how to apply the Student's t-test by hand and in R in order to compare two independent or paired samples with known or unknown variances
https://statsandr.com/blog/student-s-t-test-in-r-and-by-hand-how-to-compare-two-groups-under-different-scenarios/
Beta Was this translation helpful? Give feedback.
All reactions