Docsity

Statistics - II midterm, Appunti di Statistica

Toggle sidebar
bg1
4. Foundations for inference
1
4. Foundations for inference
Basics of inference
Parameter estimation
We are often interested in population parameters, like a proportion π.
Since complete populations are difficult (or impossible) to collect data on, we
use sample statistics, like a sample proportion, to infer the population
parameter of interest.
Population parameter vs Sample statistic
Estimator vs Point estimate
is called estimator
💡
An estimator is a formula that tells us how to calculate an
estimate of a population parameter based on sample data.
For the mean, the estimator is the sample mean ( ), which is defined as:
is a random variable representing the sample mean
are the sample observations
X
ˉ
X
ˉ
=X
ˉ
n
X
∑i=1
ni
X
ˉ
X
i
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Anteprima parziale del testo

Scarica Statistics - II midterm e più Appunti in PDF di Statistica solo su Docsity!

4. Foundations for inference

Basics of inference

Parameter estimation

We are often interested in population parameters , like a proportion π.

Since complete populations are difficult (or impossible) to collect data on, we use sample statistics , like a sample proportion , to infer the population parameter of interest.

Population parameter vs Sample statistic

Estimator vs Point estimate

is called estimator

💡 An^ estimator^ is a formula that tells us how to calculate an

estimate of a population parameter based on sample data.

For the mean, the estimator is the sample mean ( ), which is defined as:

is a random variable representing the sample mean are the sample observations

X ˉ

X ˉ

X ˉ^ =

n

∑ i^ n =1^ Xi

X ˉ

Xi

is the sample size. is called (point) estimate

💡 A^ point estimate^ is the actual value obtained by applying the estimator to a particular sample of data. It is a single value that serves as an estimate of the population parameter.

In other words, we take a simple random sample of size n ( ) and use the sample mean ( ) to say something on μ. Based on the formula above:

The distribution of is the sampling distribution , which describes the behaviour of the sample means for all possible observed samples of size n.

Note: is an observed value (a number), is a random variable.

Sampling distribution

Sample

💡 A^ sample^ is a small proportion of the population that we examine and draw conclusion from.

Sampling distribution

💡 A^ sampling distribution^ is the distribution of sample point estimates (e.g., ).

Sample distribution vs Sampling distribution

a sample distribution involves taking a singular sample from a population, and interpreting the data

n

x ˉ

x 1 , x 2 , ..., xn

x ˉ

x ˉ =

n

∑ i^ n =1^ xi

X ˉ

x ˉ

x ˉ X ˉ

x ˉ

 STANDARD DEVIATION

 STANDARDISATION

How to create a sampling distribution

 find your population of interest and the variable youʼre interested in (e.g., height)  take a random sample of size n  measure the variable (e.g., height) of the sample

 calculate the sample mean ( )  create a frequency distribution of the sample mean by plotting the value of for the sample  repeat the steps 2 to 5 multiple times by taking multiple samples that are independent and of the same size

you obtained a sampling distribution (in this case, a bunch of s that are stacked on top of each other)

Sampling distribution formulas

expected value →

variance → standard error →

Standard error vs Standard deviation

the standard deviation quantifies the variation of the observations in a single population or in a single sample the standard error quantifies the variation of the means of multiple samples (the observations of a sampling distribution)

The shape of a sampling distribution

for a normal population → the sampling distribution will be normally distributed

x ˉ

x ˉ

x ˉ

E ( X ˉ^ ) = μ

Var ( X ˉ^ ) = σn

2

SE ( X ˉ^ ) =^ σn

2

💡 The^ margin of error^ MOE^ tells you how near you can expect the sample mean to be to the correct population mean

It quantifies the degree of confidence we can have in the accuracy of the estimate.

The standard error

💡 The standard error is the^ standard deviation^ of the sampling distribution.

the value of the standard error is helpful in determining how far the sample mean may be from the population mean as increases, decreases

Confidence intervals for the mean

💡 A^ confidence interval^ is a plausible range of values for the population parameter.

How to find

To find the corresponding to a % confidence interval:

a b

margin of error = z ⋆^ ⋅ SE ( X ˉ)

SE ( X ˉ^ ) =

n

n SE ( X ˉ)

point estimate

x ˉ

± MOE

± z ⋆⋅ SE

z ⋆

z ⋆^ β

c d find the corresponding to the ( ) percentile in the z-table e

The observed interval is

Note: for nearly normal distributions, the only remarkable difference with normal distribution is that the confidence level holds approximately.

Confidence levels

Commonly used confidence levels in practice are 90%, 95%, 98%, and 99%. They are generically denoted ( ).

Note: , but this is just a notation that I invented to simplify the idea.

Hypothesis testing

Two competing claims

There are two competing hypotheses: the null and the alternative. In a hypothesis test, we make a decision about which might be true considering that:

the null hypothesis is the ordinary state of affairs (the status quo) the alternative hypothesis is considered unusual and we must gather evidence for it

In fact, we conduct a hypothesis test under the assumption that the null hypothesis is true.

If the test results suggest that the data do not provide convincing evidence for the alternative hypothesis, we stick with the null hypothesis → we fail to reject the null hypothesis

z ⋆^ 1 − α /

z ⋆^ = z 1−^ α 2

C. I. = x ˉ

= x ˉ

± z 1−^ α 2 ⋅ SE

± z 1−^ α 2 ⋅

n

C. I. = ( x ˉ − z 1−^ α 2^ ⋅ SE , x ˉ + z 1− 2^ α^ ⋅ SE )

H 0

H 1

If the p-value is low (lower than a chosen level, , which is usually 5% we say that it would be very unlikely to observe the data if the null hypothesis were true, and hence reject. If the p-value is high (higher than ) we say that it is likely to observe the data even if the null hypothesis were true, and hence do not reject.

Decision errors

In a hypothesis test, our choice might be incorrect.

A Type 1 Error is rejecting the null hypothesis when is true. A Type 2 Error is failing to reject the null hypothesis when is true.

We (almost) never know if or is true, but we need to consider all possibilities.

Choosing a significance level

As a general rule we reject when the p-value is less than 0.05, i.e. we use a significance level of α  0.05.

We prefer small values of α because increasing α increases the Type 1 error rate.

If making a Type 1 Error is dangerous or especially costly, we should choose a small significance level (e.g. 0.01. Under this scenario we want to be very cautious about rejecting the null hypothesis, so we demand very strong evidence favouring before we would reject. If a Type 2 Error is relatively more dangerous or much more costly than a Type 1 Error, then we should choose a higher significance level (e.g. 0.10. Here we want to be cautious about failing to reject when the null is actually false.

H 0

H 0

H 0

H 1

H 0 H 1

H 0

H 1 H 0

H 0

Inference on a mean: recap

Checks

The CLT requires that two conditions are satisfied:

independence simple radom samples sampling without replacement of the population sample size : the more skewed the population distribution, the larger the sample size for moderately skewed distributions

(1 − α)% CI for μ

The observed interval is

Hypothesis testing

 Set the hypotheses null value ( ) null value ( )  Define the test test statistic , i.e. the standardised form of the point estimator under the null hypothesis

 Calculate the observed value of the test statistic

 Calculate (or approximate ) a p-value (draw a picture!  Make a decision, and interpret it in context

n < 10%

n > 30

( x ˉ − z 1−^ α 2^ ⋅ SE , x ˉ + z 1− 2^ α^ ⋅ SE ) = x ˉ ± z 1− 2^ α^ ⋅ SE

H 0 : μ = μ 0

H 1 : μ < or > or = μ 0

H 0

Z = ∼

SE

X ˉ^ − μ 0

( or ≈) N (0, 1)

z obs =

SE

x ˉ − μ 0

 The null hypothesis is that men and women have equal average BF%, and the alternative is that these values are different.

or

In other words, the parameter of interest in this problem is the difference in the population means of BF%s for men and women.

2(a) A natural point estimator of the parameter is

and the point estimate for this parameter is the difference between the two sample means:

2(b) We are assuming that the distribution of the point estimator is nearly normal

Under it becomes

 The test statistic, T say, is the standardised point estimator under

 The observed value is

H 0 : μmen = μwomen

H A : μmen = μwomen

H 0 : μmen − μwomen = 0

H A : μmen − μwomen = 0

X ˉ men − X ˉ women

x ˉ men − x ˉ women =23.9 − 35.0 = −11.

X ˉ men − X ˉ women ∼ N ( μmen − μwomen , 0.114 )^2

H 0

X ˉ men − X ˉ women ∼ N (0, 0.114 )^2

H 0

Z = ∼

X ˉ men − X ˉ women − 0

N (0, 1)

z obs^ = =

 The value is huge! And hence the p-value will be tiny, allowing us to reject in favour of.

 These data provide convincing evidence that the average BF% of men and women are different.

zobs

H 0 H 1

  1. Inference for numerical data 2

Has a single parameter: degrees of freedom (df).

Sampling distribution of the sample mean

Assume. Now, both μ and are not known Parameter of interest → μ Point estimator → We known that

or, equivalently,

For this result to be useful, we need to get rid of σ, for example, by estimating it with its sample equivalent S. As a consequence, the distribution of the estimator changes

Inference using the t-distribution

Conditions

independence

X ˉ

X ∼ N ( μ , σ^2 ) σ^2

X ˉ

X ˉ^ ∼ N ( μ ,

n

σ^2

n

σ

X ˉ^ − μ

N (0, 1)

n

S

X ˉ^ − μ

tn −

  1. Inference for numerical data 3

simple random sample n  10% of population (if sampling without replacement) normality exact normality with unknown approximate : moderate skewness + small sample size If the population is not normal, we usually rely on the CLT, which requires large sample sizes. If the sample size is small, we can still use the CLT to make approximate inference, provided that the population it is not extremely skewed. To account for the small sample size, we “adjustˮ inference using the t-distribution instead of the normal distribution.

Confidence interval for with unknown

An observed confidence interval at the level ( ) for is

Hypothesis testing for with unknown

Sample size =.  Set the hypotheses : null value ( ) null value ( )  Define the test statistic :

where

σ^2

μ σ

x ˉ ± t n −1,1− α /2 ⋅ SE

SE =^ sn

μ σ

n

H 0 : μ = μ 0

H 1 : μ < or > or = μ 0

T

T

SE

point estimator – null value

= ∼ t

n

S

X ˉ^ − μ 0

df

df = n − 1

  1. Inference for numerical data 5

(a) Yes (b) No

Analysing paired data

When two sets of observations have this special correspondence (not independent), they are said to be paired. To analyse paired data, it is often useful to look at the difference in outcomes of each pair of observations.

It is important that we always subtract using a consistent order.

Parameter and point estimate

Parameter of interest  Average difference between the reading and writing scores of all high school students.

Point estimate  Average difference between the reading and writing scores of sampled high school students.

Setting the hypotheses

If in fact there was no difference between the scores on the reading and writing exams, what would you expect the average difference to be? What are the hypotheses for testing if there is a difference between the average reading and writing scores?

diff = read – write

μdiff

x ˉ diff

  1. Inference for numerical data 6

There is no difference between the average reading and writing score.

 There is a difference between the average reading and writing score.

Nothing new here

The analysis is no different than what we have done before. We have data from one sample: differences. We are testing to see if the average difference is different than 0.

Calculating the test-statistic and the p-value

The observed average difference between the two scores is 0.545 points and the standard deviation of the difference is 8.887 points. Do these data provide convincing evidence of a difference between the average scores on the two exams? Use.

Since p-value  0.05, fail to reject, the data do not provide convincing evidence of a difference between the average reading and writing scores.

H 0 :

μ diff = 0

H 1

μ diff = 0

tobs

df

p − value

200