![spss code interaction spss code interaction](https://i.ytimg.com/vi/TmL4Ekq94xY/maxresdefault.jpg)
Any subsequent factors included in the model would involve redundant parameters, as would any interactions among factors, whether or not an intercept is included. If you suppress the intercept, then for the first factor entered into the model the k th indicator would not be redundant (unless the factor is preceded by an unusual covariate or set of covariates). The estimation algorithm used in GLM/UNIANOVA will set the row and column in the cross-product matrix representing the redundant column in the design matrix to 0s, alias the corresponding parameter estimate to 0, and the results are similar to a reparameterization approach treating the last category as a reference category, except that you have to remember that it's there if you want to specify a linear combination of the parameters to estimate. If there is an intercept in the model, then the k th indicator will be redundant (linearly dependent) on the intercept and the preceding k-1 indicators. The procedure does not explicitly treat the last category (sorted in ascending order, alphabetical for strings) as a reference category, though in simpler models the effect of what's done is essentially the same. For a factor with k levels, k indicator variables are created, one for each observed level of the factor. In building the design matrix, categorical predictors (factors) are indeed represented by sets of indicator (0-1) variables.
![spss code interaction spss code interaction](https://i0.wp.com/www.theanalysisfactor.com/wp-content/uploads/2017/12/LM-Blog-Post-1-Picture-2-1.png)
(Note that this is a large file, about 78 MB clicking on the link starts a download.) In addition to the information in the GLM chapter, appendices F (Indicator Method) and H (Sums of Squares) are relevant, respectively, for building the design matrix and specifying linear combinations of model parameters for computing sums of squares for testing hypotheses.
#Spss code interaction pdf#
Physically creating the variables by multiplying them togetherĪll the details one might reasonably want about how GLM (and UNIANOVA, which is the same underlying code) parameterizes models, estimates parameters, and conducts hypothesis tests are available in the IBM SPSS Statistics Algorithms manual, available for download as a pdf at. Does it have to do with some of the parameters being redundant? I've had another statistician try the same thing and ended up reaching the same point as what I did. To troubleshoot I've tried to flip the references groups when manually creating the variables but it still does not replicate the results. I end up with a model which has the same intercept, overall significance, and R squared however the individual significance of the predictors changes. Vs manually creating all the variables by hand ie:Īge_Centred Age_Centred_Dx Age_Centred_gender Age_Centred_gender_Dx BMI_Centred BMI_Centred_Dx BMI_Centred_gender BMI_Centred_gender_Dx BPS_Centred BPS_Centred_Dx BPS_Centred_gender BPS_Centred_gender_Dx Dx gender_Dx ICV_Dx ICV_Centred_Dx_gender gender ICV_Centred ICV_gender. When I build all the 2-way and 3-way interactions with syntax ie:Īge_Centred Age_Centred Dx Age_Centredgender Age_Centred Dxgender BMI_Centred BMI_Centred Dx BMI_Centredgender BMI_Centred Dxgender BPS_Centred BPS_Centred Dx BPS_Centredgender BPS_Centred Dxgender Dx Dx gender DxICV_Centred Dx ICV_Centredgender gender ICV_Centred ICV_Centred*gender. The reason I'm asking is I have a GLM model which has 3 continuous predictors and two categorical predictors (dummy coded). I was wondering if anyone knows how SPSS builds the interaction terms/calculates the significance for predictors behind the scenes in a GLM? From my understanding it dummy codes variables and treats the one that comes alphabetically last as the reference group.