You have probably noticed I’m not much into R (though I’m slowly coming around to it). It goes back to when I was in my graduate statistics program, where we were required to use SPlus (R’s parent language—as far as I can tell, it’s the same thing, but with customer support).
We were given a half hour tutorial and an incomprehensible text, and sent off to figure it out how to use SPlus on graduate level stats.
Not fun.
And since I was already fluent in SAS, SPSS, and BMDP (may it rest in peace), I resisted SPlus. A lot.
I actually wish R had been around, (more…)
by Annette Gerritsen, Ph.D.
In an earlier article I discussed how to do a cross-tabulation in SPSS. But what if you do not have a data set with the values of the two variables of interest?
For example, if you do a critical appraisal of a published study and only have proportions and denominators.
In this article it will be demonstrated how SPSS can come up with a cross table and do a Chi-square test in both situations. And you will see that the results are exactly the same.
‘Normal’ dataset
If you want to test if there is an association between two nominal variables, you do a Chi-square test.
In SPSS you just indicate that one variable (the independent one) should come in the row, (more…)
SPSS offers two choices under the recode command: Into Same Variable and Into Different Variables.
The command Into Same Variable replaces existing data with new values, but the command Into Different Variables adds a new variable to the data set.
In almost every situation, you want to use Into Different Variables. Recoding Into Same Variables replaces the values in the existing variable.
So if you notice a mistake after you’ve recoded, you can’t fix it.
But you may not even notice the mistake, because you can’t even test it.
And that’s just dangerous. (more…)
Can I use SPSS MIXED models for (a) ordinal logistic regression, and (b) multi-nomial logistic regression?
Every once in a while I get emailed a question that I think others will find helpful. This is definitely one of them.
My answer:
No.
(And by the way, this is all true in SAS as well. I’ll include the SAS versions in parentheses). (more…)
Covariate is a tricky term in a different way than hierarchical or beta, which have completely different meanings in different contexts.
Covariate really has only one meaning, but it gets tricky because the meaning has different implications in different situations, and people use it in slightly different ways. And these different ways of using the term have BIG implications for what your model means.
The most precise definition is its use in Analysis of Covariance, a type of General Linear Model in which the independent variables of interest are categorical, but you also need to adjust for the effect of an observed, continuous variable–the covariate.
In this context, the covariate is always continuous, never the key independent variable, (more…)
One of the places that SPSS syntax excels at efficiency is when you’re creating new variables. This is especially true when you’re creating a LOT of new variables, but even one or two can be quicker if you write the syntax code instead of menus.
And just as importantly, you’ll have documentation for exactly how you created them. (You think you’ll remember now, but 75 new variables later, you’ll thank me).
So once you create a new variable, you should of course immediately assign a Variable Label, and if appropriate, Value Labels and Missing Data Codes using Syntax.
Another thing that helps keep your new variable clean and interpretable is to assign the format. The default format is F8.2, which indicates a numerical value
You could go into the Variable View screen and manually change the Width and Decimals columns, which indicate how many characters go before and after (for numeric variables) the decimal point.
But why do all that when you can just use a single command to define multiple variables?
The syntax command is FORMATS. Here is the command for some common formats:
FORMATS NumVar1 NumVar2 (F5.0)
/NumVar3 (F6.1)
/StringVar1 (A15).
You can see the FORMATS command is followed by the variable names, then the format in parentheses.
Numeric variables NumVar1 and Numvar2 will both get the same format: with 5 digits, and nothing after the decimal.
Numeric variable NumVar3 will have 6 digits total, with one after the decimal.
And string variable (i.e. its value contain letters) StringVar1 is 15 characters wide.
This will get you started, but you can get all the specifics in the FORMATS section of the Command Syntax Reference, which is included in the SPSS help.
[Note: Edited explanation of F6.1 to be 6 digits total, not 6 digits before the decimal).