I have a lot of numeirc type data to combine. It seems that the string type variable is more convenient to deel with. Is there any method that can convert the spss variable type from numeric to string without changing the value labels?
Thank you very much! 致 礼! 马远新 --------------------------------- Mp3疯狂搜-新歌热歌高速下 |
At 10:11 PM 9/24/2006, ma yuanxin wrote:
>I have a lot of numeirc type data to combine. It seems that the string >type variable is more convenient to deel with. Is there any method >that can convert the spss variable type from numeric to string without >changing the value labels? There isn't an easy way. You have to, . Rename all the numeric variables . Create new string variables with the old names . Compute the string values from the former numeric values, say with function STRING . List the value labels from the old variables . Generate the new VALUE LABELS syntax, making sure it specifies string rather than numeric values, and run it AND, probably . Delete the numeric variables You can do this with Python in SPSS 14 or 15; by more complicated methods, in older versions. But, think twice whether you want to. Post why you find that "the string type variable is more convenient to deal with." Most of us find numeric variables easier, for categorical variables using VALUE LABELS; we will likely have suggestions for you. |
In reply to this post by ma yuanxin
If the reason is that you prefer to see the label when looking at the
data, you may want to click the value labels icon in the data editor toolbar. It is generally second from the end and looks like a tie-on price tag. Or click View -- Value Labels. Just a thought... Melissa -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Richard Ristow Sent: Monday, September 25, 2006 3:47 PM To: [hidden email] Subject: Re: [SPSSX-L] variable type convert At 10:11 PM 9/24/2006, ma yuanxin wrote: >I have a lot of numeirc type data to combine. It seems that the string >type variable is more convenient to deel with. Is there any method that >can convert the spss variable type from numeric to string without >changing the value labels? There isn't an easy way. You have to, . Rename all the numeric variables . Create new string variables with the old names . Compute the string values from the former numeric values, say with function STRING . List the value labels from the old variables . Generate the new VALUE LABELS syntax, making sure it specifies string rather than numeric values, and run it AND, probably . Delete the numeric variables You can do this with Python in SPSS 14 or 15; by more complicated methods, in older versions. But, think twice whether you want to. Post why you find that "the string type variable is more convenient to deal with." Most of us find numeric variables easier, for categorical variables using VALUE LABELS; we will likely have suggestions for you. PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an employee or agent authorized to deliver such transmittals to the designated recipient, you are hereby notified that any dissemination, copying or publication of this transmittal is strictly prohibited. If you have received this transmittal in error, please notify us immediately by replying to the sender and delete this copy from your system. You may also call us at (309) 827-6026 for assistance. |
Free forum by Nabble | Edit this page |