**TWO-WAY ANOVA**

A two-way ANOVA is used when there is the presence of an additional variable affecting the relationship between the independent and dependent variable. The additional variable, so comes into view is treated as second independent variable. Two-way ANOVA investigates the sources of variations arising in the mean values of dependent variable due to the fixed factors. A “factor” is another name for an independent variable. The fixed factors are two independent variables influencing the dependent variable. Thus, a two way ANOVA uses two null hypotheses for two independent variables with ‘all means equal’.

**CASE ANALYSIS-1 **

**PROBLEM**

An experiment is carried out to test whether three different types of drug A, B, C have different effects on males and females. A sample of 15 male and 15 female respondents (30 respondents) were selected and the cure percentage after using the drugs was recorded as follows.

**Table-1:** Sample Data

The purpose is to test whether the lifetimes of four brands of electric bulbs are equal or not.

The hypotheses for the analysis are:

Null hypothesis-

H_{01}: The average percentage cured is same for all the drugs.

H_{02}: The gender has no effect on percentage cured.

Alternative Hypothesis-

H_{11}: The average percentage cured of at least two drugs differs.

H_{12}: The gender has effect on percentage cured.

**Input Data**

The variable ‘percentages cured’ is dependent variable and the variable ‘drug’ is independent variable. The third variable is ‘gender and it influences the relationship between the independent and the dependent variables. The first fixed factor is the independent variable ‘drug’ and the second fixed factor is ‘gender’. The codes used for the variables are: 1 = Male, 2 = Female; 1 = Drug A, 2 = Drug B, 3 = Drug C. The following table shows the dependent variable along with the coded variables for fixed factors and the table is used as the input matrix for the analysis.

**Table-1:** Input Output

**Performing the Analysis with SPSS**

For SPSS Version 11, click on **Analyze ⇒ ****General linear model ⇒ Univariate **

This will bring up the SPSS screen dialogue box as shown below.

After clicking **Univariate, **this will bring up the following SPSS screen dialogue box.

Select the dependent variable “cure” and click it to move to **Dependent variables** box. Select the first fixed factors ‘drug’, the second fixed factor ‘gender’ and move them to **Fixed Factor(s) Box.**

Then click **Model** followed by **Custom**. This will bring up the following dialogue box.

Select both the factors ‘drug’ and ‘gender’ and move them to the box called **Model.**

Then click **Continue** to return the main dialogue box and click OK of the main dialogue box to get the output.

**SPSS Output**

The SPSS outputs are illustrated in the following tables.

Table-3: Between-Subjects Factors

**Table-3:** Tests of Between-Subjects Effects

Dependent Variable: CURE

*a R Squared = .037 (Adjusted R Squared = -.074)*

**From the output, F = 0.021 (for Drug) and F = 0.965 (for Gender)**

**DECISION**

Reject the null hypothesis if p-value (Sig. value) ≤ 0.05

**INTERPRETATION**

The p-value corresponding to the hypothesis for drug is 0.979 and it is more than 0.05 (**5% level of significance**). Therefore we accept the null hypothesis and conclude that the drugs have same effect to be used as antidandruff drug. But the p-value for gender is 0.335 and it is less than 0.05. So we reject the null hypothesis and conclude that the percentage cured is affected by the factor gender.

**CASE ANALYSIS-2 **

** ****PROBLEM**

The problem relates to the popular television shows viewed by the people of Balasore town. A random sample of 20 rural and 20 urban people was selected from both urban and rural area of the town. The respondents were asked to rate the TV shows on 1-10 scale. (1= not liked at all and 10 = most liked show)

**Table-1:** Sample Data

The hypotheses for the analysis are:

Null hypothesis-

H_{01}: The mean rating of TV shows type is same for all four shows.

H_{02}: The area has no effect on mean ratings.

Alternative Hypothesis-

H_{11}: The mean rating of at least two TV shows differs.

H_{12}: The area has effect on mean rating.

**Input Data**

The variable ‘rating’ is dependent variable and the variable ‘TV show’ is independent variable. The fixed factors are ‘TV shows’ and ‘area’. The codes used for the variables are: 1 = Rural, 2 = Urban: 1 = Reality shows, 2 = Daily Serials, 3 = Comedy shows and 4 = News as shown in the following table and it is used as the input data matrix for the analysis.

**Table-1:** Input Data

**SPSS Outputs**

The SPSS outputs are given in the following tables.

**Table-2:** Between-Subjects Factors

**Table-3:** Tests of Between-Subjects Effects

Dependent Variable: Ratings

*a R Squared = .232 (Adjusted R Squared = .144)*

**From the output, F = 2.754 (for TV shows) and F = 2.289 (for Area)**

**DECISION**

Reject the null hypothesis if p-value (Sig. value) ≤ 0.05

**INTERPRETATION**

The p-value corresponding to the hypothesis for TV shows is 0.057 and it is more than 0.05 (**5% level of significance**). Therefore we accept the null hypothesis and conclude that all the TV shows have equal effect on viewers. Similarly the p-value for area is 0.139 and it is more than 0.05. So we accept the null hypothesis and conclude that the area has no effects on mean rating.

** ****SPSS Command**

- Click on ANALYZE at the SPSS menu bar (in older versions of SPSS, click on STATISTICS instead of ANALYZE).
- Click on GENERAL LINEAR MODEL followed by UNIVARIATE.
- Select the appropriate variable and move it to the DEPENDENT LIST. Select the first fixed factors and move them to FIXED FACTOR(S) BOX.
- Then click MODEL followed by CUSTOM.
- Move both the factors to the box called MODEL.
- Clicks CONTINUE to return the main dialogue box.
- Click OK to get the output for two-way ANOVA.