Hello and this lecture we are going to learn how to build but to start with the plot too.
I'm going to use the date of Crane called D-Mo. which contains information about a group of car owners
and I'm going to create a back plot for the Grabow income for each gender category male and female.
First of all let's load the plot to package and then create the plot the box plot.
You then find things you bought plot.
We have to define our data frame which is the mom.
And here they a foundation for the X X is we better find the verb or gender the grouping terrible and
the y axis with patent fight the variables Toddie the variable income and with the farm care as I just
read.
I had the balls for the x axis female and male that to allow of the two categories of gender that create
that control and try.
So here our back plot back to back plot for the female and male groups here.
Now have the grouping variable is not a factor.
Make sure you convert it into factor first first then the factor function.
Now let's see how to set the color of the outliers.
Just in case you want them of different color is very simple.
Just a moment here in the genome box flops to function.
So you have to use the option outlier color with the value of say red.
In this case to make the red wines that are around it and presto.
Now our point here read
and if you want to set the shape of the outliers you have to use
beside the outside color fonts and you must do all the auction out fire shape here I make it to four.
So I get to the point in x for x shape.
Excuse me.
Just a moment.
I not with the dogs are now in X shape.
Now let's add a legend to our Bhatkal charge for that.
I'm going to define a new variable called out called algae which is towards the value of the venerable
gender male and female.
OK and here in the pages of plot function more that play in the GM VOXPOP function and they are that
is fun here I will do the Often we are equal to our Judy wife here in the forefront in order to make
the program to create legend for us.
So this legend will be
will be two categories of the various to this that will portray that the two categories of the variable
gender story that are around this.
OK I didn't notice.
Now the plot are collared differently.
The box.
This story though the female block is the rat and the mail box is the blue.
And we have the legend here.
Finally let's build a plaster box plot.
We will groove the box clock by gender and marital status marriage and on marriage and the legend will
represent the true marital status is because all the gender categories are already represented and labeled
here on the gender axis so all new variable gender with the values of variable marital marital status
that's created.
And now here the end that it's found in the center remains the same.
So we are equal to G-d.
But now that see what happens the moment that.
So here you can notice the legend does not present the category of gender but the categories of marital
status marriage with the rat and on marriage with blue and blue.
So here we have two box plots for the female category married and married and two back plot for the
male category married and on marriage OK.
That's all.
Thank you.