

Make the syntax manual your best friend in crime data analysis.
#Spss code categorical variables software#
That’s one reason I say it really doesn’t generally matter much which stat software you use, as long as the one you’re using can do what you need.īut whatever you choose, know it really, really well. The lesson I learned? Know thy software defaults. Funny, none of the hypotheses were supported when the analysis was backward. But I was interpreting everything backwards. I knew that, and assumed it was the same in GEE. The default in SPSS binary logistic regression is to model the odds that Y=1. Not too long ago I made a big mistake working on a client’s data set, which luckily I caught when the results didn’t make sense. In binary logistic regression, the outcome variable is coded 0/1. You have to be careful in logistic regression as well. Since interpreteing means is often much, much more intuitive, you have to define it as categorical. This usually works, but neither package will then give you means ( lsmeans in SAS and EMMeans in SPSS) for that variable. You may therefore be tempted to just put it in as a covariate–i.e., don’t tell your software it’s categorical.

But if the data are 0 and 1, 1 comes after 0 alphabetically, and 1 becomes the reference group. So if your data are M and F, M will be the reference group. Likewise, in both SPSS mixed and GLM, the default is to make the one that comes last alphabetically the reference group, 0. But if you’ve dummy coded them already, it’s switching them on you. This works just fine if your values are coded 1, 2, and 3. The default reference category–what GLM will code as 0–is the highest value. In SAS proc glm, when you specify a predictor as categorical in the CLASS statement, it will automatically dummy code it for you in the parameter estimates table (the regression coefficients). There’s no indication of what software was involved, but I’ve seen it happen in different software packages and in different procedures.

when i use the equation, won’t this variable always be zero.? but how can i do this when the dummy variables coded with a “0” have a coefficient and those coded “1” don’t. I always thought that the fixed effects table is similar to a regression table in that you should be able to calculate the estimates because you are given coefficients. I dummy code my categorical variables “0” or “1” but for some reason in the fixed effects table the variable with code “0” has a coefficient and the variable coded “1” has the coefficient “0” and and considered redundant. The context was a Linear Mixed Model, but this can happen in other procedures as well. Here’s one example in a question I received recently. This is made particularly tricky because sometimes your software switches them on you. One of the tricky parts about dummy coded (0/1) variables is keeping track of what’s a 0 and what’s a 1.
