How to use the results in outputs to do other computation?

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

KirinGuess
Posts: 5
Joined: Sun May 15, 2016 7:57 am

How to use the results in outputs to do other computation?

Postby KirinGuess » Sun May 15, 2016 8:17 am

Hi everyone,

I wonder whether it is possible to use the results in the output window to do other computation.
For example, after generating a frequency table of a variable, can I extract the male frequency from the table, and use it to generate a new variable?
Something like this:

Code: Select all

FREQUENCY gender.
COMPUTE NewVariable = MaleFrequency.
EXECUTE.
I know there may be other ways around for this, such as using the command aggregate.
But those commands are not available for the old versions of SPSS, such as SPSS 12 or even earlier version.
Therefore, I would like to know some ways that work for almost all versions of SPSS.

Thank you very much.

Kirin
JonPedersen
Posts: 119
Joined: Wed May 25, 2011 7:07 am
Contact:

Re: How to use the results in outputs to do other computation?

Postby JonPedersen » Thu May 19, 2016 9:07 am

Hi,
SPSS does not store the tables in an accessible way. You have basically three options:
1) use the OMS system, that can convert any result into a dataset. Extremely flexible, but a bit complex, and does not exist in very old versions.
2) Use aggregate (which, contrary to what you believe exist in all versions of SPSS on PC platforms (including the DOS version)
3) Use Python (but again, not available in all versions of SPSS)
cheers
Jon
KirinGuess
Posts: 5
Joined: Sun May 15, 2016 7:57 am

Re: How to use the results in outputs to do other computation?

Postby KirinGuess » Thu May 19, 2016 9:10 pm

Hi Jon,

Many thanks for your reply. It is really good to know that the function 'aggregate' exists in all versions of SPSS. Now I have more flexibility for programming. Thanks a lot.

Kirin

Who is online

Users browsing this forum: No registered users and 3 guests

cron