VARSTOCASES command

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

a1s2
Posts: 1
Joined: Sun Nov 10, 2013 12:45 pm

VARSTOCASES command

Postby a1s2 » Sun Nov 10, 2013 2:29 pm

Hello,

I am working with longitudinal data and coding a VARSTOCASES syntax in order to "turn variables to cases" for longitudinal analysis.

I have some variables that need to appear on some row (time points), but not on others.
How do I write the code? do i insert dummy variables for each row in which they're not to appear? or is there a shorter, more elegant way?

for a short demonstration of what i mean, please see example. this is how i want it to look like at the end (ID=participant, Time=time point, 1-2-3= variables, X= a time point at which this variable was sampled, .= missing variable, not sampled at this time):

ID Time 1 2 3
1 1 X . X
1 2 . X .
1 3 . X X
1 4 . . .
2 1 X . X
2 2 . X .
2 3 . X X
2 4 . . .
3 1 X . X
3 2 . X .
3 3 . X X
3 4 . . .
4 1 X . X
4 2 . X .
4 3 . X X
4 4 . . .
5 1 X . X
5 2 . X .
5 3 . X X
5 4 . . .





thanks

Who is online

Users browsing this forum: No registered users and 1 guest

cron