recoding problem

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

recoding problem

Suzanne Rebecca Neusteter-2
Hi,

I have a dataset that includes a variable (mnthintrvl), which contains values 1-108. This represents groupings of approximately 30 days. I want to compute a new variable that combines mnthintrvl with another variable that indicates whether an event occurred (incident1) for all 108 categories.

I keep trying variations of the following syntax, but continue to get operator command errors. Can someone help me figure out what I'm missing?

Thanks for your help!

IF ((mnthintrvl = 1 &  incident1 = 1) mnthlcrmrt = 1) ((mnthintrvl = 2 &  incident1 = 1) mnthlcrmrt = 2) ((mnthintrvl = 3 &  incident1 = 1) mnthlcrmrt = 3)....((mnthintrvl = 108 &  incident1 = 1) mnthlcrmrt = 108)
EXECUTE .

Reply | Threaded
Open this post in threaded view
|

Re: recoding problem

William Dudley WNDUDLEY

Suzanne,
Maybe I am missin gsomethign here
But if  mmnthintrvl and incident are numeric, and if 1 = yes and 0 = no then could you simply

COMPUTE mnthlcrmrt =  mmnthintrvl * incident.

??





Suzanne Rebecca Neusteter <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>

05/07/2009 12:31 PM

Please respond to
Suzanne Rebecca Neusteter <[hidden email]>

To
[hidden email]
cc
Subject
recoding problem





Hi,

I have a dataset that includes a variable (mnthintrvl), which contains values 1-108. This represents groupings of approximately 30 days. I want to compute a new variable that combines mnthintrvl with another variable that indicates whether an event occurred (incident1) for all 108 categories.

I keep trying variations of the following syntax, but continue to get operator command errors. Can someone help me figure out what I'm missing?

Thanks for your help!

IF ((mnthintrvl = 1 &  incident1 = 1) mnthlcrmrt = 1) ((mnthintrvl = 2 &  incident1 = 1) mnthlcrmrt = 2) ((mnthintrvl = 3 &  incident1 = 1) mnthlcrmrt = 3)....((mnthintrvl = 108 &  incident1 = 1) mnthlcrmrt = 108)
EXECUTE .