Creating New Variables/Sorting Data

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

Creating New Variables/Sorting Data

Nyougo Omae.
Hello,

I am analysing some data and run into some problems. I have student data that has an ID that combines a school identifier and a classroom identifier. For instance A3001 would be student 1 in class 3 and in school A; and B2003 would be student 3 in class 2 and school B. Is there a way in SPSS that I could sort these data according to each category or even create new variables?

Thank you.

Hilda.
Reply | Threaded
Open this post in threaded view
|

Re: Creating New Variables/Sorting Data

Maguin, Eugene
Hilda,

String school(a1).
Compute school=substr(id,1,1).
Compute class=number(substr(id,2,1),f1.0).
Compute student=number(substr(id,3,3),f3.0).

It would be good to read up on these functions. They are described in the
Univesals section of the syntax reference pdf.

Gene Maguin