Docsity

Inferential statistics, Appunti di Statistica

Toggle sidebar
bg1
29
PART II INFERENTIAL STATISTICS
In the second part of course, we study inferential statistics, as a collection of techniques that make it possible to draw
conclusions that concern the entire population from a sample drawn from it. We start with physical definition of a
population as the set of all units object of our investigation, the set of all statistical units on which we can measure a
characteristic or concept of interest. A sample is a collection of units selected from the population. The distinction
between population and sample entails the distinction between parameter and statistic. A parameter is a numerical
summary of a characteristic at the level of the population. A statistic is a numerical summary of a characteristic at the
level of the sample. To clarify the two concepts, the table below reports some examples of parameters and statistics.
Parameter
Statistics
Average number of participatory politics acts done (at least once) in
the last twelve months by young aged between 15 and 25 living in the
USA
Average number of participatory politics acts done (at least once) in
the last twelve months by respondents to a survey, drawn from the
population of young aged between 15 and 25 and living in the USA
Percentage of all young a ged between 15 and 25
living in the USA,
who commented on a news story or blog read online about a politica l
campaign, candidate or issue
Percentage out of 1000 respondents between 15 and 25, living in the
USA, who commented on a news story or blog read online about a
political campaign, candidate or issue
Average income of households living in a given country
Average income of 2000 households living in a given country
Percentage of firms green friendly out of all firms operating in a given
region
Percentage of firms green friendly out of 200 operating in a given
region
We will learn how to make inferences on population parameters based on sample statistics. We can understand how
the inferential process leading to conclusion concerning an entire population from a partial inspection of it is affected
by errors that we need to control for. As a first requirement, the sample should be representative of the population.
The unique way for drawing a representative sample is through random sampling. In random sampling, the units
are drawn at random from the population one at time in such a way that all units have the same probability to be
drawn and all samples of given size n have the same probability to be drawn. Random sampling is then a sampling
scheme that prevents from biases, as over-representation or under-representation of given groups of the population,
ensuring in this way the extraction of representative samples. It is also the building block of more complex sampling
schemes as stratified sampling or cluster sampling, that are usually implemented for administering surveys.
At the same time, the randomness of the data generating process makes it possible to describe all statistical techniques
within a probabilistic framework that allows quantifying and controlling for the probability of making errors. In the
following sections, we discuss such probabilistic framework, introduce the main inferential problems, and focus on
the techniques that let make inferences on one parameter and on the association between two variables. We begin
with a recap on random variables and probability distributions.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Anteprima parziale del testo

Scarica Inferential statistics e più Appunti in PDF di Statistica solo su Docsity!

PART II INFERENTIAL STATISTICS

In the second part of course, we study inferential statistics, as a collection of techniques that make it possible to draw conclusions that concern the entire population from a sample drawn from it. We start with physical definition of a population as the set of all units object of our investigation, the set of all statistical units on which we can measure a characteristic or concept of interest. A sample is a collection of units selected from the population. The distinction between population and sample entails the distinction between parameter and statistic. A parameter is a numerical summary of a characteristic at the level of the population. A statistic is a numerical summary of a characteristic at the level of the sample. To clarify the two concepts, the table below reports some examples of parameters and statistics.

Parameter Statistics

Average number of participatory politics acts done (at least once) in the last twelve months by young aged between 15 and 25 living in the USA

Average number of participatory politics acts done (at least once) in the last twelve months by respondents to a survey, drawn from the population of young aged between 15 and 25 and living in the USA

Percentage of all young aged between 15 and 25 living in the USA, who commented on a news story or blog read online about a political campaign, candidate or issue

Percentage out of 1000 respondents between 15 and 25, living in the USA, who commented on a news story or blog read online about a political campaign, candidate or issue

Average income of households living in a given country Average income of 2000 households living in a given country

Percentage of firms green friendly out of all firms operating in a given region

Percentage of firms green friendly out of 200 operating in a given region

We will learn how to make inferences on population parameters based on sample statistics. We can understand how the inferential process leading to conclusion concerning an entire population from a partial inspection of it is affected by errors that we need to control for. As a first requirement, the sample should be representative of the population. The unique way for drawing a representative sample is through random sampling. In random sampling, the units are drawn at random from the population one at time in such a way that all units have the same probability to be drawn and all samples of given size n have the same probability to be drawn. Random sampling is then a sampling scheme that prevents from biases, as over-representation or under-representation of given groups of the population, ensuring in this way the extraction of representative samples. It is also the building block of more complex sampling schemes as stratified sampling or cluster sampling, that are usually implemented for administering surveys.

At the same time, the randomness of the data generating process makes it possible to describe all statistical techniques within a probabilistic framework that allows quantifying and controlling for the probability of making errors. In the following sections, we discuss such probabilistic framework, introduce the main inferential problems, and focus on the techniques that let make inferences on one parameter and on the association between two variables. We begin with a recap on random variables and probability distributions.

Section 1 Recap on random variables

Probability recalls an experiment. We deal with a specific kind of experiment, consisting in drawing at random units from a population and measuring a characteristic or a concept on them.

Let begin by considering a single draw from the population. A unit is drawn from the population and the concept or characteristic is measured on it. The outcome of such experiment can be modeled by means of a probabilistic tool named random variable: variable because before drawing the unit we only know that different values can be observed, random because before drawing the unit from the population we do not know the value that we are going to observe. A random variable is then a numerical measurement of an outcome of an experiment. It is a mathematical model of an experiment.

Random variables are, for example, the income and the household composition of a person drawn at random from the population of residents in a given region; the revenue and the number of employees of a firm drawn at random from the population of firms working in a given sector; the number of credits of a student drawn at random from the population of students attending university in a given town; the level of engagement in participatory politics of a respondent drawn at random from the population of young aged between 15 and 25 and living in the United States in 2011 and measured as the number of participatory politics acts done at least once in the last 12 months.

Random variables can be discrete or continuous. A random variable is discrete if it takes a finite or an infinite but countable number of values. A random variable is continuous if it can take any value within an interval. Discrete random variables are the number of books read by a randomly drawn adult living in a given area at a given time; the number of participatory politics acts done (at least once) by a randomly drawn young living in USA; the number of defective items detected in a sample of 20 items randomly drawn from a large shipment. Continuous random variables are the weight and the height of a randomly drawn child, the income of a randomly drawn household living in a given region; the temperature at a given hour in a randomly drawn day.

A discrete random variable takes a set of separate values; its probabilistic behavior is described by means of a probability function. A probability function assigns to each of the possible values taken by the random variable the probability of observing it. It takes value between 0 and 1 and the sum of probabilities for all possible values equals

Let consider the experiment consisting in tossing a coin twice and let define the random variable X being the number of heads observed. The sample space is S = (TT,TH,HT,HH) and the values taken by X are 0, 1, 2. X takes value 0

when two tails are observed, that is when the experiment has outcome TT. We have: Pr(X = 0) = Pr(TT) = 1 2

1 2 =^

1

Therefore, the probability distribution of X can then be specified as follows.

xi pi = Pr(X=xi) 0 1/4 = 0. 1 1/2 = 0. 2 1/4 = 0.

The probabilistic behaviour of a continuous random variable is described through a density function. A density function takes only values that are not negative and the area of the region that is delimited by the graph of the function and the x-axis is equal to 1. The domain of the density corresponds to the set of values taken by the random variable, its support set.

Think at the experiment consisting in drawing at random one respondent from the population of young aged between 15 and 25 and living in the USA in 2011, and asking him/her whether he/she has commented on a news story or blog read online about a political campaign, candidate or issue, in the last 12 months. Before running the experiment, we do not know the answer of the selected respondent, we only know that the respondent can answer yes or no. We can model the outcome of the experiment by a Bernoulli random variable taking value 1 for a yes answer and 0 for a no answer. In this case π is the probability of a yes answer.

A random variable X has a normal or Gaussian distribution with parameters μ and σ 2 (the notation is X ~ 𝑁𝑁(μ, σ^2 )) if its density has the following expression

𝑓𝑓(𝑥𝑥) =

1 √ 2 𝜋𝜋σ 2

𝑒𝑒 −

(𝑥𝑥−μ)^2 2σ 2

For x ranging in the real number set. The density function is entirely specified by two parameters μ and σ 2 , that are respectively the mean and the variance of the distribution. The density is symmetric about the mean μ and it is bell- shaped. Due to the symmetry, mean and median coincide. The probability of observing a value below the mean is equal to the probability of observing a value above it and it is equal to 0.5. Below the graph of a normal density with parameters μ = 2 and σ 2 =1.

By letting vary μ and σ 2 an entire infinite set of densities can be derived, as we can see from the figure below.

Figure 2 Plot of normal densities

For given mean, increasing the variance produces a flatter and wider bell-shaped curve, decreasing the variance produces a taller and narrower curve.

Pr(X ≤ 2 ) = Pr(X <2)=0.5^ Pr(X^ ≥^2 )^ =^ Pr(X^ >2)=0.

The probability within any particular number of standard deviations of μ is the same for all normal distributions. For X ~ 𝑁𝑁(μ, σ^2 ) there is a probability equal to 0.68 of falling within 1 standard deviation of the mean, Pr(μ − σ ≤ X ≤ μ + σ) = 0.68, equal to 0.95 of falling within 2 standard deviations of the mean, Pr(μ − 2 σ ≤ X ≤ μ + 2 σ) = 0.95, and equal to 0.997 of falling within 3 standard deviations of the mean, Pr(μ − 3 σ ≤ X ≤ μ + 3σ).

Figure 3 Probabilities within #std from the mean

A normal distribution having μ = 0 and σ^2 =1 is called standard normal distribution. A random variable having a standard normal distribution is denoted by a Z and is referred to a standard normal, the following notation Z ~ 𝑁𝑁(0,1) is used to say that Z has a standard normal distribution. A standard normal random variable has probability 0.68 of falling in the interval [-1 1], 0.95 of falling in the interval [-2 2] and probability 0.997 of falling in the interval [-3 3].

Figure 4 Probabilities within #std from the mean, standard normal distribution

It can be shown that for any random variable X having normal distribution with parameters μ and σ^2 the standardized variable

Z =

X − μ σ

has standard normal distribution.

value that the sample mean is going to take. The value of the sample mean observed on a given sample realization is denoted by 𝑥𝑥̅.

Back again to our YPPS data, participatory_index is the sample realization and on this sample realization, participatory_index has mean 1.686. It is the value of the sample mean observed on the considered sample. If we draw another sample, we might observe a different value of the sample mean.

The arithmetic average of n i.i.d random variables enjoys the following properties

  1. it has mean (expected value) equal to the population mean μ
  2. it has standard deviation equal to the population standard deviation divided by the square root of the sample size, 𝜎𝜎 √𝑛𝑛
  3. for a large sample size n , it has distribution that can be approximated by the normal (or Gaussian) distribution (Central Limit Theorem)

Property 1 tells us that the value of the sample mean observed on one unit is one of the several values that we can observe and such values are spread around the population mean.

Based on Property 2, the observed value of the sample mean is one of the several values of the sample mean that we can observe and all such values are centered at the unknown population mean, with a spread that increases with the population variability and decreases as the sample size increases.

Based on Property 3 for a large sample size, we can use the normal distribution to approximate the distribution of the sample mean.

Inferences on the population variance σ^2 are based on the sample variance, denoted by S 2

S^2 =

(X 1 − X�)^2 + (X 2 − X�)^2 + ⋯ + (Xn − X�)^2 𝑛𝑛 − 1

The sample standard deviation is the square root of the sample variance and is denoted by S. The observed values of the sample variance and sample standard deviation depend on the sample realization and are denoted by s^2 and s respectively. It can be shown that the sample variance S^2 has expected value equal to the population variance.

From the Central Limit Theorem, the distribution of the sample mean X�^ for a large sample size can be approximated

by a normal distribution with mean μ and standard deviation σ/√𝑛𝑛. Therefore, the standardization of the sample mean

X�^ − μ σ/√𝑛𝑛

has a distribution that for a large n can be approximated by the standard normal distribution.

It can be shown as well that for a large sample size, if we replace σ/√𝑛𝑛 by S/√𝑛𝑛, the random variable

X�^ − μ S/√𝑛𝑛

has distribution that again can be approximated by the standard normal distribution.

Let go back to the experiment consisting in drawing at random n respondents from the population of young aged between 15 and 25 and living in the USA in 2011, and asking them whether they have commented on a news story or blog read online about a political campaign, candidate or issue, in the last 12 months. The experiment can be

probabilistically modelled by n random variables (X 1 , … , Xn) taking value 1 if the respondent answers yes and 0 otherwise. (X 1 , … , Xn) are independent and have the same distribution being a Bernoulli distribution with success probability π. In this case, the success probability π is the probability of a yes answer and it is represents the percentage or proportion at the level of population of times the outcome of interest is observed. It is the population percentage or proportion of young (aged between 15 and 25 and living in the USA in 2011) that have commented on a news story or blog read online about a political campaign, candidate or issue, in the last 12 months.

We know that the success probability of a Bernoulli distribution π is as well the mean (expected value) of the distribution. Therefore making inference on π is making inference on a mean. Any inference on π is based again on the sample X�^ mean that as an arithmetic average of variables taking values 0 and 1, is the sample proportion, the proportion at the level of the sample of units on which the outcome of interest is observed. In our case, the sample mean is the proportion out of the sample of respondents who answer they have commented on a news story or blog read online about a political campaign, candidate or issue, in the last 12 months. The following properties can be again stated with reference to the sample proportion.

The sample proportion

  1. has mean equal to the population mean π, that is the population proportion
  2. has variance equal to the population variance divided by n , π(1−π) 𝑛𝑛
  3. has distribution that can be approximated for large n by a normal distribution with mean π and variance π(1−π) 𝑛𝑛.

Section 3 Inferential problems, point estimation and estimators property

As anticipated, we make inferences on unknown parameters based on the information provided by the sample and summarized by sample statistics. Inferential problems are of two kinds: estimation problems and hypothesis testing problems. The estimation problem is a point estimation problem when we look for an approximation or a guess for the parameter value, and a confidence interval estimation problem when we look for an interval of values that we would like to contain the true value of the parameter with high probability. The hypothesis testing problem is a decision problem, as we are going to see we have to decide whether to accept or to reject a statement on an unknown parameter.

Let begin with the point estimation problem of the population mean μ. Any sample statistic used for estimating an unknown parameter is called estimator. The value observed at the level of the sample is called estimate. We estimate the population mean using the sample mean. The question is then, is the sample mean a good estimator?

Let go back to the properties of the sample mean. Property 1 claims that the sample mean has expected value equal to the population mean. The value of the sample mean we observe is one of the several values we might observed, all these values being scattered around the unknown population mean. When using the sample mean as an estimator of the population mean, we know that we might be wrong, but we do not have a systematic over-approximation or under-approximation error. We say that the sample mean is an unbiased estimator of the population mean.

The second property claims that the sample mean X�^ has standard deviation equal to 𝜎𝜎 √𝑛𝑛. As^ n^ increases, the standard deviation of the sample mean decreases. Considering Properties 1 and 2 together, we can claim that the value of sample mean we observe is one of the several values we might observed, all this values being scattered around the unknown population mean, with a dispersion that decreases as the sample size increases. We say that the sample mean is a consistent estimator of the population mean.

The standard deviation of the sample mean depends on the population standard deviation σ. The population standard deviation can be estimated by means of the sample variance S, that is an unbiased estimator since its mean

The quantile of order ( 1 − 𝛼𝛼 ) of a standard normal distribution is the value denoted by 𝑧𝑧𝛼𝛼 such that

Pr(Z ≤ 𝑧𝑧𝛼𝛼) = 1 − 𝛼𝛼 and Pr(Z > 𝑧𝑧𝛼𝛼) = 𝛼𝛼

We have, for a large n,

Pr�−𝑧𝑧𝛼𝛼/ 2 < X�−μ S/√𝑛𝑛 <^ 𝑧𝑧𝛼𝛼/^2 �=1-α

Therefore through arithmetic transformations

Pr�X�^ − 𝑧𝑧 𝛼𝛼 2

S √𝑛𝑛 <^ μ^ < X

� + 𝑧𝑧𝛼𝛼/ 2 S

√𝑛𝑛 �=1-α

The interval �X�^ − 𝑧𝑧𝛼𝛼 2

S √𝑛𝑛^

, X�^ + 𝑧𝑧𝛼𝛼

2

S √𝑛𝑛^ � contains with probability (1-α) the unknown population mean, μ.

The confidence interval of level (1-α)100% for the unknown population mean μ has the following expression

�x� − 𝑧𝑧𝛼𝛼 2

s √n

, x� + 𝑧𝑧𝛼𝛼/ 2

s √𝑛𝑛

The (1-α)100% for the unknown population mean can be given the following frequentist interpretation. Assume to draw repeatedly samples of a given size n from the population and to compute for each of them the confidence interval of level (1-α)100% for a given parameter. Then we expect that (1- α)100% of the derived intervals will contain the unknown parameter. For this reason when giving an interpretation to a (1- α)100% confidence interval, we claim that we are (1-α)100% confident that the unknown parameter belongs to it.

The (1-α)100 % confidence interval for the unknown population mean μ is obtained by adding and subtracting from

the estimate x� a same quantity that is 𝑧𝑧 𝛼𝛼 2

S √𝑛𝑛 , called margin of error. The margin of error is the product of the quantile

of order α of standard normal and the standard error of the sample mean. The length of the interval is given by 2𝑧𝑧𝛼𝛼 2

S √𝑛𝑛

twice the margin of error. The accuracy of the estimation through confidence intervals is measured by the length of the interval. The longer the interval the lower the accuracy of the estimation. Considering the table reported below, The higher the confidence level, the higher is the z value, the higher is then the margin of error for given standard error. There is then a trade-off between the length of the confidence interval and confidence level.

Confidence level (^) α 𝒛𝒛𝜶𝜶 𝟐𝟐 90% 0.1 1.

95% 0.05 1.

99% 0.001 2.

Let go back to the YPP survey and database. The 95% confidence interval for the population mean of participatory_index is (1.102274, 1.235006). We are 95% confident that the population mean of participatory_index is between 1.102274 and 1.235006 and we are confident that in only 5% of cases the population mean falls outside the interval.

Section 4.2 Confidence interval on the population proportion

Let consider now a sample (X 1 , … , Xn) of i.i.d random variables having each Bernoulli distribution of parameter π. As seen in Section 2, we resort to a sample of this kind when we are interested into the occurrence of a given outcome. π is the proportion at the level of population of times the outcome of interest is observed, the population proportion. Any inference on the unknown population proportion is based on the sample proportion, the proportion of times the outcome of interest is observed in the sample. Since the sample proportion is the sample mean it has mean equal to

the population mean π, variance equal π(1−π) 𝑛𝑛 and has standard error, equal to^

Moreover for the Central Limit Theorem, the sample proportion X�^ has for a large sample size distribution that can be approximated by a normal distribution. Therefore

X�^ − π

�π(1^ − π) 𝑛𝑛

has for large n a distribution that can be approximated by a standard normal distribution.

It can be shown that for a large sample size the variable

X�^ − π

�X

�(1 − X�)

has a standard normal distribution, in the previous expression we replace the standard error of the proportion by its estimator.

Drawing on the previous results on the construction of confidence intervals for the normal case, the interval

�X�^ − zα 2

�X

�(1 − X�)

, X�^ + zα 2

�X

�(1 − X�)

contains with probability 100(1-α) % the unknown proportion π.

The interval

�x� − zα 2

�x�(1^ −^ X

, x� + zα 2

x�(1 − x�) 𝑛𝑛

is the (1-α)100% confidence interval for the unknown proportion π.

The 99% confidence interval for the proportion of young (aged between 15 and 25 and living in the USA) who have commented on a news story or blog read online about a political campaign, candidate or issue is (0.1784, 0.2166). We are 99% confident that such percentage is between 17.84% and 21.66%.

Section 5 Confidence intervals with STATA

We obtain confidence intervals on the mean through the command mean. By default 95% confidence intervals are derived, confidence intervals of different level can be obtained by adding the option level. The syntax is

mean var_name, level(#)

The 95% confidence interval on the mean of participatory_index is given by

A hypothesis testing problem consists in testing a null hypothesis against an alternative one. More precisely, in a hypothesis testing problem we have to decide whether to reject the null hypothesis H 0 or to not reject the null hypothesis H0, based on the empirical evidence provided by the sample. When H 0 is rejected we decide to act presuming that H 0 is false and Ha true. The two hypotheses play a different role. Indeed, in addressing a hypothesis testing problem we take a falsification approach: we presume that the null hypothesis is true unless the data provide strong evidence against it. For this reason, we specify the null hypothesis so to depict the current situation or status quo. The alternative hypothesis is the analyst research hypothesis. The burden of proof falls on the researcher who claims that the alternative hypothesis is true. In testing H 0 against Ha, we want to assess whether there is enough empirical evidence against H 0 and therefore enough empirical evidence supporting our research hypothesis Ha.

A courtroom trial provides an analogy for our testing procedures. The null hypothesis is that the defendant is innocent. The alternative is that the defendant is guilty. The jury presumes that the defendant is innocent, that the null hypothesis is true, unless the evidence provided by the data suggests otherwise.

Once formulated the problem, through the identification of null and alternative hypothesis, the second step consists in specifying a decision rule. It is a rule that based on the empirical evidence provided by the sample lets us take one of the following two decisions

 reject the null hypothesis and act as if the alternative hypothesis were true

 do not reject the null hypothesis and act as if the null hypothesis were true.

We look for a good decision rule that is a rule with a low probability to make a mistake. There are two possible errors, Type I error consisting in rejecting the null hypothesis H 0 when it is true and Type II error consisting in not rejecting the null hypothesis H 0 when it is false. The best decision rule is then the one that minimizes both the probability of making Type I error and the probability of making Type II error. Unfortunately, this is not possible. We can show that there is a trade-off between the two probabilities. A decrease in the probability of making one type of error is associated with an increase in the probability of making an error of the other type.

Since we cannot minimize both probabilities, the strategy is to identify the worst error so to control for the probability of making it. The worst error is Type I error and the analogy with a courtroom trial helps us understanding why. If the jury rejects the null hypothesis, it decides that there is enough empirical evidence to convict the defendant. When making Type I error, the jury is convicting an innocent. In the case of Type II error, the jury is acquitting a defendant who is actually guilty.

We can as well understand why Type I error is the worst one by considering the fact that the null hypothesis is the one that depicts the current situation, so that once rejected a change is needed and therefore costs need to be afforded. When making Type I error, we afford costs that are not necessary. When making Type II error, no action is needed, no change in the current situation is needed, no costs are afforded.

The decision rule we use is specified in such a way to control for the probability of making Type I error. The probability of Type I error is called significance level of the test and it is denoted by α. The analyst decides the significance level, usual choices being 0.05, 0.01, 0.1. We use hypothesis testing procedures such that the probability of making Type I error is equal to the predetermined α. Such hypothesis testing techniques are called significance test. A significance test of level α is a testing procedure such that the probability of making Type I error is α.

Section 6.1 Hypothesis testing on the mean

In this section we study how to solve hypothesis testing problems on the population mean. We consider the following three kinds of problem, for μ 0 being a constant (number) specified by the analysis.

  1. Test the null hypothesis H 0 : μ = μ 0 against the alternative Ha : μ>μ 0
  1. Test the null hypothesis H 0 : μ = μ 0 against the alternative Ha : μ<μ 0
  2. Test the null hypothesis H 0 : μ = μ 0 against the alternative Ha : μ ≠ μ 0

Note that the tests differ only on the alternative hypothesis that is always composite. The null hypothesis is the same and it is a simple hypothesis. We refer to the first two problems as one-sided or one-tail hypothesis testing problems, the last one is called two-sided or two-tails problem.

Let begin by considering the first one-sided test

Test the null hypothesis H 0 : μ = μ 0 against the alternative Ha : μ>μ 0

We need to decide whether there is enough empirical evidence to reject the null hypothesis and act as if the unknown population mean were greater than the value specified by the null hypothesis, μ0.

As an example, let go back to the YPP survey and referring to variable Q3_DAYS, let address the following problem: is there enough empirical evidence to conclude at 5% significance level that the average number of days a young uses a handheld device (including a smartphone) that connects internet is higher than 3.5?

As we can see, the question is asked in such a way to identify the research question or alternative hypothesis. Our problem is then

Test the null hypothesis H0: μ = 3.5 against the alternative H (^) a : μ > 3.

The level of significance is set in the question equal to 5%, 0.05.

Below the output with the sample mean of variable Q_3DAYS, the standard error of the mean and the 95% confidence interval on the population mean number of days a young uses a handheld device (including a smartphone) that connects internet.

Under the null hypothesis, presuming that the null hypothesis is true, we know that the sample mean has distribution that has mean equal to 3.5. As we can see, the observed sample mean is 3.637066, greater than the value specified by the null hypothesis. Is this due to sampling variability? Or is this value telling us that the population mean is not 3, that it is higher than 3? Is the observed value of the sample mean providing us with enough evidence against the null hypothesis?

The decision to reject or not to reject the null hypothesis is based on a function of the sample or statistic that is referred to as test statistic. Any test statistic compares the estimate of the parameter against the value specified by the null hypothesis. Any test statistic measures the distance between the estimate and the value of the parameter specified by the null hypothesis in terms of number of standard errors the estimate is falling above or below the value specified by the null hypothesis.

When we make inferences on the population mean, we know that the unknown population mean is estimated by the

sample mean X�. The standard error of the mean is estimated by S/√𝑛𝑛, where s is the sample standard deviation. Let denote by se the standard error. The test statistic in the case of tests on the mean has the following expression

The value of the test statistic denoted by a t is 2.2328. The p-value of the test, as displayed, is 0.0000, it is smaller than 0.05, the significance level. We reject the null hypothesis at 5% significance level. There is enough empirical evidence to conclude at 5% significance level that the average number of days a young uses a handheld device (including a smartphone) that connects internet is higher than 3.

In testing the null hypothesis H (^) 0: μ = μ 0 against the alternative H (^) a : μ < μ 0 , the p-value is the probability, worked out under the null hypothesis, of observing a value of the test statistic smaller than the observed one. Again for a large sample size, if we presume true the null hypothesis, the test statistic has a standard normal distribution. The p- value is a tail probability, a left tail, as shown in the graph below.

In the two-sided test, we test the null hypothesis H0: μ = μ 0 against the alternative H (^) a : μ ≠ μ0. Recall that the p-value is the probability of observing a value of the test statistic more extreme than the value observed under the null hypothesis. In this case, with alternative hypothesis being “different from”, more extreme has to be meant in each of two directions. The p-value is, presuming that the null hypothesis is true, the probability of observing a value greater than the observed one when the value is positive and smaller than the observed one when it is negative. Assuming that the unknown population mean is equal to μ0, the p-value is the probability that in absolute value the test statistic takes a value greater than the absolute value of the observed value.

In this case the p-value is a two tails probability, as shown in the graph below.

𝑥𝑥̅ − 𝜇𝜇 0 𝑠𝑠𝑒𝑒

− |𝑥𝑥̅ − 𝜇𝜇 0 | 𝑠𝑠𝑒𝑒

|𝑥𝑥̅ − 𝜇𝜇 0 | 𝑠𝑠𝑒𝑒

Section 6.2 Hypothesis testing on the proportion

Hypothesis testing problems on the population proportion are addressed as hypothesis testing problems on the mean. Again we consider the following three kinds of problem, where π 0 is a number between 0 and 1 fixed by the analyst

  1. Test the null hypothesis H 0 : π = π 0 against the alternative Ha : H0: π > π 0
  2. Test the null hypothesis H 0 : π = π 0 against the alternative Ha : H0: π < π 0
  3. Test the null hypothesis H 0 : π = π 0 against the alternative Ha : π 0 ≠ π 0

Tests on the population proportion are based on its estimator, the sample proportion that is the sample mean. For the Central Limit Theorem we know that if n is large enough

X�^ − π

�π(1^ − π) 𝑛𝑛

has a distribution that can be approximated by a standard normal distribution.

The test statistic is X�^ − π 0

�π^0 (1^ −^ π^0 ) 𝑛𝑛

having distribution that is approximated by a standard normal distribution under the null hypothesis.

The p-value is defined as in the previous case and it is computed again using the standard normal distribution. The decision rule remains the same, we reject the null hypothesis if the p-value is smaller than the significance level.

Let go back to YPPS dataset and let assess if at 1% significance level, there is enough empirical evidence to claim that the percentage of young who did at least one act of participatory politics is smaller than 45%. If π is the proportion of young who have done at least one act of participatory politics, we have to test the null hypothesis H (^) 0: π = 0. against the alternative Ha: π < 0.45.

Below the output of the testing procedure.

The test statistics (denoted by z) takes value -1.3383. The observed proportion 0.45 falls 1.3383 standard errors below 0.45. The p-value is 0.1808, it is greater than 0.01, we do not reject the null hypothesis. At 1% significance level, there is not enough empirical evidence to conclude that the percentage of young who did at least one act of participatory politics is smaller than 45%.