Date: Fri, 13 Dec 2002 11:17:49 +0000
Reply-To: Paul Mcgeoghan <Mcgeoghan@Cardiff.ac.uk>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Paul Mcgeoghan <Mcgeoghan@Cardiff.ac.uk>
Subject: Re: string function
Content-Type: text/plain; charset=US-ASCII
Ta,
Figured it out in the meantime along similar lines.
Yeah, I know, been studying stats too long, applying it my social life now :).
Paul
==================
Paul McGeoghan,
Application support specialist
(Statistics and Databases),
Information Services,
Cardiff University.
Tel. 02920 (875035).
>>> "R. Allan Reese" <R.A.Reese@gri.hull.ac.uk> 13/12/2002 11:14:11 >>>
On Fri, 13 Dec 2002, Paul Mcgeoghan wrote:
> I have data in a column read from a CSV file such as:
>
> (Pubs,Nightclubs,Taxis)
> (Pubs,Taxis)
> (Pubs,Nightclubs,Taxis)
> (Taxis)
>
> for the first 10 observations.
>
> How can I separate this into 3 different variables such as Choice1, Choice2,
> Choice3 or even better a variable Pubs, Nightclubs and Taxis which would be
> Yes/No for each?
Read your data as one string variable, called, say nightout, then:
compute pubs=0.
if (index(nightout,"Pubs") ne 0) pubs=1.
or, more concisely but less easy to read:
compute pubs= index(nightout,Pubs) ne 0.
which returns true or false. For either, then
value labels pubs 1 "Yes" 0 "No".
same for clubs and taxis. But do you *have* to analyse your social life
in such detail?!
R. Allan Reese Email: r.a.reese@gri.hull.ac.uk
Associate Manager GRI Direct voice: +44 1482 466845
Graduate School Voice messages: +44 1482 466844
Hull University, Hull HU6 7RX, UK. Fax: +44 1482 466436
====================================================================
The management here were SO impressed with W Edward Deming's "Out of
the crisis" that they are working flat out to create THE BEST crisis,
so we can start implementing the 13 points.
|