Creating new variables with the aggregate command

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

jstauss
Posts: 8
Joined: Thu Jun 07, 2012 9:50 pm

Creating new variables with the aggregate command

Postby jstauss » Wed Jan 29, 2014 7:24 pm

Hi all,

I'm using the aggregate command in syntax to create several new variables. I'm running predictive simulations to have a macro recursively store the aggregated variables in a different data set. However, because of this the aggregated variables are not tied to the individuals from which the aggregated variables are derived. My question is this - can I set up the aggregate command in such a way that it will create a new variable name every time it is run? So, the first time it runs, it would create var_agg1, the second time it would create var_agg2, and so on. Does that make sense?

Thanks all!
jstauss
Posts: 8
Joined: Thu Jun 07, 2012 9:50 pm

Re: Creating new variables with the aggregate command

Postby jstauss » Wed Jan 29, 2014 9:14 pm

As an example of what I mean -

When you run factor analysis and save the scores as variables, you can run the same syntax over and over again. It will simply create a new variable as FAC1_1, FAC1_2, FAC1_3, etc... Any way to apply this to the aggregate command?
jstauss
Posts: 8
Joined: Thu Jun 07, 2012 9:50 pm

Re: Creating new variables with the aggregate command

Postby jstauss » Wed Jan 29, 2014 9:59 pm

Another option would be to somehow take the variables, pre-aggregate, and code them into new variables. So, the end of the macro would take the final variables (and there are only three of them I would need to save) and store them. However, they would need to have some kind of dynamically updating tail, just like the factor analysis example.

I know I keep adding to this post, but I hope it will remind someone of some possibility....
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Creating new variables with the aggregate command

Postby GerineL » Mon Feb 10, 2014 11:20 am

I see what you mean, unfortunately don't know the anser. try contacting pythonforspss.org in private message, he'll probably know.

Who is online

Users browsing this forum: No registered users and 1 guest

cron