Dear List members
I have file with 190792 records. I have to reduce the file size by using the measure offencesla. I tried doing it through aggregate - Mode ADD variables - break variable Uniquepersonid, summary variable offencesla (sum). I also tried to aggregate the file again by creating a new file with all variables in the break variable and offences (sum) in the summary variable. Since the method of proceeding and Offence ANSZOC are different for each Uniquepersonid I also tried through break variable by 3 variables unqiuepersonid, methodofproceeding and offenceANZSOC. My data is structured as follows: DUMMY DATA STATE UniquePersonID DateofAction ProceedingID Methodofproceeding OffenceANZSOC Dateofbirth Sex IndigenousStatus OffencesLA 1 12345678 10.12.2012 12345 110 1022 1 1 1 12345678 10.12.2012 12345 110 1041 1 2 1 22347868 12.10.2012 35678 110 1219 1 1 1 22347868 12.03.2013 35678 250 1624 1 1 1 88994455 12.19.2012 334455 110 1523 1 3 1 88994455 14.03.2013 334455 110 1523 1 2
|
it is very helpful to
post what your data look like before. Would you please post what
you would like the data to look like after.
Art Kendall Social Research ConsultantsOn 10/2/2013 11:12 PM, Thara Vardhan [via SPSSX Discussion] wrote: Dear List members
Art Kendall
Social Research Consultants |
Administrator
|
In reply to this post by thara vardhan-2
I bet we might be very helpful after you post what the data should look like after the restructuring ;-)
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by thara vardhan-2
Thara, Really depends on what you are trying to do, but MODE=ADDVARIABLES simply adds your aggregated values to the end of each record, so it doesn’t reduce the number of records
nor file size … it looks like you simply want to aggregate by offender ID? If so, then… * Australian and New Zealand Standard Offence Classification. DATA LIST FREE / STATE (F1) UniquePersonID (F10) DateofAction (DATE9) ProceedingID (F10) Methodofproceeding (F3) OffenceANZSOC (F3) Dateofbirth (DATE9) Sex (F1) IndigenousStatus (F1). * Test data. BEGIN DATA. 1 12345678 10.12.2012 12345 110 1022 14.05.1995 1 1
1 12345678 10.12.2012 12345 110 1041 14.05.1995 1 2
1 22347868 12.10.2012 35678 110 1219 14.05.1975 1 1
1 22347868 12.03.2013 35678 250 1624 05.05.1975 1 1
1 88994455 12.07.2012 334455 110 1523 05.05.1985 1 3
1 88994455 14.03.2013 334455 110 1523 05.05.1985 1 2 1 88994455 12.03.2013 334455 250 1624 05.05.1985 1 1 END DATA. * Produces a basic working file with offence counts by ID – you don’t want to sum, you want a count of the codes. AGGREGATE OUTFILE = * /BREAK=UniquePersonID /OffencesLA = N(OffenceANZSOC). DATASET NAME ANZSOC WINDOW=FRONT. Copy this into a syntax window and experiment. HTH, Bob Walker Surveys & Forecasts, LLC From: SPSSX(r) Discussion [mailto:[hidden email]]
On Behalf Of Thara Vardhan Dear List members
STATE UniquePersonID DateofAction ProceedingID Methodofproceeding OffenceANZSOC Dateofbirth Sex IndigenousStatus OffencesLA
1 12345678 10.12.2012 12345 110 1022 1 1
1 12345678 10.12.2012 12345 110 1041 1 2
1 22347868 12.10.2012 35678 110 1219 1 1
1 22347868 12.03.2013 35678 250 1624 1 1
1 88994455 12.19.2012 334455 110 1523 1 3
1 88994455 14.03.2013 334455 110 1523 1 2
|
Free forum by Nabble | Edit this page |