seeking help with file restructure/or as output table - reply

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

seeking help with file restructure/or as output table - reply

thara vardhan-2
Hi Richard

Thank you so much for helping me with the syntax to solve my data problem.
I truly appreciate your prompt help and assistance in solving the problem.
 I would like to convey my heartfelt thanks to Monicam and Simon Friedin
too, for responding to my question.

The following syntax is working fine but due to the text format of the
variable 'incident categories' I get several warnings (some of which are
listed below). However since the value lables have the description and
there aren't many such variables in my data file, I edited and  renamed
them.

COMPUTE #Length = LENGTH(RTRIM(Incident_category)).
COMPUTE Incident_category =
                   REPLACE(Incident_category,' ','_').
COMPUTE Incident_category =
                   SUBSTR (Incident_category,1,#Length).
LIST.

CASESTOVARS
    /ID   =Person_CNI
    /INDEX=Incident_category.

exe.

Sevaral Warnings:

CASES TO VARS created the name "ANIMALS_-_PREVENTION_OF_CRUEL" for a new
variable. That name contains at least one blank or other character that is
not valid in SPSS variable names, so "v1" will be used instead.

CASES TO VARS created the name "CROWD_CONTROL_/_MANAGEMENT" for a new
variable. That name contains at least one blank or other character that is
not valid in SPSS variable names, so "v2" will be used instead.

CASES TO VARS created the name "LIQUOR_&_REGISTERED_CLUB_ACT" for a new
variable. That name contains at least one blank or other character that is
not valid in SPSS variable names, so "v6" will be used instead.

CASES TO VARS created the name "POWERS_-_VEHICLE_SEARCH" for a new
variable. That name contains at least one blank or other character that is
not valid in SPSS variable names, so "v10" will be used instead.

I just wanted to share this with other SPSSX-L members,  who may have
faced a similar situation while working with text data.
thanks

regards
Thara Vardhan
Senior Statistician
Planning & Results
Organisation Review and Support
NSW Police
Tel: (02) 8835-8526


This message and any attachment is confidential and may
be privileged or otherwise protected from disclosure. If you
have received it by mistake, please let us know by reply
and then delete it from your system; you should not copy
the message or disclose its contents to anyone.
Reply | Threaded
Open this post in threaded view
|

Re: seeking help with file restructure/or as output table

Richard Ristow
At 12:12 AM 8/24/2007, Thara Vardhan wrote:

>Hi Richard
>
>Thank you so much for helping me with the syntax to solve my data
>problem. I truly appreciate your prompt help and assistance in solving
>the problem.  I would like to convey my heartfelt thanks to Monicam
>and Simon Friedin too, for responding to my question.

And, you're most welcome.

>The following syntax is working fine but due to the text format of the
>variable 'incident categories' I get several warnings (some of which
>are listed below).
>
>CASESTOVARS
>     /ID   =Person_CNI
>     /INDEX=Incident_category.
>
>Several Warnings[, such as]:
>
>CASES TO VARS created the name "ANIMALS_-_PREVENTION_OF_CRUEL" for a
>new variable. That name contains at least one blank or other character
>that is not valid in SPSS variable names, so "v1" will be used instead.

It sounds like you're all set. There are, however, two variations on
this strategy:

a. Make all the values of "Incident_category" valid as SPSS variable
names, by adding code to replace "-",, "/", "&", etc., with something
else, as in the code I gave you that replaces blanks with "_".

b, and I might do it this way: Make all the values of
"Incident_category" INvalid as SPSS variable names, say by putting a
"-" at the beginning, so you'll have a numbered series of variables (v1
to v<whatever>) with explanatory variable labels.

Cheers, and ever onward,
Richard