The measures of central tendency are the most
commonly used in statistical analysis.
We know them as mean, median,
and mode and their use is
ubiquitous and statistical analysis.
So let us see how it works.
Before we begin, let us take
a quick look at our dataset in this course.
We have been using the teaching evaluation Data
from the University of Texas.
The dataset comprises of 463 courses,
in which we have information about
the teaching evaluation score received by the instructor.
We have information about
the attributes of the instructor,
as well as the characteristics of the course.
Once you have imported
a CSV file with a Pandas Python library,
the first step in getting to know your data is to
discover the different data types it contains.
You can display all columns and
their data types with dataframe dot info.
In this case, we have named our dataframe, ratings_df.
It tells you how many rows you have.
For the teaching rating data,
we have 463 entries from zero to
462 because Python starts counting from zero.
Then it also gives you information about the data types.
Object represents strings.
In 64 represents integer or whole numbers,
and float represents real numbers,
which could take on decimal points.
Before we begin, let us have
a conversation about population and samples.
Essentially, if you have
all the information of interest
for a particular decision,
about every individual that is
supposed to be involved in that decision,
that is called a population.
So if you are interested in looking
at some attribute of driving,
and we have information about
all possible automobile drivers in the US,
then we call this, the population.
The sample, on the other hand,
is a subset of population.
So for example, if we have
data on all married drivers over the age of twenty five,
then that's a subset.
Within that subset, if we were to randomly
select five percent of
those married drivers over the age of 25,
that would be our sample.
We use samples, especially
in cases where we do not want to
incur the cost of collecting
data for the entire population.
Now, let us consider that there are
230 million individuals in the country.
A sample size of
330 to 500 individuals randomly selected would suffice.
This reduces the cost,
especially in cases where you cannot
collect information for the entire population.
Therefore, using samples,
it's really helpful and cost-effective.
Here you see some Greek symbols on the screen.
But don't be afraid.
They mostly show the Formula.
We will then proceed from here.
While they may differ in notation,
essentially the mean for
a population and sample are the same.
It is the sum of all the observations, then,
divide it by the number of observations to get the mean,
which we call averages.
There are several properties
of the mean and they are meaningful.
But one of the characteristics of
a mean is that if you take
the difference between the average value for a variable,
and subtract from all the observations and sum them up.
That sum would be equal to zero.
The median is different from the mean.
When you order the data from
the smallest value to the largest value,
the result is in the middle.
That is, the value in the middle
indicating that there are
an equal number of observations,
that are above and the equal number of
observations are below that family.
That value is called the median.
So if the median salary in some city is $45 thousand,
it means that 50 percent of the people make
more than $45 thousand and
the other 50 percent make less than $45 thousand.
Mode is essentially the value
that occurs most frequently.
Therefore, if the most common age and
a class of students is 16, then that's the mode.
We will now turn to Python for our hands-on training to
estimate the Summary Statistics values for beauty score.
Teaching you about evaluation and H.
We will use the DataFrame
dot describe function to find the Summary Statistics.
This prints out the number of
rows, mean, standard deviation,
minimum value, 25th, 50th,
75th percentile, and the maximum value.
To find the summary statistics
for a subset of the variables,
you will have to state the column names
as we can see here.
Otherwise, for the full population,
we will call the dot describe function on the DataFrame.