LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2011)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 9 Jun 2011 14:10:39 -0600
Reply-To:   Jon K Peck <peck@us.ibm.com>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Jon K Peck <peck@us.ibm.com>
Subject:   Re: automatic dummy coding
Comments:   To: drfg2008 <kontakt@datest.de>
In-Reply-To:   <1307649372607-4474075.post@n5.nabble.com>
Content-Type:   multipart/alternative;

vls = spssaux.VariableDict('x').ValueLabels returns a Python dictionary of the value labels for variable x (case sensitive). You could then iterate through that via value, label = vls.items() and do whatever you want with those labels.

You can also use the Dataset class for full dictionary access

I'm still not sure of the goal, but note that the SPSSINC CREATE DUMMIES will create a vector of dummy variables for a variable and will assign the value labels of the input variable as the variable labels of the output.

HTH,

Jon Peck Senior Software Engineer, IBM peck@us.ibm.com new phone: 720-342-5621

From: drfg2008 <kontakt@datest.de> To: SPSSX-L@LISTSERV.UGA.EDU Date: 06/09/2011 01:59 PM Subject: Re: [SPSSX-L] automatic dummy coding Sent by: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>

My question was obviously misleading. Sorry. I just can't find a solution how to take the value labels of the original variable and use it as a variable label for the dummy variables. I thought there might be a solution in python by using an array (similar to what is described on the SPSS-IBM website - see below).

array=[] while i < FileN: label = spss.GetVariableLabel(i) array.append(label) i+=1 print array

Does something exist like: spss.GetValueLabel(i) ?

Thanks and sorry again.

----- Dr. Frank Gaeth FU-Berlin

-- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/automatic-dummy-coding-tp4473014p4474075.html

Sent from the SPSSX Discussion mailing list archive at Nabble.com.

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (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


[text/html]


Back to: Top of message | Previous page | Main SPSSX-L page