SPSS Macros drastically reduce the time needed to run factor analysis and creating summary variables. In the video below I demonstrate how you can greatly increase the speed at which you analyze your data as well as creating the new variables with summary factor scores.
By running Factor analysis twice (but changing the output) you can make it much easier to create summary variables once you’re happy with your solution!
Video demonstrating SPSS Macro running Factor Analysis
Even though I do nearly all my analysis in SPSS, I still prefer to use Excel to graph my data. Unfortunately Excel inverts the legend when graphing. Creating a new variable, or re-coding the old one, is time consuming and errors can creep in. This SPSS macro to invert an ordinal variable with very little work. Saves an amazing amount of time!
It also has a built-in way to filter out too small a sample size.
Using SPSS Macros can save an incredible amount of time. They have a somewhat-steep learning curve but are definitely worth it! This is a short overview of the strength of using a macro to run the descriptives command.
Word of warning, make sure you re-define your macro before calling it. This is an easy step to forget and you can waste a lot of time.
SPSS Macro Code
DEFINE !Describer (Buy2 !TOKENS (1) / Title !Tokens (1) / ord !Tokens (1) /Varys !CMDEND)
Desc !Varys /sort (!ORD) /stats Mean.
script "B:\SPSS\Scripts\S1\Swap Mean.SBS".
Script "B:\SPSS\Scripts\Change N to Count.SBS".
Script "B:\SPSS\Scripts\Parse\Move Row.sbs"("Other").
Script "B:\SPSS\Scripts\Parse\Move Row.sbs"("None of the above").
script 'B:\SPSS\Scripts\Parse\Change Title.sbs' (!Title).
Script "B:\SPSS\Scripts\S1\Size labels to avoid line-wrapping.sbs".
/*!Describer Buy2=XXX Ord=a Title="Title" Varys= Var1 Var2.
Video tutorials demonstrating the usage of the SPSS Macro
https://www.youtube.com/watch?v=5CBm_F3zBOo A lot of online vendor tools provide a data value on a multi-select question however they leave the value missing if the respondent didn’t select it. Most of the analysis I want to do needs to have a zero (or some other value) present in order to calculate the …
Using an SPSS Macro to Open and Save files can be quite a time saver! In my example code & video I demonstrate how to adapt basic SPSS syntax into a macro that automates the process. I also mention this macro which takes the reverse approach (automatically breaks the file into random groups).
The below code it just an example using SPSS macro to open and save text files which will have to be adapted to your needs. Be sure to pay close attention to string variables and the widths you set them at. Generally speaking, set them at double what SPSS assigns them. In reality, there doesn’t seem to be any file-size change when you make them very wide so you also might just default to setting the width to 10X the width (then shrink the column widths with the Var Width command.
In the video I also demonstrate how I used Excel to help write my syntax for looping over all the files as well as merging the files together.
SPSS macro to open and save Text files
DEFINE !OpenSav (In_Path !TOKENS (1) /Out_Path !TOKENS (1) / File_Name !TOKENS (1) )
GET DATA /TYPE=TXT /FILE=!In_Path + !File_Name + ".txt"
/DELCASE=LINE /DELIMITERS="\t" /QUALIFIER='"' /ARRANGEMENT=DELIMITED /FIRSTCASE=2 /IMPORTCASE=ALL /VARIABLES=
DATASET NAME $DataSet WINDOW=FRONT.
Var width All (5) company city (10) .
SAVE OUTFILE=!Out_Path + !File_Name + ".sav" /COMPRESSED.
!OpenSav In_Path="H:\temp\Files\" Out_Path="H:\temp\Out\" File_Name="Rand_1".
Video demonstrating using an SPSS macro to open and save files