Syntax to Create New Variable That Numbers Cases Starting From a Specified Value

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

Syntax to Create New Variable That Numbers Cases Starting From a Specified Value

james.moffitt

I need to number all the cases (rows) in my data file starting from a specified number (for example, the first case would receive a value of 45362, the next case, 45363, etc.).

How would I write the syntax to add a new variable to my data file that accomplishes that?

 

I’m using SPSS 14.0.

 

Thanks for your help.

Reply | Threaded
Open this post in threaded view
|

Re: Syntax to Create New Variable That Numbers Cases Starting From a Specified Value

mpirritano

Newvariable = 45361 + $casenum.

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 02, 2009 5:31 AM
To: [hidden email]
Subject: Syntax to Create New Variable That Numbers Cases Starting From a Specified Value

 

I need to number all the cases (rows) in my data file starting from a specified number (for example, the first case would receive a value of 45362, the next case, 45363, etc.).

How would I write the syntax to add a new variable to my data file that accomplishes that?

 

I’m using SPSS 14.0.

 

Thanks for your help.