Moving data from one column to many; Parsing a variable using an SPSS macro

one column to many

Older online vendor tools and databases would frequently put multi-select questions into one column having a pipe,tab,semicolon or comma delimiter (what was real fun is when they would use a comma for a delimiter in a CSV file).

This can be very problematic in nearly any tool. In this video I demonstrate how easy it can be to move data from one column to many with an SPSS macro.

Move one column to many

Parsing a variable in SPSS using a macro

Here is the SPSS macro demonstrated in the video:

 

Heteroscedasticity & Transformations- Video of “transforming” data

Heteroscedasticity & transformations

Heteroscedasticity & Transformations

Financial data often has problems with heteroscedasticity also spelled Heteroskedasticity (funnel shaped). Performing transformations is necessary however I often have a hard time explaining what the transformation is actually doing. This video helps show what is happening during a log transformation.

After watching the data literally “transform” it was much easier to grasp exactly what was happening and how it would help.  Just remember you’ll have to transform it back if you wish to interpret the values.  While the below video was created using SYSTAT, I transform data so often I have some killer SPSS macros which transform data effortlessly.

You want your data to be normally distributed around the line which is “homosecasticity“.

 

Heteroscedasticity and Log transformation

If you’re interested in reading more, SAGE has a specific book on Heteroscedasticity & transformations

SPSS macro makes for easy splitting of data into separate files of equal numbers

SPSS Macro

SPSS macro

If you frequently need to have your data split into equal groups, this SPSS macro is the way to go!  You can just tell it how many groups you want and the variable you want to create to store group belonging and WHAM!  it randomizes the list and adds a new field showing the groups.

In the code below I show two examples of the SPSS macro.  One that will randomize the group and split it out, the second allows you to use another variable before breaking them into groups (In case you want a certain order to them.)  Both macros greatly reduce the amount of work needed to do in SPSS.

 

SPSS Macro for creating equal groups

Learning Macros | Raynald’s SPSS Tools

This page is a simple introduction to SPSS macros. There are several fully (line- by-line) commented examples of macro. Overview of several macro-related …

Configure your SPSS variable format properly using syntax

SPSS variable

SPSS Variable Formats

If you’re you want to have pretty-looking tables / output, having your data in the proper format really helps.  (not to mention that SPSS is “smart” and will prevent showing them in some GUI procedures if your variable is the “wrong” type.)

While the GUI window to the data editor makes it easy to adjust the variable level, format, type,etc.  I had a hard time finding the correct syntax to set them programatically.

This video helps with some of the more-common settings.  Below is the syntax for tweaking SPSS variable level and format.

 

Setting up your SPSS data with proper formats

Check out my post on setting SPSS variables for missing data!