We now turn our attention to the case where there is one within-subjects factor and one between-subjects factor. In this case, the regression approach allows us to deal with unbalanced models.
Coding
Example 1: Repeat Example 1 of One Between Subjects Factor and One Within Subjects Factor with the data shown in range A3:D17 of Figure 1 using regression.
Figure 1 – Coding
The coding for this data is shown on the right side of Figure 1. We need 13 dummy variables to handle the 14 subjects. We need 2 dummy variables to handle the 3 days and 2 dummy variables to handle the three age groups.
Analysis
We now perform a number of regressions with Yield as the dependent variable (see Figure 2). We only need to retain the df and SS values for each of the regressions.
Figure 2 – Regressions
The first regression only uses Subjects (S) as the independent variable. The third regression uses Age (A) as the independent variable. The fifth regression uses Duration (D) as the independent variable. The second uses both Duration and Age as the independent variables. The fourth uses Duration, Age as well as the interaction between Age and Duration as the independent variables.
The resulting ANOVA is shown in Figure 3 (prior to applying the GG and HF epsilon corrections).
Figure 3 – ANOVA using regression
The SS values shown in column BG of Figure 3 are calculated by the formulas shown in column BN (based on the cells in Figure 2). The formulas for the df are similar and are based on the df cells in Figure 2.
Examples Workbook
Click here to download the Excel workbook with the examples described on this webpage.
Reference
Howell, D. C. (2010) Statistical methods for psychology (7th ed.). Wadsworth, Cengage Learning.
https://labs.la.utexas.edu/gilden/files/2016/05/Statistics-Text.pdf
Hi Charles,
Thanks for all the materials you share in your website. I have been learning statistics on my own and have found your explanations and examples very helpful. I would like to ask how to perform the regression using D, A and DA.
Thank you,
Tony
Hi Tony,
I have just added a link to the workbook containing this regression (as well as the others used on this webpage). This should address your question.
Charles