Statistical Software

Confusing Statistical Term #4: Hierarchical Regression vs. Hierarchical Model

December 21st, 2009 by

This one is relatively simple.  Very similar names for two totally different concepts.Stage 2

Hierarchical Models (aka Hierarchical Linear Models or HLM) are a type of linear regression models in which the observations fall into hierarchical, or completely nested levels.

Hierarchical Models are a type of Multilevel Models.

So what is a hierarchical data structure, which requires a hierarchical model?

The classic example is data from children nested within schools.  The dependent variable could be something like math scores, and the predictors a whole host of things measured about the child and the school.

Child-level predictors could be things like GPA, grade, and gender. School-level predictors could be things like: total enrollment, private vs. public, mean SES.

Because multiple children are measured from the same school, their measurements are not independent.  Hierarchical modeling takes that into account.

Hierarchical regression is a model-building technique in any regression model. It is the practice of building successive linear regression models, each adding more predictors.

For example, one common practice is to start by adding only demographic control variables to the model.   In the next model, you can add predictors of interest, to see if they predict the DV above and beyond the effect of the controls.

You’re actually building separate but related models in each step.  But SPSS has a nice function where it will compare the models, and actually test if successive models fit better than previous ones.

So hierarchical regression is really a series of regular old OLS regression models–nothing fancy, really.

Confusing Statistical Terms #1: Independent Variable

Confusing Statistical Terms #2: Alpha and Beta

Confusing Statistical Terms #3: Levels

 


Sharing SPSS Output across Versions

November 18th, 2009 by

If you’ve ever tried sharing SPSS output with your collaborators, advisor, or statistical consultant, you have surely noticed that the output is often not compatible across different versions of SPSS.

And if you work in a company where everyone is working on the same site license, it’s not a problem.  But if you’re collaborating with colleagues at different universities on different upgrade schedules, you might run into some problems.

It’s true that most software programs aren’t back-compatible.  You can’t read documents created in newer versions in older versions of software.

But SPSS’s sharing capabilities are more, um, interesting.

The syntax and data files are back and forward-compatible across many versions, at least since v9 or so.  (I don’t (more…)


Have you Wondered how using SPSS Burns Calories?

October 30th, 2009 by

Maybe I’ve noticed it more because I’m getting ready for next week’s SPSS in GLM workshop. Just this week, I’ve had a number of experiences with people’s struggle with SPSS, and GLM in particular.

Number 1: I read this in a technical report by Patrick Burns comparing SPSS to R:

“SPSS is notorious for its attitude of ‘You want to do one of these things. If you don’t understand what the output means, click help and we’ll pop up five lines of mumbo-jumbo that you’re not going to understand either.’ “

And while I still prefer SPSS, I had to laugh because the anonymous person Burns (more…)


3 Pieces of SPSS Syntax to Keep Handy

October 23rd, 2009 by

I hope you’re getting started using SPSS Syntax by hitting that Paste button when you use the menus.

But there are a few parts of SPSS you can’t do that with. Specifically, there are syntax commands for doing all the variable definitions that you usually fill out in the “Variable View” window. But there are no Paste buttons there, so you have to know how to write the syntax from scratch.

I find the three variable definitions that I use the most are defining Variable Labels, Value Labels and Missing Data codes. The syntax is simple and logical for all three, so I’m going to just give you the basic code, which you can keep on hand and edit as you need.

For a data set with the variables Gender, Smoke, and Exercise, with the following definitions:

Gender: 0=Male, 1=Female
Smoke: 1=Never 2=Sometimes 3=Daily
Exercise: 1=Never 2=Sometimes 3=Daily

For all three variables, 999 = a user-defined missing value

We could use the following code to give descriptive variable labels, encode the value labels, and define the missing data:

VARIABLE LABELS
GENDER ‘Participant Gender’
SMOKE ‘Does Participant ever Smoke Cigarettes?’
EXERCISE ‘How Often Does Participant Exercise for a30 Minute Period?’.

Notice two things:
1. I could put all three Variable labels in the same Variable Label statement
2. There is a period at the end of the statement. This is required.

VALUE LABELS
GENDER 0 ‘Male’ 1 ‘Female
/SMOKE EXERCISE
1 ‘Never’
2 ‘Sometimes’
3 ‘Daily’.

MISSING VALUES
GENDER SMOKE EXERCISE (999).

Since all three variables have the same missing data code, I could include them all in the same statement.

There are, of course syntax rules for all of these commands, but you can easily look them up in the Command Syntax Manual.

Want to learn more? If you’re just getting started with data analysis in SPSS, or would like a thorough refresher, please join us in our online workshop Introduction to Data Analysis in SPSS.

 


A Great (and Free) Resource for SPSS Syntax: the Command Syntax Reference

October 22nd, 2009 by

I find SPSS manuals, as a rule, marginally useful. Sure they may tell you which options are available when doing Statistic X, but not what they mean or when to use them.

I still use them, of course, but only when I have no other options.

There is one exception, though, and that is the Command Syntax Reference. This is the manual that explains all the SPSS Syntax commands.

SPSS started as a syntax-only program. I first learned SPSS before Windows existed. I don’t think you could even get it for a PC back then. We had to use the College’s VAX mainframe computer. This was back in the days where you had to go pick up your printouts down the hall in the computing center. But no cards. I’m not THAT old.

Anyway, I think in those days SPSS must have put a lot of resources into really good manual writing. So the Command Syntax Reference, which was the entire manual, rocked. It still does, since for the most part, the syntax doesn’t change that much with new versions.

The great thing about it is now it’s available right in SPSS. When you click on help, instead of Search, choose Command Syntax Reference. It includes every possible option, explains when and how to use it, and what it means. It’s an extremely handy resource, comes free with SPSS, and you don’t have to spend hours searching the internet for an answer.

The only hard part about it is it is organized by the command, and they’re not always intuitive. So if you don’t know that the Univariate GLM menu equivalent syntax command is  “UNIANOVA,” you’ll have a hard time using it.

This is another good time to use the Paste button. Just use the menus to create some semblance of the analysis you want to do and hit Paste. You’ll get the basic command, which you can now look up and refine.

Want to learn more? If you’re just getting started with data analysis in SPSS, or would like a thorough refresher, please join us in our online workshop Introduction to Data Analysis in SPSS.

 


How to Effortlessly Create SPSS Syntax and Automatically Add it to your Output

October 16th, 2009 by

So hopefully I’ve extolled the benefits of using SPSS Syntax enough that you’re convinced it is something you should regularly use.

Even if you don’t start programming, there are two things you can do to begin learning Syntax and give you the communication and tracking benefits.

1. From now on, when you use menus for an analysis, instead of clicking the “OK” button, click “Paste.”*

When you use the menus and click OK, SPSS is translating your menu choices into syntax.  You just don’t see it.

When you click Paste, though, SPSS opens a syntax window and writes a copy of this syntax.  To run it, simply go to the Syntax window, highlight the procedure you want to run, and click the Run button, which looks like a triangle facing right.

This will get you used to the kind of language SPSS Syntax uses. You can, if you wish, start to edit it.

But even if you don’t, over time you’ll start to notice how logical it is and how the menu choices correspond to phrases in the syntax. And you’ll (more…)