 Good, so we've described our statistics. Let's do it visually using the get fly package now whole bunch of lessons just on the get fly package Gonna show you the basics right here plot plot is a function and it takes Various arguments and you build up what you want in your plot very easily the first thing Get fly as data frames away So you can just tell it what data frame you are going to deal with so first argument DF data frame Second argument, what do I want on the x-axis and what do I want the y-axis to be? So on the x-axis, I want the infictions now. I've got to do this in quotation marks I'm not going to use the I'm not going to use the the colon in front and just the word So I could say DF Square brackets and then the colon but I can because I've passed this data frame argument there I can just use in quotation marks in fiction column So remember the infictions we have Minor and major so those are the two things. It's going to put on the x-axis. So those are not numbers. Those are categorical values Those are categorical values Now why It's going to be the age so it's going to go down the age column for why But now I've got to tell it what I want to do with it because there we have categorical data On the x-axis on the y-axis. I've got numerical data so One of the things that you can plot in that way, of course is a box plot this box and whiskers and I say Geom which is stands for geometry with a capital G there dot box plot That's how you refer to the type of plot you want to do and then three of the arguments I'll use quite often as guide dot title Guide dot x label guide dot y label and you can just imagine what they are guide dot title It's going to put a nice bold title on the top of your graph you pass an argument to it in But in quotation marks and I'm going to call it age analysis by type of infection So you can immediately see what's going to happen with this box plot on the x-axis We're going to have a box plot for minor infections and for major infections and for each of those We're going to do a block box plot of the age So get flies going to extract from that one column age The values that belong to mine infection the values that belong to major infection and it's going to plot them as a box But that's wonderful, and I'm going to label my x-axis guide dot x label the type of infection Which is mine minor major and on the y-axis. I want to use this label function. I'm going to execute this Now it's got a compile on the service side on the Amazon web services. It's going to take a little bit Before we start to see where before we start seeing our first plot So let's hang in there a bit and there we have our very first very beautiful plot I have my title guide dot titles age analysis by type. I have my x-axis label type of infection I have my y-axis label And two beautiful We're not we can change a various things about this I'm not going to do it now, but we have our two beautiful box plots there We even see our outliers on that side and we see if we hover we can also zoom in and zoom out and On the x-axis. It's found minor infections and it's found major infections. Let's repeat I mean that is beautiful. I love the colors the default colors that were chosen. This has changed the color We can do the exact same thing. Just what's the size sake we call the plot function and the following arguments the data frame The x-axis instead of infections I wanted to go down the gender column and find whatever it can on why the age and it's also going to be a box plot geometry So geom dog box plot. I'm going to have a title. So it's guide dot title an X label and a Y label This time I'm going to add something new though a new argument theme And I passed with the arguments the following Default underscore color equals now you've got to use Be careful. There's it's colorant and then just a quotation mark orange So nothing in between there no equal sign there nothing just get used to how to write a color There's a few keywords for color that you can use straight off the bat So if I execute that second time around things are going to be a bit faster. Let's have a look And there we are in orange beautiful So it found female and male it attached the age values to it beautifully and it drew our two box plots for us Now that is really really professional. It looks fantastic looks phenomenal. I Want to show you a different type of so we can start seeing things here already see we see that the age We see a major infection patients were slightly older than the minor infection patients We can certainly see that we can see that We had a bit more spread in the data as far as the agent Alice of the major infections concerned another type of graph That will show that to us even better is this density plot So it takes the following arguments again. It's plot get fly the data frame, but on the x-axis. I want age now ages just a string of The numerical values and go from youngest to oldest So what am I going to have on the y-axis? Well, I'm not going to call it why I'm going to call it color Not why color and For that I want to look down the infection column. I remember it's going to find two types of infection Two types of infection minor and major and I'm going to pass that to the color And then I'm going to call jump that density because a density estimate on the y-axis Gives us a density estimate Of our data, so it's it's going to find minor infections and look at all its ages and major Infections and look at all its ages again. I'm going to just do guide that title guide that x label and guide that y label Let me show you the plot First time we're going to do a density plot, so it's going to think about it a bit It's going to compile that it's going to look through the data And it's going to render the plot for us. There we go That's what it does. So you see I call the y-axis distributions because it is a density estimate you see the values there You see the values there and now we can see the age distribution See from 0 age to 50 So this is a kernel density estimate of the minor infections and major infections So I cannot pass a y argument here. It is part of the density geometry. I Want it to find the two sets of ages the minor infection age and the major infection age and I pass that to the color argument Now we can start to see well, there's perhaps not a difference between I'm going to put money down that there's no Statistically significant difference in ages between major and minor infections and it might be a bit difficult to see Not really, but it might be slightly difficult to suggest that just from the box plots But these density plots really give you a lot of information. Let's do the same thing for gender So again age, but this time I want to do the density kernel density estimates for gender Let's do that and you can see as far as the gender is concerned really the age analysis is almost Identical so again if I compare males to females as far as the age distribution is concerned I'm not going to find what with a parametric or non-parametric case. I'm probably not going to find I'm not going to find I can say a statistically significant difference Let's do some more box plots just to have a look at our data So I'm going to go on x-axis infections and the HPA 1c Comparing major and minor infections All the other things the same I've given descriptive words to the title the x-axis and the y-axis labels and we see there is a big difference Now remember this is just fake data Probably won't see anything like this But the minor infections seem to have had higher HPA 1c than the major infections I'm going to go through this rather quickly now. You know how to write the code for these plots Let's rather concentrate on the data If I look at HPA 1c major and minor infections as you see we saw that big difference in the box plots But look at the kernel density estimates we can beautifully see the study minder. I don't pass a Y argument I pass the color argument And on the x-axis I want the HPA 1c percentage of values I don't pass Y because that the density will be calculated for me Let's look at box plots just by gender We look at box plots by gender. We see there isn't really any difference, but look at those plots. They are lovely and Let's just pass Box plot for CRP versus Infection and we see the major infections quite a bit higher and they see reactive protein And lastly if we just look at CRP analysis by gender, we see they are rather equal to each other So box plots and kernel density estimate plots It helps you so much to get to grips with your data Look at the code that has been written to generate these get fly really makes it easy for you to Plot your data in the next section. We are going to start doing some inferential statistics, which is what it's all about