KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

44
KNR 445 Statistic s t-tests Slide 1 Introduction to Hypothesis Testing The z-test

Transcript of KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

Page 1: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

t-testsSlide 1

Introduction to Hypothesis

TestingThe z-test

Page 2: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 2

Stage 1: The null hypothesis

If you do research via the deductive method, then you develop hypotheses

From 497 (intro to research methods):

Deduction

Page 3: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 3

Stage 1: The null hypothesis

The null hypothesis The hypothesis of no difference Need for the null: in inferential stats, we test

the empirical evidence for grounds to reject the null

Understanding this is the key to the whole thing… The distribution of sample means, and its variation Time for a digression…

Page 4: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 4

The distribution of sampling means

Let’s look at this applet… This is the population from which you draw

the sample

Here’s one sample (n=5)

Here’s the sample mean for the sample

Page 5: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 5

The distribution of sampling means

Let’s look at this applet…

If we take a 1,000 more samples, we get a distribution of sample means. Note that it looks

normally distributed, but its

variation alters with sample size

(for later)

Page 6: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 6

The distribution of sampling means

Let’s look at this applet…

For now, the important thing to note is that some sample

means are more likely than others, just as some scores

are more likely than others in a

normal distribution

Page 7: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 7

Stage 1: The null hypothesis

Knowing that the distribution of sample means has certain characteristics (later, with the z-statistic) allows us to state with some certainty how likely it is that a particular sample mean is “different from” the population mean Thus we test for this “statistical oddity” If it’s sufficiently odd (different), we reject

the null If we reject the null, we conclude that our sample is not

from the original population, and is in some way different to it (i.e. from another population)

Page 8: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 8

Stage 1: The null hypothesis

Example of the null: You’re looking for an overall population to

compare to

Page 9: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 9

Stage 1: The null hypothesis

Example of the null: So the null is the assumption that our

sample mean is equal to the overall population mean

Page 10: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 10

Stage 2: The alternative hypothesis

Also known as the experimental hypothesis (HA, H1)

Two types: 1-tailed, or directional

Your sample is expected to be either more than, or less than, the population mean

Based on deduction from good research (must be justified)

2-tailed, or non-directional You’re just looking for a difference More exploratory in nature Default in SPSS

Page 11: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 11

Stage 2: The alternative hypothesis

Example of the alternative hypothesis

HA can be that you expect the sample mean to be less than the

null, greater than the null, or just different…

which is it here?

Page 12: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 12

Stage 2: The alternative hypothesis

So, here our HA: µ > 49.52. Now, next…

What the heck is that?

Page 13: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 13

Stage 3: Significance threshold (α)

How do we decide if our sample is “different”? It’s based on probability Recall normal distribution & z-scores

Page 14: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 14

Stage 3: Significance threshold (α)

Notice the fact that distances from the mean are marked by certain probabilities in a normal distribution

Page 15: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 15

Stage 3: Significance threshold (α)

Our distribution of sample means is similarly defined by probabilities

So, we can use this to make estimates of how likely certain sample means are to be derived from the null population

What we are saying here is that: Sample means vary The question is whether the variation is due to

chance, or due to being from another population When the variation exceeds a certain probability

(α), we reject the null (see applet again)

Page 16: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 16

Stage 3: Significance threshold (α)

When the variation exceeds a certain probability (α), we reject the null…

Sample means of these sizes are unusual. How unusual is

dictated by the normal distribution’s pdf (probability

density function)

Page 17: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 17

Stage 3: Significance threshold (α)

When the variation exceeds a certain probability (α), we reject the null…

Convention in the social sciences has become to reject the null when the

probability of the variation is less than 0.05.

This gives us our significance level (α = .05)

Page 18: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 18

Stage 4: The critical value of Z

How do we use this probability? Every test uses a distribution The z-test uses the z-distribution

So we use probabilities from the z distribution… …and then we convert the difference between the

sample and population means to a z-statistic for comparison

First, we need that probability – we can use tables for this…or an applet…let’s do the tables thing for now

Page 19: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 19

Stage 4: The critical value of Z

For our example:

This is α (= .10)

Page 20: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 20

Stage 4: The critical value of Z

For our example: α = 0.1, and the hypothesis is 1-tailed, so

our distribution would look like this

Rejection region α (= .10)

Fail to reject the null 1 - α (= .90)

Z score for the α (= .10)

threshold

Page 21: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 21

Stage 4: The critical value of Z

For our example: However, the tables only show half the

distribution (from the mean onwards), so we would have this:

Area referred to in the table

Rejection region α (= .10)

Z score for the α (= .10)

threshold

Page 22: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 22

Stage 4: The critical value of Z

• So, we need to find a probability of 0.40

1. Locate the number nearest to .4 in the table

2. Then look across to the “Z” column for the value of Z to the nearest tenth (= 1.2)

3. Then look up the column for the hundredths (.08)

4.So, z ≈ 1.285

Page 23: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 23

Stage 5: The test statistic!

So, we insert that threshold value, and now we are asked for some more values… The sample

mean

The sample size

The population SD

Page 24: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 24

Stage 5: The test statistic!

Why do we need these three? Because now we have to convert our difference score to a score on the distribution of sample means

Remember this?

SD

XXΖ

The purpose of this statistic was to convert a

raw score difference (from the mean) by

scaling it according to the spread of raw scores in the distribution of raw

scores

Page 25: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 25

Stage 5: The test statistic!

Sample mean

Population mean

Variability of sample

means

The purpose of this statistic is the same, but it converts a sample mean difference (from µ) by scaling it according to

the spread of all sample means in the distribution of sample means

XSE

XZ

Page 26: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 26

Stage 5: The test statistic!

Understanding influences on the distribution of sample means…we’ll use the applet again

Note sample size…

& note spread of sample

means

Page 27: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 27

Stage 5: The test statistic!

Understanding influences on the distribution of sample means…we’ll use the applet again

As sample size goes

up…

Spread of sample means

goes down

Page 28: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 28

Stage 5: The test statistic!

Understanding influences on the distribution of sample means… That means that the test statistic has to take

sample size into account Other influences are mean difference

(sample – population) and variability in the population

How do you think each of these things influence the test statistic? This will help you understand why the test statistic looks

like it does

Page 29: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 29

Stage 5: The test statistic!

Sample mean

Population mean

Variability of sample

means

A closer look: to understand how the mean difference, population variance, and sample size affect the test statistic, we need to look at the SEM in more detail

XSE

XZ

Page 30: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 30

nSE

X

Stage 5: The test statistic!

Population standard deviation

Sample size

XSE

XZ

So…can you see the influences?

Page 31: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 31

Stage 5: The test statistic!

To calculate, then… First the standard error of the mean:

Now the test statistic itself:

8534.13484.7

62.13

54

62.13

nSE

X

273.18534.1

52.4988.51

XSE

XZ

Page 32: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 32

Stage 5: The test statistic!

For you to practice, I’ve provided a simple excel file that does the calculation bit for you…

Page 33: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 33

Stage 6: The comparison & decision

Do we fail to reject the null? Or reject the null?

Page 34: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 34

3 ways of phrasing the decision…

What is the probability of obtaining a Zobs = 1.273 if the difference is attributable only to random sampling error?

Is the observed probability (p) less than or equal to the -level set?

Is p ?

Page 35: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 35

Reporting the Results

The observed mean of our treatment group was 51.88 ( 13.62) pages per employee per week. The z-test for one sample indicates that the difference between the observed mean of 51.88 and the population average of 49.52 was not statistically significant (Zobs = 1.27, p > 0.1). Our sample of employees did not use significantly more paper than the norm. Notice this would

change if changed

Page 36: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 36 Do not reject H0 vs. Accept H0

Accept infers that we are sure Ho is valid Do not reject implies that this time we

are unable to say with a high enough degree of confidence that the difference observed is attributable to anything other than sampling error.

Page 37: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 37

Note: Z & t-tests

Same concept, different assumptions Can only use z-tests if you know population

SD You usually don’t – SPSS does not even

provide the test So SPSS uses t-test instead

t-test more robust against departures from normality (doesn’t affect the accuracy of the p-estimate as much)

T-test estimates population SD from sample SD

Page 38: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 38

Note: Z & t-tests

To estimate pop SD from sample SD, the sample SD is inflated a little…

1

2

n

xxs est

)(

Page 39: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 39

Note: Z & t-tests

To estimate standard error from sample SD, use the estimated SD again, thus…

ns

sX

Page 40: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 40

Note: Z & t-tests

This is important Size of estimated SE obviously

depends on both SD of sample, and sample size

ns

sX

Page 41: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 41

Testing in SPSS

STEP 1: Choose the procedure. SPSS uses the one sample t-test

instead of the z-test. It’s similar (see previous

notes). I used the midterm data for this

Page 42: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 42

Testing in SPSS

STEP 2: Choose a variable to test

STEP 3: Choose a population mean value to

test it against (SPSS doesn’t have a clue what population your testing

against, right?)

STEP 4: Choose “OK” (you could also go into options and change the

confidence interval size – the default is 95%)

Page 43: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 43

One-Sample Statistics

50 16.8580 2.2664 .3205Averagepupil/teacher ratio

N Mean Std. DeviationStd. Error

Mean

One-Sample Test

-34.763 49 .000 -11.1420 -11.7861 -10.4979Averagepupil/teacher ratio

t df Sig. (2-tailed)Mean

Difference Lower Upper

95% ConfidenceInterval of the

Difference

Test Value = 28

And you get this…

T-Test

1. Here’s the important bit – the statistical

outcome (big difference)

2. Here’s the standard error3. If you think of the

equation, it’s obvious a mean difference this big

would result in a significant difference, right?

Page 44: KNR 445 Statistics t-tests Slide 1 Introduction to Hypothesis Testing The z-test.

KNR 445Statistics

Effect sizesSlide 44 Quittin’ time