Tuesday, December 9, 2008

Transformations

I know that you just do a transformation when both assumptions (homoskedasticity and normality are violated), but what do you need to do when the two violated assumptions are linearity and homoskedasticity (a different pair)and normarlity is perfect. I found in my notes about polinomial regression or adding a squared term to the regression. Do I need to do that? If yes, HOW? If not, I will have 2 assumptions violated. Does that mean that this model does not work?

1 comment:

Mari said...

You create a squared term in much the same way that you would create an interaction term when examining continuous predictors and moderators in a moderated model.

That is, transform --> compute --> newvariablename = oldvariablename * oldvariablename

So, before you computed predictor * moderator, and here (to square a term) you multiply it by itself. So, if you wanted to, for instance, examine the curvilinear effect of age, you might have the equation "agesqrd = age * age" in your compute statement.

One important thing to know is that you must include both the original variable and the squared variable in the analysis. That is, the phrase "add a squared term" should not be misinterpreted as "substitute as squared term."

Just as you couldn't look at the interaction term without the main effects, you also cannot look at the squared term without the linear term.

One final note: if your distribution were to suggest that you had cubic or higher terms needed (that is, rather than a U shape, you had a sine wave or something equally convoluted), you COULD add additional terms (oldvariablename * oldvariablename * oldvariablename for cubic, for instance), but really, this would imply a more complex model than probably you want to tackle for this assignment, so if a squared term doesn't help, you may want to either choose another model or treat carefully the limitations of the tested model in the current assignment. Even a squared term is an ambitious thing to tackle here. (You are perfectly capable of handling it, but it is more work than I intended you to do for this assignment.)