Login  Register

Re: computing a variable when the data is in long format

Posted by David Marso on Jun 02, 2015; 4:19am
URL: http://spssx-discussion.165.s1.nabble.com/computing-a-variable-when-the-data-is-in-long-format-tp5729702p5729703.html

See the AGGREGATE command.
MODE  & FIRST subcommands will be handy.

AGGREGATE OUTFILE * MODE ADDVARIABLES /BREAK id  / cov= FIRST(depvar).

Apply obvious substitutions.
______________________________

Carol Ma wrote
Hi there,

Is anyone please able to help me with syntax to calculate a new variable? I have a dataset with 3 repeated measures, which I have already converted to long format. However, I have now realised that I probably should be adjusting my between group repeated measures analyses for baseline values. Thus I need to create a new variable with just the baseline values in it, to use as a covariate in the analysis.

Thus I need a new column, with just the timepoint 1 value, repeated three times, for each participant. Is there a way of doing this without coverting back to wide format, calculating the variable, and reconverting to long format?

thanks for any help you are able to offer,

Carol

PS I am using SPSS 22
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"