So I actually bothered to read the help the other day for SPSSINC TRANS , which being generic allows you to use Python functions similar to how COMPUTE statements work, just a bit more general. Two examples of passing arguments I did not know you could do were 1) pass a list as an argument,...
2 Comments - no search term matches found in comments.
I recently had a set of SPSS syntax that iterated over multiple variables and generated many similar graphs. They were time series graphs of multiple variables, so the time stayed the same but the variable on the Y axis changed and the code also changed the titles of the graphs. Initially I was...
4 Comments - no search term matches found in comments.
Sometimes there are calculations provided for in SPSS tables that are necessary to use for other calculations. A frequent one is to grab certain percentiles from a FREQUENCY table ( Equal Probability Histograms in SPSS is one example). The typical way to do this is to grab the table using OMS...
For the majority of data management I do in SPSS, the brunt of the work is likely done in under 10 different commands. DO REPEAT is one of those commands, and I figured I would show some examples of its use. In its simplest form, DO REPEAT simply iterates over a list of variables and can...
The title is probably not that clear, but I've seen this request a few times and have used this trick in one my projects, so figured it would be a worthwhile topic to illustrate. So the problem is you have a background distribution, and you want to tailor a set of individual charts showing the...
3 Comments - no search term matches found in comments.
I've shown how you can grab data from SPSS and use it in Python commands , and I figured a post about the opposite process (taking data in Python and turning it into an SPSS data file) would be useful. A few different motivating examples are: Creating a set of permutations using the ...
SPSS has a native set of string manipulations that will suffice for many simple situations. But with the ability to call Python routines, one can use regular expressions (or regex is often used for short) to accomplish more complicated searches. A post on Nabble recently discussed extracting...
For a project I have been estimating group based trajectory models for counts of crime at micro places. Synonymous with the trajectory models David Weisburd and colleagues estimated for street segments in Seattle. Here I will show how using SPSS and the R package crimCV one can estimate...
7 Comments - no search term matches found in comments.
One common task I undertake in is to make time series graphs of crime counts, often over months or shorter time periods. Here is some example data to illustrate, a set of 20 crimes with a particular date in 2013. *Make some fake data. SET SEED 10. INPUT PROGRAM. LOOP #i = 1 TO 20. COMPUTE #R...
This is the first time since I've been using SPSS that I have regular access to Python and R programmability in all of the different places I use SPSS (home and multiple work computers). So I've been exploring more solutions to use these tools in regular data analysis and work-flows - of course...
1 Comment - no search term matches found in comments.