Paired t-Test in R with Examples | R Tutorial 4.7 | MarinStatsLectures

preview_player
Показать описание
Paired t-Test in R with Examples: Learn how to conduct the paired t-test (matched pairs t-test) and calculate confidence interval in R for means of two paired or dependent groups;

In this R video tutorial, we will learn how to conduct the paired t-test (matched pairs t-test or dependent t test) in R. This test is used to compare the means of two paired or dependent populations. It essentially becomes the univariate (one sample) t test, by taking the difference in observations in the 2 groups, and then conducting a test on the mean difference.

These video tutorials are useful for anyone interested in learning data science and statistics with R programming language using RStudio.

Table of Content:

0:00:09 When should we use the paired t-test and confidence interval in statistics and in research?
0:00:55 how to access the help menu in R for paired t-test
0:01:05 how to use boxplots in R to visualize and interpret the difference in means for two populations that are paired or dependent on one another
0:01:21 how to use scatterplots in R programming language to visualize the data as paired or the changes in individuals
0:01:39 how to add a line for X=Y (eg. before= after) in a paired data plot using the "abline" function in R
0:01:58 how to interpret the scatterplot of paired or dependent data
0:02:40 how to ask R to test if the mean difference is 0 in a paired t-test using the "mu" argument
0:02:47 how to conduct a two-sided t-test in R using the "alt" argument
0:02:54 how to ask R if the data is paired when conducting t-test using "paired" argument

► ► Watch More:

Follow MarinStatsLectures

Our Team:
Content Creator: Mike Marin (B.Sc., MSc.) Senior Instructor at UBC.
Producer and Creative Manager: Ladan Hamadani (B.Sc., BA., MPH)

These videos are created by #marinstatslectures to support some Statistics and R Programming courses at The University of British Columbia (UBC) (#IntroductoryStatistics and #RVideoTutorials for Health Science Research), although we make all videos available to the everyone everywhere for free.

Thanks for watching! Have fun and remember that statistics is almost as beautiful as a unicorn!

#rprogramming #statistics
Рекомендации по теме
Комментарии
Автор

Watcher 2:07 minutes soo far. Paused to commend you. Your lecturing style and tempo is very clear and easy to follow, thank you! Hvala Marine!

strossicro
Автор

Thank you this video is very helpful, and contained lots of information

sherizamohd
Автор

Very clear! Just signed up. Will be looking at your vids while taking a class

raguspag
Автор

Very good video, by the way you teach how to "add a column filed" in R with cbind(). I am new to R and I would say that Adding and computing a column/filed is an easy task in access, oracle, sql server, spss, sas, and so on... in R is not so straightforward as you can see googling "add a column in r data frame": I understand that there are a few different methods depending on the specific package used, in R base is cbind(). I computed the column Diff=After-Before and binded to the BloodPressure data frame and conducted the t test on this field, obtaining the same results as the t test in the video.

marcoventura
Автор

it is very useful thank you and why using plot sir

vasanthkrishnan
Автор

Thank you for showing us the knowledge, it is very valuable to me.

DragonWhisky
Автор

I just started watching your lecture today, and with your lecture i did many graphs and perhaps very happy to know that R is very convenient than other that i learned.  But i face i problem, with my Boxplots.  I manage to draw full boxplot for my data but not for one parameter, such as you showed in your lecture, e.g Smokers...Why?The error message was object 'xy' not found... 

sherizamohd
Автор

This was wonderfully helpful, thank you! I'm trying to figure out when it's appropriate to code for a random effect and when not to. With the data set that you presented, would it be effective to run a linear mixed model with the subject as the random effect? If not, why?

MichaelAndrew
Автор

Thank you for the video. it is really helpful

mane_gnona
Автор

Thank you this was a wonderful tutorial . I am still confused, how do we qualify the data as paired or independent ?

abhinavgupta
Автор

hey dude your videos have helped me out no end with my uni work. thank you very much.
if you answer this it'll be an even bigger help. I don't know if my stats are just wrong and that's why i'm struggling i dunno. basically :-

i want to to see if "shade type" (heavy / none) has an effect on the dry biomass of plants leaves and stems ("dry leaves" / "dry stems").
so i have all the mass measurements for the two dry tissues, and I'm trying to compare them to shade type.
do i need to perform tests separately for i) Shade Type vs Dry Leaves ii) Shade Type vs Dry Stems
OR
is there a way of incorporating them both together?

Sam

samlangdon
Автор

You are a wizard. Please come lecture at UQ. We have only muggles.

cassandrag
Автор

Hello. This video is really helpful.  I wondered if you could specify how to interpret the results. I ran my statistics while watching this, and was able to get the print out, but am not sure I am interpreting the results.  I recoded the data that I have. I am also not sure but it seems as though my students did worst in the "after" data, but this is not the case.

Lyn-egid
Автор

i wonder if we need to do p values adjustment here as we do test multiple times by comparing each pair of the data, so there is a big chance to have a false positive

yuliaegorova
Автор

Hi Mike, I became a devoted follower of your video by now and i greatly appreciate your support. I was wondering, let say i have to repeat the exact same experiment that you use here on 9 different species of animals. To test if the "before" and the "after" conditions are significantly different from 0 in each species, do I run 9 separate paired t tests? Thanks!

oacho
Автор

Hi Sir,
I wonder why my boxplot give me 25 box rather than 2 as your.
Thank you

haivu
Автор

Hi Mike, Hope you are doing great!
When I plot any figure particularly for this video, I am getting too tight plots, I mean the I am not getting vertical dimensions as large as yours, May I know what exactly am I might be doing wrong?

manojpatil
Автор

t falls in the 99 percent interval, does it mean the hypothesis of before and after have the same mu is true?

AiurMedia
Автор

How would you do a Levene Test here? There's no groups...

XxTiMaxX
Автор

Hi Again.
Is there a reason why the output doesn't show the standard deviation and standard error? What does it mean to get a negative value for the t statistic in the print out?

Lyn-egid