```Date: Fri, 18 Feb 2005 15:48:20 -0500 Reply-To: Art@DrKendall.org Sender: "SPSSX(r) Discussion" From: Art Kendall Organization: Social Research Consultants Subject: Re: simple spss questions Comments: To: Umesh Persad In-Reply-To: <4215F7C0.3050201@cam.ac.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed did you try something like this? weight by weights. frequencies vars=disease1 to disease3 . . Art Art@DrKendall.org Social Research Consultants University Park, MD USA (301) 864-5570 Umesh Persad wrote: > Dear List Members, > I am having a bit of trouble figuring out how to do a simple > calculation in SPSS. > My data is in the form of: > > Age Sex Disease1 Disease2 Disease 3 Disease4 Weights > 20 1 1 0 1 > 0 200 > 22 2 0 0 1 0 > 800 > ... > > The data file also contains weights for each case, so I created new > disease > variables by multiplying the existing varibles by the weights. All I > want to do is > sum the values in each variable, and to find the proportion of people > with a disease > by dividing by the sum of the weights variable. I also want to do this > analysis splitting > the data set into age bands, and finding the proportions of people with > different diseases > in different age groups. Finally, I want to draw a line graph showing > this (proportions on the > y axis, diseases on the x axis and lines for proportions in 5 age bands > for comparison). > > I did it in excel by simply adding every weighted disease column, and > dividing by the > sum of the weights column to get the proportions using a formula. So I > finally ended > up with a table like: > > DISEASE All age groups 0-20yrs 21-40yrs ... > Disease1 10% 23.8% 20% > Disease2 20% ... ... > > I did this in a hurry because I could not figure out how to do it in > SPSS at the time. > Since I am learning SPSS, I was wondering how it would be done with > syntax? > > Thank you very much, > Umesh Persad > > ```

Back to: Top of message | Previous page | Main SPSSX-L page