07 testing of hypothesis t and f anova

Upload: teesmaar-khan

Post on 05-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    1/29

    Testing of Hypothesis

    Definition:

    Testing of hypothesis is a procedure which enable us to decide whether to

    accept or reject a particular statement or assumption about the population

    parameter (s) on the basis of information obtained from sample data.

    Types of Hypotheses:

    1. Null Hypothesis

    2. Alternative Hypothesis

    3. Simple Hypothesis

    4. Composite Hypothesis

    Hypothesis: Hypothesis is astatement or assumption

    about the population

    parameter under theassumption that it is true.

    -

    -

    -

    -

    -

    -

    -

    12/19/2011 1Dr. Atta ur Rahman

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    2/29

    Dr. Atta ur Rahman 2

    Types of Hypotheses

    Null Hypothesis and Alternative Hypotheses

    A hypothesis which is to be tested for possible rejection under the assumption

    that is true is called, null hypothesis. On the other hand, if the null

    hypothesis is rejected we consider another hypothesis which is called

    alternative hypothesis. The null and alternative hypotheses are denoted

    by H0 and H1 respectively. For example:

    H0: There is no significant difference between the sale/production of

    company A and B (1-2 = 0)

    H1:There exist a significant difference between the sale/production of

    company A and B (1-2 0)

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    3/29

    Dr. Atta ur Rahman 3

    Mean Comparison: Testing of

    HypothesisMean comparison of two different populations (i.e. two different companies

    in terms of sale/production/saving/profit etc) can be done by using:

    1. Two sample t-test (t-test for independent samples)

    2. Paired t-test (t-test for dependent samples)

    For example:

    Comparison of mean production of two different companies. In this case both

    the samples taken from company A and company B will be independent.

    Comparison of daily mean production of company A in year-1 and year-2.

    OR: Comparison of daily mean production of company A before and

    after using new technology.

    OR: Mean comparison before and after taking loan (credit).

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    4/29

    Dr. Atta ur Rahman 4

    Mean Comparison: Testing of

    HypothesisSome Basic Definitions:

    1. Significance level

    2. Test statistic

    3. Critical region and critical values

    4. One tailed and two-tailed tests

    5. Type-I and Type-II errors

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    5/29

    Dr. Atta ur Rahman 5

    Steps Involved in Testing of Hypothesis State/formulate the null and alternative hypotheses

    Choose the level of significance, generally, 1%, 5% and 10% levels of

    significance are used in literature

    Choose the test statistic to be used i.e. Z-test, t-test, F-test etc.

    Compute the value of test statistic from the sample data and available

    information given under the null hypothesis, the value so obtain is called

    calculatedvalue.

    Define the critical value of the test statistic, called tabulated value; OR calculate

    the P-value of the test statistic

    Compare the calculated and tabulated values of the test statistic. Reject the null

    hypothesis if calculated value of the test statistic is greater than the tabulated

    value

    Make the decision and conclude the results.

    Main Steps in Testing of Hypotheses

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    6/29

    Dr. Atta ur Rahman 6

    Steps Involved in Testing of Hypothesis

    COMPARISON OF TWO MEANS

    The t-test for independent samples

    Populations variances are identical

    Population variances are not identical

    Paired t-test (dependent samples)

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    7/29

    Dr. Atta ur Rahman 7

    The t-test for Independent Samples (populations have

    identical variances)

    In order to test the hypothesis that there is no significant difference between

    the means of two populations, the following test statistic is applied:

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    8/29

    Dr. Atta ur Rahman 8

    Independent Samples (populations variances are unequal )

    In order to test the hypothesis that there is no significant difference betweenthe means of two populations, the following test statistic is applied:

    2 2 2

    1 1 2 2

    2 2 2 2

    1 1 2 2

    1 2

    2 2

    1 2

    [( / ) ( / )]

    ( / ) ( / )1 1

    , and are the variances of

    sample-1 and sample-2 respectively.

    s n s n

    s n s n

    n n

    where s s

    Which under the null hypothesis has t-

    distribution with degrees of freedom,where:

    1 2

    2 2

    1 2

    1 2

    X Xt

    s s

    n n

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    9/29

    Dr. Atta ur Rahman 9

    The t-test for dependent samples (Paired t-test)

    0 1 2 0

    1 1 2 1

    The following hypothesis is considred

    H : 0 or H : 0 VS

    H : 0 or H : 0

    To test the above hypothesis, the following t-test is used:

    , which follow a t-distribution with (n-/

    d

    d

    d

    d

    d

    t s n

    2

    1) degrees of freedom

    where, is the mean of " " values and

    OR ; is the standard

    deviation of all " " values and is computed as:

    ( )

    1

    B A A B d

    d

    dd d

    n

    d X X d X X s

    d

    d ds

    n

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    10/29

    Dr. Atta ur Rahman 10

    Company-A 12 13 14 13.5 10 11 12.5 13.8 15 11.6 15 16

    Company-B 13 14 11 10 9 8 9.4 11.5 8 7 9 8.5

    Example 1: Data showing the Monthly Profit in (0000) of Rs of two companies

    Reject the null hypothesis of equal means and conclude the average profit

    of both the companies differ significantly.

    0 1 2

    1 1 2

    H : 0 (On the average, the monthly profit of both the companies is same)

    VS

    H : 0 (On the average, the monthly profit of both the companies is not same)

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    11/29

    Dr. Atta ur Rahman 11

    Some Questions Regarding Example 1:

    1. Write the hypothesis (both null and alternative) that there is no significant

    difference between average profit of two companies.

    2. Write about the significance of test and what does it indicate, decide on

    the basis of P-value?

    3. Which test is applied and why?

    4. Interpret the result of Levenes F-test and what will be your hypothesis in

    this case

    5. Write 95% confidence interval for the difference between means (profit)

    of the two companies.

    6. Why the value of t-statistic for equal variances is considered?

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    12/29

    Dr. Atta ur Rahman 12

    Company-A Company-B

    Profit Production Sale Profit Production Sale

    12 120 110 13 112 100

    13 140 132 14 132 122

    14 150 145 11 145 13213.5 140 123 10 120 100

    10 103 90 9 100 70

    11 115 100 8 90 80

    12.5 123 122 9.4 95 70

    13.8 140 135 11.5 115 100

    15 160 145 8 90 70

    11.6 120 115 7 75 72

    15 162 150 9 95 90

    16 165 145 8.5 90 88

    Example 2: Monthly Profit, Production and Sales of Company-A and B during

    one year (12 months data)

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    13/29

    Dr. Atta ur Rahman 13

    SPSS out put

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    14/29

    Dr. Atta ur Rahman 14

    Variable

    Company-A Company-B

    t-ratio P-value

    Mean SE Mean SE

    Profit 13.12 0.514 9.87 0.613 4.060** 0.001

    Production 136.5 5.868 104.92 5.841 3.815** 0.001

    Sale 126 5.607 91.17 5.967 4.254** 0.000

    SE = Standard Error of Mean; ** indicates significant at 1% level of probability

    Results Presentation

    Table 1: Average comparison of Company-A and B for the year-XXXXX

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    15/29

    Dr. Atta ur Rahman 15

    0

    20

    40

    60

    80

    100

    120

    140

    160

    Profit Production Sale

    Meanv

    alue

    Company A Company B

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    16/29

    Dr. Atta ur Rahman 16

    Example 3: Monthly Profit, Production and Sales of Company-A before and after

    adopting a new technology (12 months data)

    Before New technology After new technology

    Profit Production Sale Profit Production Sale

    12 120 110 17 125 115

    13 140 132 20 145 140

    14 150 145 18 179 160

    13.5 140 123 16 158 150

    10 103 90 12 110 105

    11 115 100 14 134 125

    12.5 123 122 13 135 124

    13.8 140 135 15 150 145

    15 160 145 17 170 160

    11.6 120 115 13 145 142

    15 162 150 17 170 165

    16 165 145 20 170 163

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    17/29

    Dr. Atta ur Rahman 1712/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    18/29

    Dr. Atta ur Rahman 18

    Some Questions Regarding Example 3:

    1. Write the null and alternative hypotheses for such a problem.

    2. Which test is applied for comparison and why?

    3. Write 95% confidence interval for the difference between means (profit,

    production and sale).

    4. Is there any impact on the profit, sale and production of adopting the new

    technology, how, discuss it.

    5. What does the p-value (sig.) indicate and how you will utilize this value in

    results interpretation.

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    19/29

    Dr. Atta ur Rahman 19

    Results Presentation

    Variable

    Before New Tech. After New Tech.

    t-ratio P-value

    Mean SE Mean SE

    Profit 13.12 0.514 16 0.769 -5.436** 0.000

    Production 136.50 5.868 149.25 6.064 -5.413** 0.000

    Sale 126.00 5.607 141.17 5.771 -6.407** 0.000

    SE = Standard Error of Mean; ** indicates significant at 1% level of probability

    Average comparison of different items of the company before and after

    adopting a new technology

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    20/29

    Dr. Atta ur Rahman 20

    0

    20

    40

    60

    80

    100

    120

    140

    160

    Profit Production Sale

    Meanvalue

    Company A Company B

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    21/29

    Dr. Atta ur Rahman 21

    Steps Involved in Testing of HypothesisCOMPARISON OF MORE THAN TWO

    MEANS

    Analysis of Variance (ANOVA) technique

    One-way ANOVA

    Two-way ANOVA

    Multi-way ANOVA

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    22/29

    Dr. Atta ur Rahman 22

    ONE-WAY ANOVA (Analysis of Variance):

    In case of One-way ANOVA, the data is classified according to one criteria, e.g.

    profit, sales, production of more than two companies; different marketing policies

    adopted by the same company etc. It (ANOVA) partition the total variation into

    different components (between groups and within groups) of variation. i.e.

    SS Total = Between SS + Within SS OR

    SS Total = SS Treatments + SS ErrorSS Total = SSTr + SSE

    ANOVA TABLE

    SOV df SS MS F-ratio

    Between groups (t-1) Bet. SS (Bet. SS)/(t-1) = MSB MSB/MSE

    With in groups t(r-1) SS Error (SS Error)/t(r-1) = MSE

    Total (tr-1) SS Total (SS Total)

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    23/29

    Dr. Atta ur Rahman 23

    Company-A 40 38 35 42 44 37

    Company-B 20 22 18 23 25 24

    Company-C 45 46 50 48 54 56

    Example 4: Profit (0000) of three different companies for every two months of

    a particular year. Analyze the data and draw your conclusions.

    Which test you will apply and why?

    Is it possible to apply t-test, if Yes/No, why, explain.

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    24/29

    Dr. Atta ur Rahman 24

    One-Way ANOVA Results: SPSS Out Put

    Maximum profit = Company C

    Minimum Profit = Company B

    The P-value in the ANOVA

    Table shows that the profits

    of three companies are

    significantly different.

    Maximum

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    25/29

    Dr. Atta ur Rahman 25

    Pair-wise comparison (application of two samples t-test)

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    26/29

    Dr. Atta ur Rahman 26

    Pair-wise comparison -continued

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    27/29

    Dr. Atta ur Rahman 27

    Example: Profit (0000) of three different companies for every two months of a

    particular year

    Company-A 12 10 9 15 8 12

    Company-B 14 17 16 11 14 12

    Company-C 18 19 17 14 12 19

    Company-D 20 22 15 13 11 16

    Compare the average profit of these companies at 5% level of significance and test the

    hypothesis that, is there any significant difference among the profits of these companies?

    Also apply LSD (least significant difference) test and separate the mean profits which

    are significantly different from one another.

    Compare means

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    28/29

    Dr. Atta ur Rahman 28

    Significant (P < 0.05)

    12/19/2011

  • 8/2/2019 07 Testing of Hypothesis t and F ANOVA

    29/29

    Dr. Atta ur Rahman 29

    TWO-WAY ANOVA (Analysis of Variance):

    In two-way ANOVA, the data is classified according to two criteria (describing

    one at rows and other at columns) e.g. sales of a particular commodity ofdifferent companies at various cities of the country; different marketing policies

    adopted by a group of companies; etc. In this case

    SS Total = Row SS + Column SS + Error SS

    Or SS Total = SSR + SSC + SSE

    Company

    Marketing Policy

    I II III IV

    Company-A 40 38 35 42

    Company-B 60 55 50 47

    Company-C 45 46 43 48

    Example: Sale of three different companies by adopting four different marketing policies.

    12/19/2011