Hi all,
I want to write a syntax to compute a group of indices. Each index is
a result of dividing 2 numbers. Each number is the average of a
variable. My variables are displayed in columns in an spss datafile. i
have so many variables and i need to compute so many indices. The
question is , how can I write a syntax, so that this syntax:
1-computes the average of the required variables
2-gets these averages and divided them by each other
3- displays the final result in an spss datafile
Waiting for your reply,
Thanks,
A.A.A
|
|
0
|
|
|
|
Reply
|
ayafeps (6)
|
11/10/2009 10:05:38 PM |
|
On Nov 10, 2:05=A0pm, "A.A.A" <ayaf...@yahoo.com> wrote:
> Hi all,
> I want to write a syntax to compute a group of indices. Each index is
> a result of dividing 2 numbers. Each number is the average of a
> variable. My variables are displayed in columns in an spss datafile. i
> have so many variables and i need to compute so many indices. The
> question is , how can I write a syntax, so that this syntax:
>
> 1-computes the average of the required variables
> 2-gets these averages and divided them by each other
> 3- displays the final result in an spss datafile
>
> Waiting for your reply,
> Thanks,
> A.A.A
Please write like, first column is x1 x2 x3, second column is y1 y2
y3, the third column is z1 z2 z3 in SPSS data table and state it
clearly what you want from it. Then I can help.
Frank
clearly, what you
|
|
0
|
|
|
|
Reply
|
Frank
|
11/13/2009 3:41:46 PM
|
|
I can help you with the first part, having no assumptions about your
knowledge of spss whether it is basic or otherwise:
1) To compute average of your variables, use COMPUTE
COMPUTE "variable name here"=3D MEAN(var1, var2, var3, etc)
"variable name here" is what you can label your new variable, and
inside the parentheses, you want to put in the variables where you
want to get an average.
Compute function can do a number of different computations.
This link might give some insight into the other ones:
http://www.ats.ucla.edu/stat/Spss/modules/functions.htm
I think if you have this compute function, you should be able to do
some problem solving on your own to figure out the next steps with the
file that you have.
To get your variables to divide against each other, you might need to
spread out your data a bit based on some condition with what you know
about which numbers divide against the others.
One last piece of advice is: every time you want to do something to
the data, it's good practice to create another variable and have the
computation listed there. Just make sure your variables have names
that you can recognize.
On Nov 10, 2:05=A0pm, "A.A.A" <ayaf...@yahoo.com> wrote:
> Hi all,
> I want to write a syntax to compute a group of indices. Each index is
> a result of dividing 2 numbers. Each number is the average of a
> variable. My variables are displayed in columns in an spss datafile. i
> have so many variables and i need to compute so many indices. The
> question is , how can I write a syntax, so that this syntax:
>
> 1-computes the average of the required variables
> 2-gets these averages and divided them by each other
> 3- displays the final result in an spss datafile
>
> Waiting for your reply,
> Thanks,
> A.A.A
|
|
1
|
|
|
|
Reply
|
Clara
|
11/14/2009 8:41:32 AM
|
|
|
2 Replies
842 Views
(page loaded in 0.058 seconds)
|