Hi and question 1 of 3

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Hi and question 1 of 3

Neda Faregh
Hi all,

I just joined the list and am hoping to get some help with 3 questions:

Here is question 1:

1- How do I create a proportion variable in SPSS?

Details: I need to know the proportion of cases with disease in  separate
locations.

This is simple enough but so far I've had to do the calculations by hand
because I cannot get SPSS to do it.

Variables Total =total at risk (derived variable where those who are at risk
are coded one, others are coded as sysmiss)

Diseased = those with disease (derived variable where those who have the
disease are coded one, others are coded as sysmiss)

I need to create a Proportion variable for each of the locations where

Proportion = diseased/total at risk * 100

How do I do that without getting 100 or missing for all my observations?

 

Thank you very much,

 

Neda

 

 

 

====================To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re:Hi and question 1 of 3

Jerabek Jindrich
Hi,

to avoid the results for 100 or sysmis - first of all get rid of the sysmis in your variables. Then make your tabulation, frequency, description.... It is easier without sysmis in data. For SPSS it is natural to code 1-yes 0-no, rather than sysmis=No.

RECODE total diseased (sys=0) (else=copy).

Then  use aggregate command:
AGGREGATE
  /OUTFILE=*
  /BREAK=location
  /total_1 = SUM(total) /diseas_1 = SUM(diseased).

It replaces your dataset (SAVE data before running ) with sums of Total and Diseased for every location. Because diseased is coded as 1, sum = number of people in danger or diseased. Last-divide diseased/total.

Btw the AGGREGATE would work without recoding sysmis, but you should recode the original variables anyway, it is a good practice.

regards
Jindra


> ------------ Původní zpráva ------------
> Od: Neda Faregh <[hidden email]>
> Předmět: Hi and question 1 of 3
> Datum: 02.7.2008 19:43:32
> ----------------------------------------
> Hi all,
>
> I just joined the list and am hoping to get some help with 3 questions:
>
> Here is question 1:
>
> 1- How do I create a proportion variable in SPSS?
>
> Details: I need to know the proportion of cases with disease in  separate
> locations.
>
> This is simple enough but so far I've had to do the calculations by hand
> because I cannot get SPSS to do it.
>
> Variables Total =total at risk (derived variable where those who are at risk
> are coded one, others are coded as sysmiss)
>
> Diseased = those with disease (derived variable where those who have the
> disease are coded one, others are coded as sysmiss)
>
> I need to create a Proportion variable for each of the locations where
>
> Proportion = diseased/total at risk * 100
>
> How do I do that without getting 100 or missing for all my observations?
>
>
>
> Thank you very much,
>
>
>
> Neda
>
>
>
>
>
>
>
> ???????
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>
>
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD