 So let's have a look at a QQ plot now QQ plot really helps you to decide if if you're going to use hypothesis testing and statistics Whether to use parametric or non-parametric tests. Let's have a look at that So again plot we are going to pass something new The stat argument here stat dot QQ statistics dot QQ Now let's have a look at what we have for our aesthetic X equals Rand now When I showed you how to do the save of a plot I did import the distributions Package using distributions chi square is one of the distributions that it can do and normal as well So chi square takes one argument the lambda argument here. So it says take Random values from the chi square distribution with a lambda value of one and please take 100 random data points from this distribution Randomly and attach it to the X aesthetic Y equals just normal open-close parentheses. So that's the normal distribution With the standard normal with a mean of zero standard deviation of one and plot this As a geometry a point geometry, but use the QQ statistic on these aesthetic Let me show you what happens Let's to see all distributions. Let's just add that it seems that that The kernel had stopped in between. So let's insert sell above and let's do that. Let's say using distributions There we go. So let's run this code again this and There we go. It will work now look at this. So on my x-axis I have My X values and this is a QQ plot. So it plots every point versus its quantile and But it's using using this normal for the Y value If I put in normal here These points should be on a straight line if these data point values were from a normal distribution Clearly they do not follow a straight line. So clearly these values are not from a normal distribution and indeed they weren't I cheated I put them as a chi-square distribution of the lambda of one So this plot tells me if I wanted to use these X values in hypothesis tests, I should use a non-parametric test Now let's use that on some of our own data So what are we going to do? So we're gonna plot our X is our variable one, but I've got to sort it So I can say data frame The variable one column take all those values Sort them and that's my X aesthetic for my Y aesthetic I've got to pass the normal function because I just want to see whether this is Where the variable one does follow a normal distribution, but I can't just use open and close parentheses not standard normal distribution I've got to give it a normal distribution based on the mean and standard deviation of All the values in variable one. So I've got to say mean Data frame variable one comma standard deviation Data frame variable one. So it's going to construct the mean and standard deviation from Very the values in variable one and it's going to construct from that a normal distribution Now it's going to look at Each and every value from the minimum to the maximum value It's going to apply the statistics this QQ. So it's going to look at the quanta of each and What I'm doing here. I am comparing it to a normal distribution Let's see if variable one followed a normal distribution Indeed it didn't again these plots these dots are not on the same line So once again, if I was going to use variable one, I should not use a parametric test Let's do exact the exact same thing for variable two So everything is the same and just gone on to variable two and indeed it looks like these points do fall on a straight line So I would suggest that this the sample data was taken The post tips participants were taken from a from a population in which that variable x or variable 2 in this instance was normally distributed So if I were to come do a hypothesis test, I would use a parametric test on this Let's have a quick look at variable 3 at variable 3 and again I'm doing the Q the stat qq on a normal distribution So I could check it against other distributions I could see whether this was in fact whether it followed a chi-square distribution with whatever lambda value I'm interested in so I could have put sky square there and say for instance Emparentes is just one for lambda equals one and it will change these if that then becomes a straight line that would mean that this followed a chi-square distribution and Indeed with this kind of distribution based on a qq statistic for a normal distribution based on the mean and standard deviation of The values in variable 3. This does look to me like it was constructed as a as a chi-square distribution Good in the next section. We're going to revisit scatter plots and I'll show you how much more You can do with the point geometry