Coded Multiple Regression Analysis

 

ANOVA is a special case of regression analysis. Coded regression analysis is used to partition variance within the context of various experimental designs where the coded predictor variables index the membership of subjects in various conditions of the experiment.

Three coding methods are introduced in this lesson: orthogonal coding method, dummy coding method, and effect coding method.

Twelve subjects were randomly selected and assigned to one of the three groups: control group, sleep deprivation group, and food deprivation group. After receiving the treatment, all the subjects took a math test. The errors made in solving math problems were recorded.  

 

Control Group Sleep Deprivation Food Deprivation
1

2

3

4

7

8

9

10

4

5

6

7

 

Orthogonal Coding Method (Helmert's Contrasts)

The research is interested in making the following group comparisons.

Comparison 1: make a comparison between the deprivation groups and the control group.
Comparison 2: compare the two deprivation groups.  
 

 

 Comparison 1

Comparison 2

Control Group

 

Sleep Deprivation

Food Deprivation

Sleep Deprivation

Food Deprivation

 

Tests between sample means that are planned before collecting data are called a priori comparisons or planned comparisons. A priori comparisons are tested directly regardless of the statistical significance of the overall F test.  

  • Predictor Variables: Code Group Membership

There are three groups. Two coding vectors are needed. Using Helmert's contrasts, the experimental conditions can be coded as

 

The first coding vector, X1, compares the control group with the two deprivation groups taken together.

The second coding vector, X2, compares the sleep deprivation group with the food deprivation group.

 

 

  • The Criterion Variable

Combine the data values from three groups into one total group. The criterion variable is labeled as Y.

 

 

SPSS for Windows
 

1. Enter data and label the variables. The first two variables are the orthogonal coding vectors. They are the predictor variables representing group membership. The third variable is the criterion variable y.
 

 

2. Choose Analyze \ Regression \ Linear. 

3. Select y as the dependent variable. Select X1 and X2 as the independent variables. Method: Enter. 

4. Click OK.

 

SPSS Output

 

1. Overall Relationship

(1) Coefficient of Multiple Determination

The coefficient of multiple determination equals .828. About 83% of the variance in the dependent variable is accounted for by the experimental treatments. About 17% of the variance in the dependent variable is not explained by the experimental treatments.

(2) Test of Statistical Significance

There were significant differences in math performance among the three groups, F(2,9) = 21.60, p < .05. About 83% of the variance in the dependent variable was accounted for by the experimental treatments.

 

3. Examine the Individual Regression Coefficients

 

B weights

The B weights reflect the differences between the compared means.

Apply B1 to the first coded vector.

B1
(2) – B1(-1) = (-1.50)(2) - (-1.50)(-1) = -4.50

 

 

Mean

Comparison 1

Control Group

2.50

2.50

Sleep Deprivation

8.50

(8.50+5.50)/2 = 7.00

Food Deprivation

5.50

Mean Differences

 

-4.50


Test
B1  

The null hypothesis is that the regression coefficient associated with X1 is zero. The alternative hypothesis is that the regression coefficient associated with X1 is different from zero.

Recall that the b weights reflect the differences between the compared means. Thus, the null hypothesis shown above is equivalent to the hypothesis that the mean difference is zero. The alternative hypothesis shown above is equivalent to the hypothesis that the two means are not equal.

Report the result

There was a significant difference in the number of errors made between the control group and both deprivation groups, t = -5.69, p < .05.

Notice that when comparing two means, the F equals t2 (F(1, 9) = 32.4). 


Apply B2 to the second coded vector.

B2(
1) - B2(-1) = (1.50)(1) - (1.50)(-1) = 3.00

 

Mean

Comparison 2

Control Group

2.50

 

Sleep Deprivation

8.50

8.50

Food Deprivation

5.50

5.50

Mean Differences

 

3.00

 

Test B2

There was also a significant difference between the two deprivation groups, t = 3.286, p < .05.

   


   

Twelve subjects were randomly selected and assigned to one of the three groups: control group, sleep deprivation group, and food deprivation group. After receiving the treatment, all the subjects took a math test. The errors made in solving math problems were recorded.  

 

Sleep Deprivation Food Deprivation Control Group
7

8

9

10

4

5

6

7

1

2

3

4

 

Group Comparisons: Dummy Coding Method

The researcher is interested in the following comparisons. Look for mean differences between each deprivation group and the control group.  
 

 Comparison 1

Comparison 2

Sleep Deprivation  

 
 

Food Deprivation

Control

Control


Tests between sample means that are planned before collecting data are called a priori comparisons or planned comparisons. A priori comparisons are tested directly regardless of the statistical significance of the overall F test.  

  • Code the Group Membership

There are three groups. Two coding vectors are needed. Generate two dummy coding vectors.

Vector 1 consisted of 1`s for subjects in the sleep deprivation group, 0`s for all others. Vector 2 consisted of 1`s for subjects in the food deprivation group, 0`s for all others. Note that the control group is assigned zeroes throughout.

 

  • The Criterion Variable

Combine the data values from three groups into one total group.

 

 

SPSS for Windows

 

1. Enter data and label the variables.

 

 

2. Choose Analyze \ Regression \ Linear. 

3. Select y as the dependent variable. Select X1 and X2 as the independent variables.

4. Click OK.

 

SPSS Output

 

1. Overall Relationship

(1) Coefficient of Multiple Determination

The coefficient of multiple determination equals .828. About 83% of the variance in the dependent variable is accounted for by the experimental treatments. About 17% of the variance in the dependent variable is not accounted for by the experimental treatments.

(2) Test of Statistical Significance

 

There were significant differences in math performance among the three groups, F(2,9) = 21.60, p < .05. About 83% of the variance in the dependent variable was accounted for by the experimental treatments.

 

3. Examine the Individual Regression Coefficients

 

Regression Coefficients

The regression coefficients [6 3] are equal to the differences between the means of groups assigned 1 from the mean of the control group, assigned zeroes throughout.  
 

  

Comparison 1

Comparison 2

Sleep Deprivation

8.50

 

Food Deprivation

 

5.50

Control Group

2.50

2.50

Mean Difference

6

3

 

For example, the sleep deprivation group was assigned 1 in the first dummy-coding vector. The control group was assigned 0 throughout. Msleep - Mcontrol = 8.50 - 2.50 = 6.

The food deprivation group was assigned 1 in the second dummy coding vector. The control group was assigned 0 throughout. Mfood - Mcontrol = 5.50 - 2.50 = 3.


Planned comparisons are usually evaluated at an uncorrected significance level. Note that there are two planned comparisons being made. The number of the planned comparisons does not exceed the degrees of freedom associated with the treatment effects (There are three groups and the degrees of freedom are equal to 3-1=2). 
 

Test B1 

Testing the significance of B1 is the same as  testing the significance of the mean difference between the sleep deprivation group and the control group.  

The t value and the associated probability

It is concluded that there is a significant mean difference between the sleep deprivation group and the control group, t = 6.57, p < .05.

Test B2 

The t value and the associated probability

It is concluded that there is a significant mean difference between the food deprivation group and the control group, t = 3.286, p < .05.

   


 

Twelve subjects were randomly selected and assigned to one of the three groups: control group, sleep deprivation group, and food deprivation group. After receiving the treatment, all the subjects took a math test. The errors made in solving math problems were recorded.  

 

Sleep Deprivation Food Deprivation Control Group
7

8

9

10

4

5

6

7

1

2

3

4

 

Effect Coding Method


Effect of a Treatment

The effect of a treatment can be defined as the deviation of a treatment mean from the grand mean.  

 

  • Code the Group Membership

There are three groups. Two coding vectors are needed. Generate two effect vectors.

In each effect coding vector, subjects of one group are assigned 1`s; all other subjects are assigned 0`s except for subjects of the last group, who are assigned -1`s codes. 

 

  • The Criterion Variable

Combine the data values from three groups into one total group.

 

 

SPSS for Windows

 

1. Enter data and label the variables.
 

 

 

2. Choose Analyze \ Regression \ Linear. 

3. Select y as the dependent variable. Select X1 and X2 as the independent variables.

4. Click OK.

 

SPSS Output

 

1. Overall Relationship

(1) Coefficient of Multiple Determination

The coefficient of multiple determination equals .828. About 83% of the variance in the dependent variable is accounted for by the experimental treatments. About 17% of the variance in the dependent variable is not accounted for by the experimental treatments.

(2) Test of Statistical Significance

 

There were significant differences in math performance among the three groups, F(2,9) = 21.60, p < .001. About 83% of the variance in the dependent variable was accounted for by the experimental treatments.

 

3. Examine the Individual Regression Coefficients

 

Regression Coefficients

The regression coefficients [3 .00] are equal to the differences between the means of experimental groups from the grand mean.  
 

  

Comparison 1

Comparison 2

Sleep Deprivation

8.50

 

Food Deprivation

 

5.50

Control Group

 

 

Grand Mean

5.50

5.50

Mean Difference

3

.00

 

The sleep deprivation group was assigned 1 in the first effect-coding vector. The first regression coefficient (B1 = 3) is equal to the deviation of the mean of the sleep deprivation group from the grand mean (8.50 - 5.50 = 3).

The food deprivation group was assigned 1 in the second effect-coding vector. The second regression coefficient (B2= .00) is equal to the deviation of the mean of the food deprivation group from the grand mean (5.50 - 5.50 = .00).


Test B
1
 

Testing the significance of B1 is the same as  testing the significance of the mean difference between the sleep deprivation group and the control group.  

The t value and the associated probability

It is concluded that there is a significant mean difference between the sleep deprivation group and the grand mean, t = 5.69, p < .05.

Test B2 

The t value and the associated probability

It is concluded that there is no significant mean difference between the food deprivation group and the grand mean, t = .00, p > .05.

 

Conclusion

One may observe that both orthogonal and nonorthogonal solutions (dummy codes and effect codes) produce the identical coefficient of multiple determination. However, the associated multiple regression equations (regression coefficients and intercepts) are different.