|
Kevin:
Is this what you want?
** sample data.
DATA LIST FREE /MER PID Seis area.
BEGIN DATA
6 1 0 .14
6 2 0 .80
6 3 0 14.27
6 4 0 14.07
6 4 1 .15
6 5 0 .65
6 5 1 .09
END DATA.
AGGREGATE OUTFILE = *
MODE = ADDVARIABLES
/BREAK = mer pid
/tot_area = SUM(area).
DO IF seis = 0.
COMPUTE corfac = area / tot_area.
END IF.
EXECUTE.
The above code gives you the percentage of each case when seis = 0 for
each combination of MER - PID. (If you have multiple cases with seis = 0
within a combination of MER - PID, this will require adjustment.)
--cheers
jim
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Kevin Bladon
Sent: Monday, September 25, 2006 11:31 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: Percentages of cases in one category
This solution only provides an output that tells me the percentage of
Mer and PID that is in each Seis category... For example...
Mer PID Seis Area PIN_Seis
6 1 0 .14 100
6 2 0 .80 100
6 3 0 14.27 100
6 4 0 14.07 50
6 4 1 .15 50
6 5 0 .65 50
6 5 1 .09 50
However, I want the percentage of Area in Seis 0
Thanks,
kevin
-----Original Message-----
From: Melissa Ives [mailto:mives@chestnut.org]
Sent: September 25, 2006 10:18
To: Kevin Bladon
Subject: RE: [SPSSX-L] Percentages of cases in one category
Sounds like you want to aggregate on Mer and PID with a percentage in
(PIN) where SEIS=0.
Melissa
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Kevin Bladon
Sent: Monday, September 25, 2006 11:07 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: [SPSSX-L] Percentages of cases in one category
Hello all,
For the data set below I am trying to create a new output that will sum
Area by Mer and PID, while creating a new column called CorFac
(Correction
Factor) that will be the percentage of the total area of each Mer and
PID that is comprised of Seis equal to 0. Ideas? Suggestions?
Mer PID Seis Area
6 1 0 .14
6 2 0 .80
6 3 0 14.27
6 4 0 14.07
6 4 1 .15
6 5 0 .65
6 5 1 .09
Thanks in advance!
kevin.
PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee or
agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination, copying or
publication of this transmittal is strictly prohibited. If you have
received this transmittal in error, please notify us immediately by
replying to the sender and delete this copy from your system. You may
also call us at (309) 827-6026 for assistance.
|