Posted by
Art Kendall on
May 20, 2021; 3:14pm
URL: http://spssx-discussion.165.s1.nabble.com/delete-specific-value-label-tp5740529p5740539.html
I do not fully understand what you are trying to do but these may help. (or
WHY one would do this)
It appears the difficulty is in getting the list of variables. Once you have
that segment 4 setting the labels to a blank is straightforward.
1) Select some variables into a macro.
SPSSINC SELECT VARIABLES/HELP.
Will explain how to do it.
This is an example first line
SPSSINC SELECT VARIABLES/ MACRONAME = '!InputSingle'
2) Sort some variables by some attribute in the variables view. This example
uses a custom attribute. Might be useful for setting up “TO”.
SORT VARIABLES BY ATTRIBUTE Var.Grouping.
3)this shows getting a list of variables that have a labeled value of 3. You
could cut-and-paste from the output window.
begin program python3.
import spssaux
vardict=spssaux.VariableDict()
for v in vardict:
vls = v.ValueLabels
if "3" in vls:
print(v.VariableName,v.VariableLabel)
end program.
4)Once you have the list as a macro call, or a “TO” list or a cut-and-paste
string, a command similar to the following approaches
ADD VARIABLE LABELS !SomeList
3 “”.
ADD VARIABLE LABELS SomeVar TO SomeOtherVar
3 “”.
ADD VARIABLE LABELS SomeVar1 SomeOtherVar AnotherVar AdditionalVar Apple
orange cherry
3 “”.
Hope this helps.
-----
Art Kendall
Social Research Consultants
--
Sent from:
http://spssx-discussion.1045642.n5.nabble.com/=====================
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
Art Kendall
Social Research Consultants