data organisation; extending variable values to new cases

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

Posts: 1
Joined: Fri Dec 02, 2011 11:13 pm

data organisation; extending variable values to new cases

Postby eeeparsnip » Fri Dec 02, 2011 11:35 pm

This is a somewhat tricky one to descibre, but I am banging my head against the wall about it - maybe someone here can help.
Problem: My data is a continuous log-file from a psych. experiment with two parts. In the first part, var1 (numerical) is matched with var2 (string). In the third part, Var3 (string) is filled in. The file looks something like this:


What I need is have Var1 filled in also for the second part, so that I'd obtain:


I.e., Var1 needs to be filled in also within the second part of the file (now empty), with the same values it had for the first part, listed in Var2.
I feel my data would have to be reorganised in some way, but I am unsure how. Any help would be highly appreciated!
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: data organisation; extending variable values to new case

Postby GerineL » Wed Dec 07, 2011 2:04 pm

look into lag (transform -> shift values) and then use compute (or if-function) to add the original and lagged variable together.
it is tricky though, because it very much depends on how your file is sorted, how many entries there are for each case and so on...

Who is online

Users browsing this forum: No registered users and 3 guests