Display dictionary

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

Display dictionary

Staffan Lindberg
Dear list!

I want to document some files with the old command "Display dictionary".
Previously it was possible to get all information variable by variable. Now
it has been split into to parts, one part containing variable labels and
definitions and another part containing value labels. This makes it awkward
as you have to look in 2 different places for all information.

Is there a way to get the old format with all information variable by
variable?

best

Staffan Lindberg
AnaStat AB
Stockholm
Sweden

=====================
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: Display dictionary

Cleland, Patricia (EDU)
Staffan

The bottom line is that you can't do it with Display Dictionary in any
version after 13.

Below is the syntax to do it with Python including printing the name of
the file and the number of variables in the file. (Much of the syntax is
from Jon Peck.)

There are two versions of the syntax- the first will also print item
statistics (counts for each value and means), the second is just the
data dictionary.

HTH

Pat

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++

* Print file name, number of vars in file and var information  in file
order.
* Print statistics-counts for each value and means.
* To print the var info in alpha order change 'alphaorder=False' to
'alphaorder=True'.

BEGIN PROGRAM.
import spss, spssaux, DisplayDict
print ' '
print "Data Dictionary for:", spssaux.GetDatasetInfo()
print ' '
print "Number of Variables:", spss.GetVariableCount()
print ' '
DisplayDict.dictionary(alphaorder=False, stats='all')
END PROGRAM.


.
* Print file name, number of vars in file and var information  in file
order.
* To print the var info in alpha order change 'alphaorder=False' to
'alphaorder=True'.

BEGIN PROGRAM.
import spss, spssaux, DisplayDict
print ' '
print "Data Dictionary for:", spssaux.GetDatasetInfo()
print ' '
print "Number of Variables:", spss.GetVariableCount()
print ' '
DisplayDict.dictionary(alphaorder=False)
END PROGRAM.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Staffan Lindberg
Sent: December 11, 2007 5:51 AM
To: [hidden email]
Subject: Display dictionary

Dear list!

I want to document some files with the old command "Display dictionary".
Previously it was possible to get all information variable by variable.
Now
it has been split into to parts, one part containing variable labels and
definitions and another part containing value labels. This makes it
awkward
as you have to look in 2 different places for all information.

Is there a way to get the old format with all information variable by
variable?

best

Staffan Lindberg
AnaStat AB
Stockholm
Sweden

=====================
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

=====================
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