using do repeats

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

bennon
Posts: 3
Joined: Sun May 18, 2014 2:31 pm

using do repeats

Hello,
I need some help with computing variables using do repeats. it's a daily-diary dataset in which I have variable X and variable Y measured on on 7 consecutive days. What I want to do is compute the mean Y one time only for days in which X is lower than the mean X (across all days), and one time when X is higher than the mean of X.
I can't understand how to this. if anyone can help with the syntax for this, that would great and appreciated.
Thanks
Ben
RubenGeert
Posts: 100
Joined: Mon May 19, 2014 6:06 am

Re: using do repeats

Dear Ben,

For a basic tutorial with some examples on DO REPEAT, see http://www.spss-tutorials.com/do-repeat/.

How are your data structured? Could you perhaps upload a screenshot in which we can see the arrangement?

Kind regards,

Ruben Geert van den Berg
www.spss-tutorials.com
bennon
Posts: 3
Joined: Sun May 18, 2014 2:31 pm

Re: using do repeats

Thank you Ruben. The data is organized such that each subject has 7 rows (days). and for each day there is a value for X and a value for Y. and then I want to compute mean X for each subject, and then, for each subject I want to compute 2 new variables reflecting the mean Y for days in which X was below the subject's mean of X and mean of Y for days in which X was above the subject's mean of X. essentially turning it into dataset in which each subject has one row

I am having troubles uploading a file with a screenshot but I hope this helps to clarify...
RubenGeert
Posts: 100
Joined: Mon May 19, 2014 6:06 am

Re: using do repeats

OK. If I understand correctly, you need to

1 - AGGREGATE with MODE ADDVARIABLES (see http://www.spss-tutorials.com/aggregate/), creating the mean scores per case
2 - Conditionally pass values on X and Y into two new variables using IF statements (For an "IF" example, see second exampe of http://www.spss-tutorials.com/combining ... s-in-spss/)
3 - AGGREGATE again without MODE ADDVARIABLES, reducing the rows to the number of cases

Does that bring you any further?

Kind regards,

Ruben Geert van den Berg
www.spss-tutorials.com
bennon
Posts: 3
Joined: Sun May 18, 2014 2:31 pm

Re: using do repeats

Yes! thank you very very much..
Ben

Who is online

Users browsing this forum: No registered users and 4 guests