# Statistical Measurements, Analysis

Lecture 4 FieldworkThis week we want you, as the Marketing Analyst, to consider these questions from our clients.

Client 1:

For one of our survey results, Consider the following:

Ho : µ -5

A random sample of 25 observations yields a sample mean of -8. The pop sd = 10. Calculate the

p-value. What is the conclusion if α = .05?

In order to test if the population mean differs from 16, you draw a random sample of 32

observations and compute the sample mean and sample standard deviation as 15.2 and 0.6

Use the p-value approach and the critical value approach at 1% level of significance.

Client 2:

The manager of the small store MomandPops Coffee does not want the customers to stand in

line for too long. She is willing to hire someone if the wait is more than 5 minutes. She observes

the following data:

3.5 5.8 7.2 1.9 6.8 8.1 5.4

a. Set up null and alternative hypotheses to determine if the manager needs to hire someone.

b. Calculate the value of the test statistic. What assumption is needed to do this?

Client 3:

In order to deal with financial hardships, people have been raiding their retirement accounts. It

is reported that between 1998 and 2004, about 12% of families with 401k plans borrowed from

those plans. An economist is worried that this amount is now more than 20%. He randomly

surveys 190 households with these plans and finds that 50 are borrowing from them.

a. Set up the null and the alternative hypotheses to test the economist’s concern

b. Compute the value of the test statistic.

c. Use the p-value approach to test if the economist’s concern is justifiable at α= .05

Client 4:

1. A movie production company is releasing a movie with the hopes that people will come a

second time. Their target is to have 30 million viewers and they want more than 30% of the

viewers to return to see the movie again. They show this to 200 people, 68 of which said they

will watch again.

a. At 5% level of significance, test if more than 30% of the viewers will return.

b. Interpret your results.

Client 5:

1. Import the Franchises file into SPSS

2. Sort the dataset by Ascending order on Sales

3. I want some basic summary statistics. Also, check for normality.

4.

a. Select the sales and sqft variables from the table that you imported into SPSS

b. Now Select all the sales information whose ages were greater than 40. What do you notice?

c. Find the probability (using z scores) all the franchises where advertising spent was more

than $8,200. Do it again with the sales were greater than $200,000. Do you think it was

worth that money?

d. Rename SQFT to “Square Feet”

e. Make a new variable where the owners ages are “very young” if it is between 20-30,

“young” if 31-40 and “old” is 41-55

f. Create a scatterplot matrix grouped by the Franchises ages.

5. At the end, interpret your findings.

FRANCHISE NUMBERSALES SQFT

INVENTORY ADVERTISING FAMILIES STORES OWNER AGE OF FRANCHISE

1

231

3,00

294

8,20

8,20

11

20

2

156

2,20

232

6,90

4,10

12

50

3

10

0,50

149

3,00

4,30

15

35

4

519

5,50

600

12,00

16,10

1

44

5

437

4,40

567

10,60

14,10

5

25

6

487

4,80

571

11,80

12,70

4

35

7

299

3,10

512

8,10

10,10

10

55

8

195

2,50

347

7,70

8,40

12

35

9

20

1,20

212

3,30

2,10

15

43

10

68

0,60

102

4,90

4,70

8

46

11

570

5,40

788

17,40

12,30

1

35

12

428

4,20

577

10,50

14,00

7

33

13

464

4,70

535

11,30

15,00

3

33

14

15

0,60

163

2,50

2,50

14

53

15

65

1,20

168

4,70

3,30

11

25

16

98

1,60

151

4,60

2,70

10

45

17

398

4,30

342

5,50

16,00

4

46

18

161

2,60

196

7,20

6,30

13

34

19

397

3,80

453

10,40

13,90

7

35

20

497

5,30

518

11,50

16,30

1

53

21

528

5,60

615

12,30

16,00

0

45

22

99

0,80

278

2,80

6,50

14

33

23

0,5

1,10

142

3,10

1,60

12

24

24

347

3,60

461

9,60

11,30

6

46

25

341

3,50

382

9,80

11,50

5

64

26

507

5,10

590

12,00

15,70

0

34

27

400

8,60

517

7,00

12,00

8

36

The data are for each franchise store.

SALES = annual net sales/$1000

SQFT = number sq. ft./1000

INVENTORY = inventory/$1000

ADVERTISING = amount spent on advertizing/$1000

FAMILIES = size of sales district/1000 families

STORES = number of competing stores in distric

OWNER AGE OF FRANCHISE

STATISTICAL MEASUREMENTS,

ANALYSIS AND RESEARCH

Instructor: Amreeta Choudhury

Lecture 4

M2.4: Hypothesis Testing – One mean and Two mean test

Section Objectives

1. Test on one mean and Test on two means

2. Tests on proportions and variances

3. Use in Marketing

Chapter 6

Sampling and inference

1)

2)

3)

4)

5)

3

Exploit the probabilistic nature of sampling to show how

statements on the population parameters can be based on

sample estimates

Consider the degree of uncertainty (level of confidence) in such

an operation

Build a confidence interval, which is a range of values around

the sample mean which is expected to include the true

population mean at a given probability (confidence) level

Compute the probability associated with a given statement on

the population parameters (or parameters from different

population)

Decide whether the statement is false depending on its

probability level (hypothesis testing)

Chapter 6

Direct and indirect problems

• Direct problem – If we knew the population mean and the

standard error then we would know the exact probability of any

sample mean

• Indirect problem –

• Confidence interval: Given the sample mean, we can exploit the

normal probability curve to find a range of value which will

contain the true population mean at a given confidence level

• Hypothesis testing: Given the sample mean, we can exploit the

normal probability curve to check the probability of an hypothesis

on the true mean – then we can decide whether to discard or

retain that hypothesis

4

Chapter 6

The normal distribution of the sample means

• Once more the normal distribution…

• The central point is the

true population mean and

is the most likely sample

mean

• The larger the standard

error the flatter the curve

95% of

probability

2.5% of

probability

2.5% of

probability

−

5

+

• 95% of all possible

sample means fall within a

range of about two

standard errors from the

mean (1.96 to be precise)

Chapter 6

Indirect problem

• We have only one sample mean (x-bar)

• 95% of sample means fall within the range

[ − 1.96 ; + 1.96 ]

• If 100% of the sample means were in that range we could

state with certainty that the true mean falls in the range

[ x − 1.96 ; x + 1.96 ]

• However, we can affirm that only for 95% of the sample

means, thus we refer to a 95% confidence level

6

Chapter 6

Confidence level

95% of

probability

x − 1.96

x + 1.96

2.5% of

probability

2.5% of

probability

−

+

HOWEVER, ONLY 95% OF THE SAMPLE MEANS FALL IN THIS RANGE – THUS WE CAN

STATE THAT THE TRUE POPULATION MEAN IS INCLUDED IN THE INTERVAL BETWEEN

AND

. WITH A 95% CONFIDENCE LEVEL

x + 1.96

x − 1.96

If the single sample mean we extract falls in this range, then the true population mean is also included in the

interval between

and

. In fact, even if we get one of the extremes, it will still be at a

distance of 1.96 from

Chapter 6

Confidence levels and critical values

• The critical value 1.96 corresponds to a probability of 95%, but it is

possible to know exact critical values for any confidence level

• For example, if we want a 99% confidence level, the critical value

based on the normal curve is 2.58

• Most packages including Microsoft Excel allow computation of critical

values

8

Chapter 6

A further complication

• The standard error of the mean is unknown (sample

estimate)

• This adds some further uncertainty on the top of the

sampling error

• Hence, we use an approximation of the normal

distribution which is more conservative, is flatter and

assigns higher probabilities to the tails (extreme values)

compared to the normal distribution

• This distribution is the so-called Student-t distribution and

its critical values are different from those of the normal

distribution

9

Chapter 6

The Student-t distribution

0.4

Normal distribution

t(20)

Dotted lines show the

Student t distribution with

different degrees of

freedom (1, 5 and 20)

t(5)

0.35

0.3

t(1)

The bold line represents

the standard normal

distribution (with mean zero

and standard deviation

equal to one).

0.25

0.2

0.15

The degrees of freedom

are equal to the sample

size minus one.

0.1

0.05

0

-4

10

-3

-2

-1

0

1

2

3

4

Chapter 6

Critical values and sample size

Level of

confidence

99%

95%

90%

11

Student t values

Normal

value

t according to sample

size

z

10

20

30

40

3.17

2.23

1.81

2.85

2.09

1.72

2.75

2.04

1.70

2.70

2.02

1.68

2.58

1.96

1.64

Chapter 6

How to build a confidence interval from a sample

1. Compute the sample mean x-bar and standard

deviation s

2. Estimate the standard error of the mean sx

3. Choose a confidence level a

4. Choose the appropriate coefficient for critical values

(see previous slide), using the Student t approximation

instead of the Normal (z) value if the sample size is

below fifty

5. Compute the lower and upper confidence limits as:

x − za / 2 sx ; x + za / 2 sx

x − ta / 2 sx ; x + ta / 2 sx

12

for the Normal distribution or

for the Student t approximation

Chapter 6

SPSS confidence intervals

Click here

13

Chapter 6

Confidence interval

Descriptives

In a typical week how

much do you spend

on fresh or frozen

chicken (Euro)?

Mean

95% Confidence

Interval for Mean

5% Trimmed Mean

Median

Variance

Std. Deviation

Minimum

Maximum

Range

Interquartile Range

Skewness

Kurtosis

14

Lower Bound

Upper Bound

Statistic

5.6677

5.2817

6.0537

5.2958

5.0000

17.089

4.13383

.00

30.00

30.00

4.50

2.084

8.005

Std. Error

.19640

Boundaries of

the c.i.

.116

.231

Chapter 6

Hypothesis testing (HT)

• HT is a form of inference

• HT is a statistical tool to decide whether to reject or not a statement

about the target population on the basis of statistics computed on

sample

• This is only possible if the sampling distribution is known!

15

Example (Trust data-set)

• The sample mean expenditure for chicken is £ 5.67

• Considering only the sub-sample of those belonging to consumer

organizations the mean is £ 5.04

• May we safely conclude that those who belong to consumer

organizations spend less?

• This depends on the precision of the estimates.

• the upper limit of the 99% confidence interval of the sub-sample of

respondents associated to consumer organizations is 6.84

• the upper limit of the confidence interval for the overall sample is 6.18

• There is a chance that those who belong to consumer organization actually

spend more than other people

• Statistical tests based on the sample help in deciding whether the

hypothesis should be rejected; for example, that there is no

difference between respondents who belong to a consumer

organization and those who don’t.

16

Chapter 6

Hypothesis testing

• The difference between the two means follows a known statistical

distribution

• If the hypothesis of mean equality is true, the difference between the

two means should be zero

• The actual difference is it is £ 0.63 (£ 5.67 minus £ 5.04), but this

difference may be generated by sampling error

• When no difference exists at the population level, what is the

probability that a sample with a difference of £ 0.63 is extracted?

• If the probability is very high (say 90%) then it is wise not to reject the hypothesis

to equality

• Instead, a very low probability (e.g. 0.001%) means that it is very

unlikely that the difference is due sampling error, so one should

choose to reject the null hypothesis and conclude that belonging to a

consumer organization actually makes a difference on chicken

expenditure.

17

Chapter 6

The hypotheses

• The initial hypothesis is called the null hypothesis,

denoted by H0

• Contextually, the researcher sets an alternative

hypothesis (H1) which is complementary to H0 and

remains valid if H0 is rejected.

• Two-tailed tests are those where the alternative

hypothesis can go in either direction

• When the alternative hypothesis is formulated in a

unique direction (for example >6), the test is onetailed

18

Chapter 6

Chapter 6

Significance and confidence

• The threshold probability level below which the null

hypothesis is rejected is the significance level arbitrarily set by

the researcher (usually at the 5% or 1% level).

• It is denoted by a and its complementary 1-a is the

confidence level of a test

• The smaller the significance level the smaller the rejection

region, (which is the set of values that leads to rejection of the

hypothesis) and the larger is the acceptance region, (which is

the set of values that lead to non-rejection of the hypothesis)

19

Errors confidence and power

Chapter 6

The statistical power of a test is the probability of correctly

rejecting the null hypothesis when it is false and it is equal to

1-b. It can be estimated on sample data and depends on

• sample size

• significance level a

• effect size (a measure of “how wrong” is the null hypothesis)

When the null hypothesis is not rejected and power is above

80% then the conclusion is usually regarded as robust.

Reject H0

Non-reject H0

H0 is true

Type I Error

prob. =significance level (a)

Correct

prob. = confidence level (1-a)

H0 is false, H1 is true

Correct

prob. = power level (1-b)

Type II Error

prob. = b

20

Chapter 6

Hypothesis testing

1. Formulate the null hypothesis (H0) and the alternative hypothesis (H1)

2. Determine the distribution of the sample test statistic under H0

3. Choose a significance level a (i.e. a confidence level 1-a)

4. Compute the sample test statistic and its probability level (p-value)

5. When p-value 1.15.

• Critical values are obtained like for confidence intervals:

-za/2 defines the left rejection region (negative values < 2.5% probability)
+za/2 defines the right rejection region (positive values < 2.5% probability)
• For a 5% significance level (or a 95% confidence level):
–z0.025=-1.96 and +z0.025=+1.96
25
Chapter 6
Chapter 6
Acceptance and rejection areas
The test statistic
lies in the rejection
area
26
Chapter 6
Hypothesis testing in SPSS
Test value
here
27
Chapter 6
SPSS output
One-Sample Test
Test Value = 1.15
t
In a typical week how
much fresh or frozen
chicken do you buy
for your household
consumption (Kg.)?
2.183
df
91
Sig. (2-tailed)
Mean
Difference
.032
.60152
95% Confidence
Interval of the
Difference
Lower
Upper
.0541
1.1490
p value
The null hypothesis is rejected (as the p-value is smaller than 0.05)
• We reject the null hypothesis that the average
weekly consumption is Kg. 1.15
28
Chapter 6
One sided hypothesis
(one tailed test)
• We want to test whether average consumer evaluation of animal welfare is larger than 4.9 (on a
7-point scale)
• It is convenient to formulate the hypothesis as follows:
H 0 : 4.9
H1 : 4.9
• This is an one tailed test, as the alternative hypothesis is expressed directionally: the rejection
area lies on the right of the critical value (all values on the left are consistent with the null
hypothesis)
Sample mean: 5.01
5.01 − 4.90
Standard deviation: 1.65
z=
= 1.49
0.074
Standard error of the mean: 0.074
• instead of two critical values with a/2=0.025 as in the two-tailed test, we only require a single
critical value for a=0.05 (which corresponds to the a=0.10 two-tailed critical values), which is
1.64
29
Chapter 6
One-tailed test
The test statistic
lies in the
acceptance area
30
Chapter 6
One mean one-tailed test in SPSS
• Exactly like two-tailed tests, but when interpreting the output:
- One should only consider values larger than the positive critical value for rejection (or smaller
of the negative critical value if the null direction is >)

– To get the correct critical value one should consider the a one instead of a/2 (for example, z0.05

rather than z0.25)

– Thus, the critical value for a 5% significance level in a one-tailed test corresponds to the critical

value for a 10% two-tailed test. For example z0.05=1.64

– Similarly, when looking at the two-tailed test p-value in SPSS, one should consider a “double”

threshold, i.e. reject the null at the 95% level when p>0.10 (since SPSS always assumes twotailed tests)

31

Chapter 6

SPSS output and one-sided test

One-Sample Test

Test Value = 4.9

Animal welfare

t

1.545

df

496

Sig. (2-tailed)

.123

Mean

Difference

.114

95% Confidence

Interval of the

Difference

Lower

Upper

-.03

.26

• The null hypothesis is not rejected at the 5% significance level

because Sig>0.10

• Note that differently from two two-tailed test here the

threshold is twice the chosen significance level.

32

Chapter 6

Test on two means

• Tests of equality on two means follow directly from the singlemean test

• The difference of two normally distributed sample means is still a

normally distributed, provided that the samples are unrelated or

paired

• The mean of the difference distribution is zero under the null

hypothesis of mean equality

33

Unrelated samples

• The sampled units belong to different populations and

are randomly extracted from each of the population. The

key condition is that the sampled units are randomly

assigned to the two groups

• This excludes the case where:

a) a single sample is drawn

b) the units are subdivided into two groups according to some

variable (gender, living in urban versus rural areas, etc.)

c) the sampling process might have some selection bias creating

dependency between the two groups

• Most social studies consider the samples to be unrelated

if the units are randomly extracted and the groups are

mutually exclusive.

34

Chapter 6

Chapter 6

Related and paired samples

• In related samples he same subjects may belong to both groups.

• For example, if the same individual is interviewed in two waves, the

two samples are said to be related.

• Two sub-sets from the same sample are generally related (not for

stratified sampling)

• Paired samples are a special case where exactly the same units

appear in both samples

• In this case it is possible to compute the difference for each of the

sampled units and the result corresponds to a single sample

• Matched samples are artificially paired samples, where the two

samples are matched according to some characteristics.

35

Chapter 6

Example (Trust data-set)

• 71% of respondents are female

• the targeted population are people in charge of food purchases;

males and females in the Trust data-set are associated by the fact

that they are responsible for food purchases

• This excludes those females and males who are not; any gender

comparison is conditional on this external factor

• We could not be conclusive in testing – for example – whether

males like chicken more than females

36

Chapter 6

Test for unrelated samples

• Example (Trust data-set)

• Italian versus UK respondents (extracted independently)

• Does the attitude towards chicken (question q9, “In my household we like

chicken”) differ between the two countries?

H0: UK = ITA vs.

37

H1: UK ≠ ITA

Chapter 6

Unrelated samples

• The two means are normally distributed

• Under the null hypothesis their difference is also normally distributed

• Consider the difference variable D = UK – ITA

• The test becomes identical to the one mean test for D = 0

• However, a measure of the standard error for D is necessary

38

Chapter 6

Standard error for

mean comparison testing

• In the (unlikely) event that the true standard errors are known the

joint standard error is:

− =

1

2

12

n1

+

22

n2

• Everything proceeds as for the one mean test, thus the test statistic

is:

t=

x1 − x2

−

1

39

2

Test statistics (unknown standard errors)

Chapter 6

• With unknown but equal standard errors, the test statistics is

t=

x1 − x2

1

1

sx

+

n1 n2

• Given that the standard error is estimated, additional uncertainty requires

the use of the t distribution with

n1+ n2-2 degrees of freedom

• With different standard errors the test statistic is

z=

x1 − x2

sx21

+

sx22

n1

n2

• This statistic can only be applied to large samples and the standard normal

distribution is the reference

40

Chapter 6

How to decide whether the standard errors are equal

or different?

• There are appropriate hypothesis tests for the equality of two variances

(discussed later)

• SPSS shows the p-value for the Levene’s test (Brown and Forsythe, 1974)

• SPSS provides the outcomes of both test, with and without assuming equality of

standard errors.

• In most cases these two tests provide consistent outcomes.

41

Chapter 6

Mean comparison with

unrelated samples

• The mean for the 100 UK respondents is 6.12 (standard error 0.15)

• the mean for the 100 Italian respondents is 5.62 (standard error 0.11)

• Is a mean difference of 0.5 significantly different from 0?

• Are the standard error equal?

42

Chapter 6

SPSS example

Target variable

here

Sub-groups defined here

through a grouping variable

43

Chapter 6

SPSS output

The

null hypothesis of equality of variance (Levene’s test) is not

CONCLUSION:

rejected

thea5%

s.l. (as p-value

is larger thandifference

0.05), thus the two

Thereatis

statistically

significant

standard errors could be regarded as equal

between the UK and Italy in terms of attitudes

towards chicken (as measured by q9)

Independent Samples Test

Levene’s Test for

Equality of Variances

F

In my household

we like chicken

Equal variances

assumed

Equal variances

not assumed

Sig.

.243

.622

t-test for Equality of Means

t

df

Sig. (2-tailed)

Mean

Difference

Std. Error

Difference

2.682

198

.008

.500

.186

.132

.868

2.682

183.426

.008

.500

.186

.132

.868

At any rate, the null hypothesis is rejected in both cases

(as the p-value is smaller than 0.05)

44

95% Confidence

Interval of the

Difference

Lower

Upper

Chapter 6

Paired samples

• As a second case study, consider the situation where two measures

are taken on the same respondents.

• For example, all respondents were asked a second question on

their general attitude towards chicken, “A good diet should always

include chicken” (q10)

• Do the two questions measure the same item (general attitude

towards chicken)?

• Can we assume that the results are – on average – equal?

• In this case the samples are paired and it is possible to compute a

difference between the response to q9 and q10 for each of the

sampled household.

• Everything goes back to one mean test discussed earlier

45

Chapter 6

Paired samples

• One may compute a third variable for each of the respondent as the difference

between q9 and q10, then compute the mean and the standard error for this

variable

• SPSS does this automatically

– mean of 5.73 for q9 versus a mean of 5.50 for q10

– average difference 0.23

– estimated standard error 0.06.

– The t test statistic is 3.84, largely above the two-tailed 99% critical value,

• the null hypothesis of mean equality should be rejected.

• It is not safe to assume that the two questions are measuring the same construct

46

Chapter 6

Paired samples

Select two variables from the

same data-set

47

Chapter 6

Output

Paired Samples Test

Paired Differences

Mean

Pair

1

•

In my household we like

chicken – A good diet

should include chicken

.231

Std. Deviation

Std. Error

Mean

1.348

.060

95% Confidence

Interval of the

Difference

Lower

Upper

.112

.350

t

3.824

df

Sig. (2-tailed)

497

Note how mean comparison tests can be used in the post-editing phase to

check consistency (see lecture 4):

1) Try again with q9 and q12e, the two questions are targeted to measure

the same construct with slightly different wording

2) If the null hypothesis is not rejected, one can compute the difference

between q9 and q12 and look for outliers

3) Cases with outliers show an inconsistency

48

.000

Chapter 6

Other type of tests

• Independent samples

• Standard t-test (as seen)

• Paired samples

– It becomes a one-sample t-test

• Proportion test

• Related samples

• Non-parametric tests

49

Chapter 9

Jaggia

Hypothesis test for population proportion

• The population proportion is useful for descriptive data that we want

proportions of.

• For normality, we use the rule: np>=5 and np(1-p) >=5

• Our test statistic: Z =

𝑃ℎ𝑎𝑡 −𝑝

𝑝(1−𝑝)/𝑛

• The hypothesis test works the same way for proportions

Business Statistics

Communicating with

Numbers Jaggia

50

Chapter 9

Jaggia

Example

• A popular weekly magazine asserts that fewer than 40% of

households have changed their lifestyles due to gas prices. A survey

of 180 households find that 67 households have made lifestyle

changes.

• Specify and conduct a hypothesis test to test the magazine’s claim. Do

this for a 10% level of significance.

• Z=

𝑃ℎ𝑎𝑡 −𝑝

𝑝(1−𝑝)/𝑛

Business Statistics

Communicating with

Numbers Jaggia

51

Chapter 9

Jaggia

Example

• A popular weekly magazine asserts that fewer than 40% of

households have changed their lifestyles due to gas prices. A survey

of 180 households find that 67 households have made lifestyle

changes.

• Step 1:

• Ho : p >= .40

• Ha : p < .40
Business Statistics
Communicating with
Numbers Jaggia
52
Chapter 9
Jaggia
Example
• A popular weekly magazine asserts that fewer than 40% of households
have changed their lifestyles due to gas prices. A survey of 180 households
find that 67 households have made lifestyle changes.
• Step 2/3:
67
• The significance level is 10%. Phat =
= .3722
𝑃ℎ𝑎𝑡 −𝑝
.3722 −.4180
• Test statistic: Z =
=
= -.76
𝑝(1−𝑝)/𝑛
.4 1−.4
−
18
• If we do P(Z