| Date: | Sat, 9 Apr 2011 15:44:56 +0200 |
| Reply-To: | targetlinkmark@gmail.com |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | Mark Webb <targetlinkmark@gmail.com> |
| Subject: | Re: Saving numeric data with value labels as strings. |
|
| In-Reply-To: | <fde1a2.bbe.12f3a2c1640.Webtop.0@cox.net> |
| Content-Type: | text/plain; charset=UTF-8; format=flowed |
Thank you David - this is exactly what I need.
This will save me switching between Excel and SPSS which I'm always a
bit nervous about.
A great solution - thanks.
On 2011/04/09 02:10 PM, coxspss@cox.net wrote:
> Mark,
>
> It sounds like you want to replace within the sav data file the
> numeric with string values based on your value labels. We often have
> to do a similar process when we upload data tables to our oracle
> producttion systems, the sql folks need the descriptor and not the
> value. Try the following which I learned from this listserv:
>
> string varx (a1).
> compute varx =valuelabel(vary).
>
>
> So if you have a column of 1=male and 2=female called sex then it
> would be (the column must have value labels assigned):
>
> string sex_desc(a6).
> compute sex_desc=valuelabel(sex).
>
> This will leave leave both your numeric and your string form in the
> data file. If you wish to remove the numeric then you can use DELETE
> VARIABLE or MATCH FILES file=* /drop=sex.
>
> David,
>
>
>
>
>
> On Sat, Apr 9, 2011 at 6:43 AM, Mark Webb wrote:
>
> Hi Albert-Jan
>
> Just looked at your suggestion and it's not exactly what I'm
> looking for.
>
> The problem is that Save Translate wants to translate from the
> normal .sav to some other format.
>
> I want to remain in .sav format.
>
>
>
> Basically what I'm trying to do is to make numeric variables into
> strings so that I can concat them and was thinking that the strings
> are basically the value labels.
>
>
>
> So I will have a variable like sex which is numeric with value
> labels and I want to make a variable in the same SPSS file called say
> sexstring which will be a string representing the value label - Male
> or Female.
>
>
>
> Is this clearer?
>
>
>
> [BTW - Save Translate has a /cell = labels options according to
> my syntax reference.]
>
> Mark Webb
>
> Line +27 (21) 786 4379
> Cell +27 (72) 199 1000
> Fax to email +27 (86) 5513075
> Skype webbmark
> Email targetlinkmark@gmail.com <mailto:targetlinkmark@gmail.com>
>
>
> On 2011/04/09 11:47 AM, Albert-Jan Roskam wrote:
>
>
> Yes, you can do that by adding VALUES=LABELS to the SAVE
> TRANSLATE command. Check out the syntax reference manual for
> details.
>
>
>
>
> Cheers!!
>
> Albert-Jan
>
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> All right, but apart from the sanitation, the medicine,
> education, wine, public order, irrigation, roads, a fresh water
> system, and public health, what have the Romans ever done for us?
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
>
>
>
>
>
>
> From:
> Mark Webb <targetlinkmark@gmail.com>
> <mailto:targetlinkmark@gmail.com>
>
> To:
> SPSSX-L@LISTSERV.UGA.EDU
> <mailto:SPSSX-L@LISTSERV.UGA.EDU>
>
> Sent:
> Sat, April 9, 2011 11:13:25 AM
>
> Subject:
> [SPSSX-L] Saving numeric data with value labels as
> strings.
>
>
>
> Hi all
>
> I have numeric data with value labels [e.g. 1=Male
> 2=Female]
>
> It's possible to save this to Excel and request that
> the value label is
>
> saved rather than the numeric value.
>
> If one wants the string value label in the SPSS file it
> can read in from
>
> Excel once the variable names have been changed.
>
> Is there a way of saving the value label string of
> numeric variables
>
> directly into new variables with SPSS? i.e. skip Excel
>
>
>
> Regards
>
>
>
> --
>
> Mark Webb
>
>
>
> Line +27 (21) 786 4379
>
> Cell +27 (72) 199 1000
>
> Fax to email +27 (86) 5513075
>
> Skype webbmark
>
> Email targetlinkmark@gmail.com
> <mailto:targetlinkmark@gmail.com>
>
>
>
> =====================
>
> To manage your subscription to SPSSX-L, send a message to
>
> LISTSERV@LISTSERV.UGA.EDU
> <mailto: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
>
>
>
>
>
>
>
>
>
>
>
>
> ===================== 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
>
=====================
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
|