Hi everybody,
I have a data set with 1000s of fields with a constant numeric code ("0") and a corresponding contant value label, e.g. "No data". I have to remove code and label completely for display by CTABLES. Otherwise CTABLES will still display a "0". And we dont want that. In Oct 2008, Jon Peck mentioned a ValueLabels property of an spssaux.VariableDict object as a way to to completely eradicate the value labels, or you yo have sth more handy up your sleeve? Any help greatly appreciated! ===================== 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 |
If the value label sets are actually identical
for all these variables, you could do this most easily by editing one to
remove the zero and then using Data> Copy Data Properties selecting
only the value labels
Otherwise, assuming that you have the Python plugin installed (Python Essentials from the SPSS Community site, which is www.ibm.com/developerworks/spssdevcentral) this program will remove any labels for the value 0. Indentation is important, so I've used dashes to protect it from the email demons. Replace each dash with a space. begin program. import spss, spssaux for v in spssaux.VariableDict(): --vl = v.ValueLabels --if '0' in vl: ----del(vl['0']) ----v.ValueLabels = vl end program. HTH, Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: TinyTina <[hidden email]> To: [hidden email] Date: 05/21/2012 01:08 PM Subject: [SPSSX-L] completely eradicating value labels Sent by: "SPSSX(r) Discussion" <[hidden email]> Hi everybody, I have a data set with 1000s of fields with a constant numeric code ("0") and a corresponding contant value label, e.g. "No data". I have to remove code and label completely for display by CTABLES. Otherwise CTABLES will still display a "0". And we dont want that. In Oct 2008, Jon Peck mentioned a ValueLabels property of an spssaux.VariableDict object as a way to to completely eradicate the value labels, or you yo have sth more handy up your sleeve? Any help greatly appreciated! ===================== 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 |
In reply to this post by TinyTina
Rick,
MISSING VALUES ALL (0) helped, VALUE LABELS ALL didnt. CTABLES progs tricked me for a while to realize that MISSING VALUES approach actually took effect Thank you ! TinaTiny ===================== 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 |
Hi Tina,
To erase the value labels of consecutive variables (e.g. v1 to v100) try
value labels v1 to v100 ''.
and for all the variables try
value labels all ''.
Notice the single quotes ''. Both lines were tested and work.
vlad
On Mon, May 21, 2012 at 10:25 PM, SUBSCRIBE SPSSX-L Anonymous <[hidden email]> wrote: Rick, |
Free forum by Nabble | Edit this page |