Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Which function should I use?

0 views
Skip to first unread message

sophy

unread,
Dec 21, 2009, 2:18:08 AM12/21/09
to
I have a large data file. One of the variables is num_visits (for each
case has values from 1 to 25). I need to create for each case number
of variables as the number of visits and give them a certain value.
For example for num_visits=1 there will be created one variable X1
that will get a certain value. For num_visits=11 - variables X1 to
X11 with certain values. Which function can I use? (SPSS 17).

Emanuel Bohbot

unread,
Dec 21, 2009, 3:52:17 AM12/21/09
to

25 RECODES

Art Kendall

unread,
Dec 21, 2009, 7:16:31 AM12/21/09
to
Try something like this untested syntax. Does this do what you want?

numeric visit1 to visit25(f7.2).
do repeat visit = visit1 to visit25/index= 1 to 25
/certainvalue = 1003.1, 5.22, 123.1, 55.2 ...
do if index le num_visits.
compute visit= certainvalue.
end if.
end repeat.

Art Kendall
Social Research Consultants

0 new messages