Hello and just laugh them we're going to learn how to compute the main statistical indicators by groups
or stuff.
That's that's an important topic because many times we need to do that.
Now it is not only on the whole population but also on some groups or categories of the population in
that sector we're going to do that with that back edge to by the data.
I'm going to use the same dream all which contain the information about a group of car owners and I'm
going to compute the main statistical indicators for the variable income by gender self separately for
the male and female subject.
First of all I have to load the Dubai package
and then I have to define the function that generates the statistical indicators as I would call this
function Aswang.
The argument is called X and the square is Saura in the curly brackets.
Here we have the fountain there that this farm churn in the do by package compute the statistical indicators.
So what will this function return.
It will return the statistical indicators for the argument x.
This argument will be of course a variable out variable of Toddie and come.
I have also said this often and a lot are amped to true in order to tell the program to remove from
the analysis.
The main thing that is that create the foundation on the.
And now let's use the commands Tamary by in order to get the Thamar is that this dx and this command
Tamary by what we have to do find the dependent variable.
In our case in column and the grouping variable.
In our case gender they are separated by Tilda the data frame which is the more so data equal to the
moon and the function used to generate the statistical indicators which is our function Fonk.
So we define it using that we often find with a value fog.
OK let's round this and see what happens.
You can notice here in the console you have a summary table with the main statistical indicators for
the variable income of both female and male groups.
So here we have the number of cases that mean the median the standard deviation the coefficient of variation
the minimum and the maximum what to do if we want to get the statistical indicators for more than one
numeric variables.
For example for the variable income and age also separate separated by gender.
So for the male and female groups the procedure is the same.
Only that then there's the romance Tamary bite.
We have to define two dependent variable income and age with a plot between them.
The grouping variable is the same the date the date operate is of course the same and the function is
the same the function for
this control Panter.
Now let's look here in the console just a moment.
OK.
We have here a very big table because it contains very many columns it's very wide.
So the columns show just a moment the first column show.
OK.
The statistical indicators for the variable in column mean median standard deviation is that around.
And the next column contain the same indicators for the variable age.
So that's what we wanted the statistical Gerth for the variable income and and age for both male and
female groups.
That's all.
Thank you.