Sums of Squares for Within-Subject Effects

Name: ________________________________

Points: 15
Due:
At the beginning of the next class
Download: glm_withn1.sav        (Download Tips)


The goal of this homework is to understand how the sums of squares are computed for within-subject effects.

Within-subjects effects are calculated by creating a set of transformed variables from the within subject-factor. One new variable is created for each degree of freedom (df) in the factor. The data used in the GLM Repeated-measures designs: One within-subjects factor notes had single within subjects factor with 3 df.  By default, the GLM uses polynomial transformations for within-subject effects.  The three, single-degree-of-freedom, variables created by the polynomial transformations were: the linear effect, the quadratic effect, and the cubic effect. We saw that the sums of squares for the time effect was the sum of the sums of squares for the linear, quadratic, and cubic components.  But how were the sums of squares computed for each single degree of freedom effects?

Computation of the Single-Degree-of-Freedom Effects

Each single-degree-of-freedom effect was computed by weighting each of the four scores by an appropriate coefficient and then summing the weighted scores. The formulas for the linear, quadratic, and cubic effects are reproduced below.

LINEAR = (-.671*iesi_t1) + (-.224*iesi_t2) + (.224*iesi_t3) + (.671*iesi_t4).
QUAD = (.500*iesi_t1) + (-.500*iesi_t2) + (-.500*iesi_t3) + (.500*iesi_t4).
CUBIC = (-.224*iesi_t1) + (.671*iesi_t2) + (-.671*iesi_t3) + (.224*iesi_t4).

Your first task is to compute the values for those three variables for each case in the glm_withn1.sav datafile.  That is, create three new variables called linear, quad, and cubic in the data editor for glm_withn1.sav.  Use SPSS to find the means and standard deviations for each effect. Enter the values for the means and standard deviations, and ns, in the table below (3 pts)

Single-df-Effect Mean Standard
Deviation
n
Linear      
Quadratic      
Cubic      

Linear Effect Scores

Let's begin by thinking about each person's linear effect score, Xlinear.  The linear effect score was computed using the formula given above.  Each person's score has two components: the linear effect itself and error.

The distance from zero (no linear effect) to the mean of the linear effect (Mlinear - 0, or simply Mlinear) is the linear effect component of each person's score. The mean of the linear score is our best prediction of the linear effect. If we were to guess each person's linear effect score, we would minimize our errors by predicting that each person scored at the mean of the linear effect. 

The distance from the mean of the linear effect to that person's linear effect score ( XlinearMlinear) is the error component of each person's score.  For each person we predict that he or she scored at the mean, the distance from the mean to that person's actual score is error.

Xlinear = linear effect + error
X
linear Mlinear  +    (XlinearMlinear)

Sums of Squares (SS)

    The total SS for the linear effect can be decomposed in to its two components, the sums of squares for the linear effect itself and the sums of squares for error.

SStotal =  SSeffect  +   SSerror

   Total sums of squares (SS) for the linear effect. The total SS for the linear effect scores (SSLtotal) is the sum of the squared distance from zero to each person's linear effect score,  å(Xlinear - 0)² or simply, the sum of the squares of each person's linear effect score,  å(Xlinear)².

 Create a new variable that is the square of the linear effect score and report the sum of those squared values. (1 pt).

SSLtotal = å(Xlinear)² = 

    Effect SS for the linear effect. The SS for the linear effect (SSLeffect) is the sum of squared distance from 0 (no linear effect) to the mean of the linear effect, å(Mlinear - 0)², or simply, the sum of the squared mean scores, å(Mlinear)².

Create a new variable that is the square of the mean linear effect score and report the sum of those squared values (1 pt). 

SSLeffect = å(Mlinear)² =

If you have done this correctly, the SSeffect term you reported above should be the same (or nearly the same) as the value reported for the SS of the linear effect in the lecture notes.

    Error SS for the linear effect.  The SS for the linear effect error term (SSLerror) is the sum of the squared distances from the mean of the linear effect scores to the person's linear effect score, å(XlinearMlinear)². 

Create a new variable that is the square of the distance from the mean of the linear effect to the persons linear effect score and report the sum of those squared values (1 pt).

SSLerror = å(XlinearMlinear)² = 

Check your calculations. If you have done this correctly, the SSerror term you reported above should be the same (or nearly the same) as the value reported for the SS of the error term for the  linear, single-df effect in the lecture notes.  And SSLtotal will be equal to  SSLeffect + SSLerror .


SS for the Quadratic and Cubic Effect

Use the same logic and procedures to compute the total, effect, and error SS for the quadratic and cubic effects.  Report the SS in the table below (6 pts)

Effect SStotal SSeffect SSerror
Quadratic      
Cubic      

Summarize Your Findings

Use the descriptives procedure to create one table that has the mean and sum for the squared linear, quadratic and cubic scores (the scores used to find the SStotal for those effects), the squared mean scores for the linear quadratic and cubic scores (the scores used to find the SSeffect for those effects), and the squared mean scores for the errors (the scores used to find the SSerror for those effects). Include a hardcopy of that table. (3 pts)


What to turn in:

1. A hardcopy of this homework with the empty boxes filled in.

2. A hardcopy of the descriptives table described above.


©Lee A. Becker, 1999 -revised 12/03/99