You are on page 1of 56

INFERENTIAL

STATISTICS
Prepared By:
Ma. Cristina S. Severino – Perocho
MAEd E –II

Prof. Rebecca Regala


Statistics Professor

2nd Semester 2010-2011


INFERENTIAL STATISTICS
While descriptive statistics is concerned with
condensing a set of known numbers into a few simple
values (either numerically or graphically) to simplify an
understanding of the data, inferential statistics is used to
make conclusions and future predictions by analyzing the
data.

There are two main methods used in inferential statistics:


Estimation - The sample is used to
estimate a parameter
Hypothesis testing - discover whether a second sample is
or
is not significantly different from the
INFERENTIAL STATISTICS
EXAMPLE:
Inferential statistics are used to draw inferences about a
population from a sample

Experiment:
 Normal night sleep
24 hrs. No sleep Perform a task
Perform a task 15 students
15 students = 90 points
= 78 points

QUESTION: Is the difference real or could it be due to chance?


How much larger could the real difference be than the
12 points found in the sample?
These are the types of questions answered by inferential statistics
INFERENTIAL STATISTICS
•The use of randomization in sampling allows for the analysis of
results using the methods of statistical inference. Statistical
inference is based on the laws of probability, and allows analysts
to infer conclusions about a given population based on results
observed through random sampling.
Statistical Inference. Role of chance.

S c ie n t if ic k n o w le d g e

R e a s o n a n d i n t u it io n E m p ir i c a l o b s e r v a t i o n

Formulate Collect data to


hypotheses test hypotheses
Statistical inference. Role of chance.

Systematic error

Formulate Collect data to


hypotheses test hypotheses

Accept hypothesis Reject hypothesis

Random error (chance) can be controlled by statistical significance


or by confidence interval.
INFERENTIAL STATISTICS
In the most common use of hypothesis testing, a "straw man"
null hypothesis is put forward and it is determined whether the
data are strong enough to reject it.
Null Hypothesis H0 – states there is no significant

relationship or difference between


variables
HA
Alternative Hypothesis – states that there is a significant
relationship between variables
H0the=sleep deprivation study, the null hypothesis would be that:
For
“Sleep deprivation has no effect on performance.”
AndHalternative
A =
hypothesis would be that:
“Sleep deprivation affects performance.”
SAMPLING
DISTRIBUTIONS
Sampling Distributions
Statistical Terms in Sampling
response is a specific
measurement value that a
sampling unit supplies.

Parameter of the population


is the measurement of the
entire population and
calculation a value like a
mean or average.
Sampling Distributions
-The distribution of an infinite
number of samples of the same
size as the sample in your
study. It is a distribution of a
sample statistic.
A SUMMARY LOGIC BEHIND SAMPLING DISTRIBUTION
•We don't ever actually
Sampling Distributions construct a sampling
distribution. Because to
construct it we would
have to take an infinite
number of samples

•We need to realize that


our sample is just one of
a potentially infinite
number of samples that
we could have taken.

•If we take the average of the


sampling distribution we
would be much closer to the
true population average -- the
parameter of interest. So the
average of the sampling
distribution is essentially
equivalent to the parameter.
Sampling Distributions
•It is often impossible to measure the mean or standard deviation of an entire
population unless the population is small, or we do a nationwide census. The
population mean and standard deviation are examples of population
parameters--descriptive measurements of the entire population. Given the
impracticality of measuring population parameters, we instead measure
sample statistics--descriptive measurements of a sample. Examples of
sample statistics are the sample mean, sample median, and sample standard
deviation.
Q OK, so why not use the sample statistic as an estimate of the
corresponding population parameter: for instance, why not use the
sample mean as an estimate of the population mean?
A This is exactly what we do to estimate population means and medians
(with a slight modification in the case of the standard deviation). However,
a sample statistic (such as the sample mean) may be "all over the place,"
so a further question is: how confident can we be in the sample statistic?
Sampling Distributions
EXAMPLE
•If we cast a fair die and take X to be the uppermost number, we know that
the population mean (expected value) is = 3.5, and that the population
median is also m = 3.5. But if we take a sample of, say, four throws, the
mean may be far from 3.5. Here are the results of 5 such samples of 4
throws (we used a random number generator to obtain these samples):
X1 X2 X3 X4
X
Sample 1 6 2 5 6 4.75
Sample 2 2 3 1 6 3
Sample 3 1 1 4 6 3
Sample 4 6 2 2 1 2.75
Sample 5 1 5 1 3 2.5
Since each sample consists of 4 throws, we say that the sample size is n = 4.
Notice that none of the five samples gave us the correct mean, and that the
mean of the first sample is far from the actual mean.
X1 X2 X3 X4
X
Sample 1 6 2 5 6 4.75
Sample 2 2 3 1 6 3
Sample 3 1 1 4 6 3
Sample 4 6 2 2 1 2.75
Sample 5 1 5 1 3 2.5

Q The table above is interesting: look at the values of the mean X. The
everage (mean) of these means is 3.2. Thus, although the mean of a
particular sample may not be a good predictor of the population mean, we
get better results if we take the mean of a whole bunch of sample means.

A You have put your thumb on one of the most important concepts
inferential statistics; the values of are values of a random variable (take
a sample of 5, and measure the mean), and its probability distribution is
called the sampling distribution of the sample mean. The above table
suggests that the expected value of the sampling distribution of the mean is
the same as the population mean, and this turns out to be true.
Sampling Distributions
Computing a Sampling Distribution by Hand
An unfair coin has a 75% chance of landing heads-up. Let X = 1 if it lands
heads-up, and X = 0 if it lands tails-up. Find the sampling distribution of
the mean for samples of size 3.
Outcome HHH HHT HTH HTT THH THT TTH TTT

Probability

X
Sampling Distributions
Solution The experiment consists of tossing a coin 3 times and
measuring the sample mean The following table shows the collection
.

of all possible outcomes (samples) and associated sample mean.


Outcome HHH HHT HTH HTT THH THT TTH TTT
Look at the first outcome:
HHH. Since H
Probability
corresponds to X = 1, the 27/64 9/64 9/64 3/64 9/64 3/64 3/64 1/64
values of X for this sample
are 1, 1, 1. Thus, the
sample mean is (1+1+1)/3
= 1. Now look at the X 1 2/3 2/3 1/3 2/3 1/3 1/3 0
second outcome. Since T
corresponds to X = 0, the
values of X for this sample
Look at the first outcome: HHH. Since the probability of heads
are 1, 1, 0, and the sample
mean is (1+1+0)/3 = is 0.75 = 3/4, the probability of getting the sequence HHH of
2/3.Continue in this three heads in a row is (3/4)(3/4)(3/4) = 27/64. Similarly, the
manner to obtain the probability of HHT is (3/4)(3/4)(1/4) = 9/64, since the probability
sample means for all the of tails is 0.25 = 1/4. Continue in this manner to obtain the
outcomes.
probabilities of all the outcomes.
Properties of the Sampling Distribution
 The mean of the sampling distribution is given as follows.
The mean of the sampling distribution = mean of the sampled population:
µ =µ
The standard deviation of the sampling distribution is given as follows.
Standard= Deviation of Sampled
Standard Deviation of Sampling Distribution
Population ó
Square Root of
Sample Size ó = √n
If the population distribution is normal, then so is the sampling distribution
of .
The Central Limit Theorem If the population distribution is not necessarily
normal, and has mean and standard deviation , then, for sufficiently large n,
the sampling distribution of is approximately normal, withó mean
ó = √n
µ =µ and standard deviation
Sampling DistributionExample Problem
Testing of hypotheses

learning objectives:

» to understand the role of significance test

» to distinguish the null and alternative


hypotheses

» to interpret p-value, type I and II errors


Testing of hypotheses
Significance test
Subjects: random sample of 352 nurses from HUS surgical
hospitals
Mean age of the nurses (based on sample): 41.0
Another random sample gave mean value: 42.0.

Question: Is it possible that the “true” age of nurses


from HUS surgical hospitals was 41 years
and observed mean ages differed just
because of sampling error?

Answer can be given based on Significance Testing.


Testing of hypotheses

Null hypothesis H0 - there is no difference

Alternative hypothesis HA - question explored by the


investigator

Statistical method are used to test hypotheses

The null hypothesis is the basis for statistical test.


Testing of hypotheses
Example
The purpose of the study:
to assess the effect of the lactation nurse on attitudes
towards breast feeding among women

Research question: Does the lactation nurse have an


effect on attitudes towards breast
feeding ?

HA :

H0 :
Testing of hypotheses
Definition of p-value.
90
2.5% 95% 2.5%
80

70

60

50

40

30

20

10

0
23.8 28.8 33.8 38.8 43.8 48.8 53.8 58.8

AGE
If our observed age value lies outside the green lines, the probability
of getting a value as extreme as this if the null hypothesis is true is
< 5%
Testing of hypotheses
Definition of p-value.

p-value = probability of observing a value more


extreme that actual value observed, if the null
hypothesis is true

The smaller the p-value, the more unlikely the null


hypothesis seems an explanation for the data

Interpretation for the example


If results falls outside green lines, p<0.05,
if it falls inside green lines, p>0.05
Testing of hypotheses
Type I and Type II Errors
No study is perfect,
there is always the chance for error
Decision H0 true / HA false H0 false / HA true
Accept H0 / Type II error ()
reject HA OK
p=1- p=
Reject H0 Type I error ()
/accept HA OK
p= p=1-

 - level of significance 1- - power of the test


Testing of hypotheses
Type I and Type II Errors
there is only 5 chance in 100 that the result
α =0.05 termed "significant" could occur by chance
alone

The probability of making a Type I (α) can be decreased by


altering the level of significance.

it will be more difficult to find a significant result

the power of the test will be decreased


the risk of a Type II error will be increased
Testing of hypotheses
Type I and Type II Errors

The probability of making a Type II () can be decreased


by increasing the level of significance.

it will increase the chance of a Type I error

To which type of error you are willing to risk ?


Testing of hypotheses
Type I and Type II Errors. Example

Suppose there is a test for a particular disease.


If the disease really exists and is diagnosed early, it can be
successfully treated
If it is not diagnosed and treated, the person will become
severely disabled
If a person is erroneously diagnosed as having the disease and
treated, no physical damage is done.

To which type of error you are willing to risk ?


Testing of hypotheses
Type I and Type II Errors. Example.
Decision No disease Disease
Not diagnosed OK Type II error

Diagnosed Type I error OK

irreparable damage
treated but not harmed
would be done
by the treatment

Decision: to avoid Type error II, have high level of


significance
Testing of Hypotheses
Confidence interval and significance test
Null hypothesis
is accepted

A value for null hypothesis


p-value > 0.05
within the 95% CI
Null hypothesis
is rejected
A value for null hypothesis
outside of 95% CI p-value < 0.05
Testing of Hypotheses
SUMMARY
IN Summary, there are six steps in hypothesis testing
and these are:
1. State the null hypothesis

2. State the alternative hypothesis

3. Specify the level of significance


4. Determine the critical region and the appropriate test
statistics
5. Compute the equivalent test statistics of the observed
value of the parameter
6. Make your decisions either REJECT or ACCEPT the null
hypothesis.
TESTING OF HYPOTHESIS
TESTING OF HYPOTHESIS
LEVEL OF
SIGNIFICANCE
Significance Level

•In hypothesis testing, the significance level is the criterion used for
rejecting the null hypothesis. The significance level is used in
hypothesis testing as follows: First, the difference between the results
of the experiment and the null hypothesis is determined. Then,
assuming the null hypothesis is true, the probability of a difference that
large or larger is computed . Finally, this probability is compared to the
significance level. If the probability is less than or equal to the
significance level, then the null hypothesis is rejected and the outcome
is said to be statistically significant. Traditionally, experimenters have
used either the 0.05 level (sometimes called the 5% level) or the 0.01
level (1% level), although the choice of levels is largely subjective. The
lower the significance level, the more the data must diverge from the
null hypothesis to be significant. Therefore, the 0.01 level is more
conservative than the 0.05 level. The Greek letter alpha (α) is
sometimes used to indicate the significance level.
POWER OF A TEST
Calculating The Power Of A Test

Here we look at some examples of calculating the power of


a test. The examples are for both normal and t distributions.
We assume that you can enter data and know the
commands associated with basic probability. All of the
examples here are for a two sided test, and you can adjust
them accordingly for a one sided test.

•Calculating The Power Using a Normal Distribution


•Calculating The Power Using a t Distribution
•Calculating Many Powers From a t Distribution
Calculating The Power Using a
Normal Distribution
Here we calculate the power of a test for a normal distribution
for a specific example. Suppose that our hypothesis test is the
following:

H0: mu = a,
Ha: mu not = a.

The power of a test is the probability that we can the reject null hypothesis
at a given mean that is away from the one specified in the null hypothesis.
We calculate this probability by first calculating the probability that we
accept the null hypothesis when we should not. This is the probability to
make a type II error. The power is the probability that we do not make a
type II error so we then take one minus the result to get the power.
We can fail to reject the null hypothesis if the sample happens to
be within the confidence interval we find when we assume that the
null hypothesis is true. To get the confidence interval we find the
margin of error and then add and subtract it to the proposed mean,
a, to get the confidence interval. We then turn around and assume
instead that the true mean is at a different, explicitly specified
level, and then find the probability a sample could be found within
the original confidence interval.

In the example below the hypothesis test is for


H0: mu = 5,
Ha: mu not = 5.
We will assume that the standard deviation is 2, and the sample size is
20. In the example below we will use a 95% confidence level and wish
to find the power to detect a true mean that differs from 5 by an amount
of 1.5. (All of these numbers are made up solely for this example.) The
commands to find the confidence interval in R are the following:
> a <- 5 >
s <- 2 >
n <- 20
> error <- qnorm(0.975)*s/sqrt(n) > left <- a error
>right <- a+error
> left [1] 4.123477
>right
[1] 5.876523
• Next we find the Z-scores for the left and right values
assuming that the true mean is 5+1.5=6.5:
assumed <- a + 1.5
>Zleft <- (left-assumed)/(s/sqrt(n))
> Zright <-(right-assumed)/(s/sqrt(n))
> p <- pnorm(Zright)-pnorm(Zleft)
>p [1] 0.08163792
•The probability that we make a type II error if the true mean is 6.5 is
approximately 8.1%. So the power of the test is 1-p:
>1-p [1] 0.918362

In this example, the power of the test is approximately 91.8%. If the true
mean differs from 5 by 1.5 then the probability that we will reject the null
hypothesis is approximately 91.8%.
Calculating The Power Using a
t Distribution
•Calculating the power when using a t-test is similar to using a
normal distribution. One difference is that we use the command
associated with the t-distribution rather than the normal
distribution. Here we repeat the test above, but we will assume that
we are working with a sample standard deviation rather than an
exact standard deviation. We will explore three different ways to
calculate the power of a test. The first method makes use of the
scheme many books recommend if you do not have the non-central
distribution available. The second does make use of the non-central
distribution, and the third makes use of a single command that will
do a lot of the work for us.
•In the example the hypothesis test is the same as above,
H0: mu = 5,
Ha: mu not = 5.
•Again we assume that the sample standard deviation is 2, and the
sample size is 20. We use a 95% confidence level and wish to find
the power to detect a true mean that differs from 5 by an amount of
1.5. The commands to find the confidence interval in R are the
following: > a <- 5
> s <- 2
> n <- 20
>error < qt(0.975,df=n1)*s/sqrt(n)
> left <- a-error
> right <- a+error
> left [1] 4.063971
> right [1] 5.936029
•The number of observations is large enough that the results are
quite close to those in the example using the normal distribution.
Next we find the t-scores for the left and right values assuming that
the true mean is 5+1.5=6.5:
> assumed <- a + 1.5
> tleft <- (left-assumed)/(s/sqrt(n))
> tright <- (right-assumed)/(s/sqrt(n))
> p <- pt(tright,df=n-1)-pt(tleft,df=n-1) > p
[1] 0.1112583
•The probability that we make a type II error if the true mean is 6.5
is approximately 11.1%. So the power of the test is 1-p:

> 1-p [1] 0.8887417

•In this example, the power of the test is approximately 88.9%. If the
true mean differs from 5 by 1.5 then the probability that we will
reject the null hypothesis is approximately 88.9%. Note that the
power calculated for a normal distribution is slightly higher than for
this one calculated with the t-distribution.
•Another way to approximate the power is to make use of the non-
centrality parameter. The idea is that you give it the critical t scores and
the amount that the mean would be shifted if the alternate mean were
the true mean. This is the method that most books recommend.
> ncp <- 1.5/(s/sqrt(n))
> t <- qt(0.975,df=n-1)
> pt(t,df=n-1,ncp=ncp)-pt(-t,df=n-1,ncp=ncp)
[1] 0.1111522 >
1-(pt(t,df=n-1,ncp=ncp)-pt(-t,df=n-1,ncp=ncp))
[1] 0.8888478

•Again, we see that the probability of making a type II error is


approximately 11.1%, and the power is approximately 88.9%.
Note that this is slightly different than the previous calculation
but is still close.
•Again, we see that the probability of making a type II error is
approximately 11.1%, and the power is approximately 88.9%. Note
that this is slightly different than the previous calculation but is still
close.
Finally, there is one more command that we explore. This command
allows us to do the same power calculation as above but with a single
command.
> power.t.test(n=n,delta=1.5,sd=s,sig.level=0.05, type="
one.sample",alternative="two.sided",strict = TRUE)
One-sample t test power calculation
n = 20 delta = 1.5
sd = 2 sig.level = 0.05
power = 0.8888478
alternative = two.sided
This is a powerful command that can do much more than just calculate
the power of a test. For example it can also be used to calculate the
number of observations necessary to achieve a given power.
Parametric tests of significance

learning objectives:

» to distinguish parametric tests of


significance

» to identify situations in which the use of


parametric tests is appropriate
Parametric Tests of Significance

Parametric test of significance - to estimate at least one


population parameter from sample statistics

Assumption: The variable we have measured in the sample


is normally distributed in the population to
which we plan to generalize our findings
Some concepts related to the statistical
methods.

Multiple comparison

two or more data sets, which should be analyzed

– repeated measurements made on the same individuals

– entirely independent samples


Some concepts related to the statistical
methods.
Sample size
number of cases, on which data have been obtained

Which of the basic characteristics of a distribution are


more sensitive to the sample size ?
central tendency (mean, median, mode) mean

variability (standard deviation, range, IQR) standard deviation

skewness skewness
kurtosis
kurtosis
God bless!*

You might also like