I'm using a categorical predictor variable and have been instructed to code things so that the coefficients sum to 0. How can I do this?
You're probably being advised to using what's known as effects coding, or deviation contrasts, which compare each level of a categorical factor to the mean of all levels. You can get these easily in SPSS in several procedures, under the name of Deviation contrasts. Note that you actually only get K-1 contrasts for K levels, since the last one is determined by the other K-1 values: it must be the negative of the sum of those values, in order to satisfy the sum to 0 condition.
If you want to code your own variables this way, here's how to proceed:
1) Choose a category to leave out. Code that category as -1 for all K-1 variables.
2) For each other category, code a variable as 1 if a case is in that category.
3) All other values are 0.
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.