News from the SPSS Community

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

News from the SPSS Community

Jon K Peck
Two new extension commands have been posted on the SPSS Community site, and one other has an update.

STATS COXREGR performs Cox regression.  It adds some features not available in the built-in COXREG command - principally interval-based censoring using a counting process.  It requires the R Essentials.

STATS VALLBLS FROMDATA creates value labels for a set of variables based on values of other variables in the dataset.  Variables can be specified by name or via patterns in the names.  Conflicts in the labels and duplicate labels are reported.  It requires the Python Essentials.

Both extensions include a dialog box interface and traditional SPSS syntax.

STATS ADJUST WIDTHS, which synchronizes string variable sizes across datasets to facilitate merging, has a bugfix for the VARIABLES=ALL case.

The Python Essentials can be installed via the SPSS Community website (www.ibm.com/developerworks/spssdevcentral), or, for V21, via the media for that version.  For V22, the Python Essentials are integrated into the main Statistics install.

The R Essentials can be installed via the website.

For Statistics 22, new extensions and updates can be installed from the Utilities > Extension Bundles > Download and Install Extension Bundles menu.  For older versions of Statistics, these items need to be downloaded from the website and installed.

Reminder: If you are on Windows 7 or similar, extensions usually need to be installed using Run As Administrator.

We hope that you find these useful.



Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621
Reply | Threaded
Open this post in threaded view
|

Re: News from the SPSS Community

Albert-Jan Roskam
<snip>
>
>STATS VALLBLS FROMDATA creates value
labels for a set of variables based on values of other variables in the
dataset.  Variables can be specified by name or via patterns in the
names.  Conflicts in the labels and duplicate labels are reported.
 It requires the Python Essentials.

Very useful (in fact I also created something like this). What happens if the values are not unique?
e.g.
1 males
1 gents
2 females

Will it (a) silently use "gents" (b) throw some exception?

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: News from the SPSS Community

Jon K Peck
The command produces a table showing the number of conflicts such as your example and the number of duplicate labels for each variable
Duplicates would be, for example,
1 males
2 males
3 females

The conflicts rule is that the first assignment for a variable wins.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Albert-Jan Roskam <[hidden email]>
To:        [hidden email],
Date:        01/21/2014 01:48 AM
Subject:        Re: [SPSSX-L] News from the SPSS Community
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




<snip>
>
>STATS VALLBLS FROMDATA creates value
labels for a set of variables based on values of other variables in the
dataset.  Variables can be specified by name or via patterns in the
names.  Conflicts in the labels and duplicate labels are reported.
It requires the Python Essentials.

Very useful (in fact I also created something like this). What happens if the values are not unique?
e.g.
1 males
1 gents
2 females

Will it (a) silently use "gents" (b) throw some exception?

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


Reply | Threaded
Open this post in threaded view
|

Re: News from the SPSS Community

Richard Ristow
In reply to this post by Jon K Peck
At 05:41 PM 1/20/2014, Jon K Peck wrote:

>STATS VALLBLS FROMDATA creates value labels for a set of variables
>based on values of other variables in the dataset.  Variables can be
>specified by name or via patterns in the names.  Conflicts in the
>labels and duplicate labels are reported.  It requires the Python Essentials.

This will be useful; but may I remark that the effect can also be
obtained rather neatly in native SPSS? I posted a solution on the
16th (*). It does not report duplicate or conflicting labels, but
those checks could be made by simple syntax running against dataset
"Summary", which the code creates.

Now, "STATS VALLBLS FROMDATA" is production-grade code, with
well-formatted output and extensive error checking; the code I posted
definitely is not. But while production-grade utilities are great, I
think there's also a point to posting simpler, more readable
solutions. (I submit that the native-SPSS solution is far more
readable than is the code for "STATS VALLBLS FROMDATA". I poured over
its Python for a long time just to find out how its AGGREGATEs are
written.) We don't just want to solve posters' immediate problems; we
want to present techniques that they (and other readers) may adapt
and apply later.

(*) See posting
Date:    Thu, 16 Jan 2014 12:47:03 -0500
From:    Richard Ristow <[hidden email]>
Subject: Re: value labels from string vars
To:      [hidden email]

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: News from the SPSS Community

Jon K Peck
Richard,

I don't get it.  The extension command - which no one has to use - makes the intent of the code clear, produces useful summary output, works on both string and numeric target variables, deals with special situations like embedded quotes, handles missing data and blank labels properly, and allows easy selection of variable sets with regular expressions.  What's not to like?  Lots of things that can be done easily with extensions can be done with more difficulty, fragility, or less generality with native code, but I don't see that as a reason not to produce and use extensions.  A job that contains VALLBLS FROMDATA or similar extensions will be lots more maintainable than one with complex native code and will not fail mysteriously when unhandled situations such as a label with a quote happen to come along.

To each his own.



Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Richard Ristow <[hidden email]>
To:        [hidden email],
Date:        01/22/2014 11:14 PM
Subject:        Re: [SPSSX-L] News from the SPSS Community
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




At 05:41 PM 1/20/2014, Jon K Peck wrote:

>STATS VALLBLS FROMDATA creates value labels for a set of variables
>based on values of other variables in the dataset.  Variables can be
>specified by name or via patterns in the names.  Conflicts in the
>labels and duplicate labels are reported.  It requires the Python Essentials.

This will be useful; but may I remark that the effect can also be
obtained rather neatly in native SPSS? I posted a solution on the
16th (*). It does not report duplicate or conflicting labels, but
those checks could be made by simple syntax running against dataset
"Summary", which the code creates.

Now, "STATS VALLBLS FROMDATA" is production-grade code, with
well-formatted output and extensive error checking; the code I posted
definitely is not. But while production-grade utilities are great, I
think there's also a point to posting simpler, more readable
solutions. (I submit that the native-SPSS solution is far more
readable than is the code for "STATS VALLBLS FROMDATA". I poured over
its Python for a long time just to find out how its AGGREGATEs are
written.) We don't just want to solve posters' immediate problems; we
want to present techniques that they (and other readers) may adapt
and apply later.

(*) See posting
Date:    Thu, 16 Jan 2014 12:47:03 -0500
From:    Richard Ristow <[hidden email]>
Subject: Re: value labels from string vars
To:      [hidden email]

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD