Stacking Intervals
Motivated by visualizing overlapping intervals from the This is not Rocket Science blog (by Valentine Svensson) I developed some code in SPSS to accomplish a similar feat. Here is an example plot from...
View ArticleUsing funnel charts for monitoring rates
For a recent project of mine I was exploring arrest rates at small units of analysis (street midpoints and intersections) for one of the collaborations we have at the Finn Institute. One of the graphs...
View ArticleUsing the Google Distance API in SPSS – plus some EDA of travel time versus...
The other day I had a conversation with a colleague about calculating travel time distances and comparing them to actual geographic distances (aka as the crow flies). Being unfamiliar with the Network...
View ArticleAutomating tasks in SPSS using production jobs
For tasks that take along time or ones I want done on a regular basis I typically have the computer do the work while I am away. Such example tasks I have set up before are: querying large databases...
View ArticleRepeating Charts in SPSS for unique IDs
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...
View ArticleTreemaps in SPSS
Instead of an Xmas tree this year I will discuss a bit about treemaps. Treemaps are a visualization developed by Ben Shneiderman to identify how the current space on ones hard drive is being...
View ArticleTranslating between the dispersion term in a negative binomial regression and...
When estimating a negative binomial regression equation in SPSS, it returns the dispersion parameter in the form of: Var(x) = mean + mean*dispersion So a dispersion parameter of 0 in this notation is...
View ArticleLabeling tricks in SPSS plots
The other day I noticed when making the labels for treemaps that when using a polygon element in inline GPL SPSS places the label directly on the centroid. This is opposed to offsetting the label when...
View ArticleSome examples of using DO REPEAT in SPSS
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...
View ArticleContinuous color ramps in SPSS
For graphs in syntax SPSS can specify continuous color ramps. Here I will illustrate a few tricks I have found useful, as well as provide alternatives to the default rainbow color ramps SPSS uses when...
View ArticleString substitution in Python
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...
View ArticleString substitution in Python continued
On my prior post Jon and Jignesh both made the comment that using locals() in string substitution provides for easier to read code – and is a great recommendation. What locals() does is grab the object...
View ArticleEmailing with Python and SPSS
Emailing automated messages using Python was on my bucket list for a few projects, so here I will illustrate how to do that within SPSS. Basically the use case is if you have an automated report...
View ArticleROC and Precision-Recall curves in SPSS
Recently I was tasked with evaluating a tool used to predict violence. I initially created some code to plot ROC curves in SPSS for multiple classifiers, but then discovered that the ROC command did...
View ArticleUsing the New York State Online Geocoding API with Python
I’ve been very lucky doing geographic analysis in New York state, as the majority of base map layers I need, and in particular streets centerline files for geocoding, are available statewide at the NYS...
View ArticleExtracting items from SPSS tables using Python
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...
View ArticlePassing arguments to SPSSINC TRANS
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...
View ArticleSPSS Predictive Analytics Blog
SPSS had a blog on the old developerworks site, but they’ve given it a bit of a reboot recently. I’ve volunteered to have my old SPSS posts uploaded to the site, and this is what I said I wanted back...
View ArticlePassing arguments to SPSSINC TRANS (2)
Jon Peck made some great comments on my prior post on passing arguments to the SPSSINC TRANS function. Besides advice on that I should be quoting the argument on the FORMULA statement, he gave examples...
View ArticleFuzzy matching in SPSS using a custom python function
The other day I needed to conduct propensity score matching, but I was working with geographic data and wanted to restrict the matches to within a certain geographic distance. To do this I used the...
View Article