LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2003)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 16 Sep 2003 14:36:20 -0500
Reply-To:     "Marks, Jim" <Jim.Marks@lodgenet.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Marks, Jim" <Jim.Marks@lodgenet.com>
Subject:      Re: need help with aggregation
Content-Type: text/plain; charset="us-ascii"

Patricia:

Add the number of cases for each level to your AGGREGATE. Then use DO REPEAT to calculate the number of cases from the percentages:

** sample data. DATA LIST FREE /id schoolmi grade nroveral. BEGIN DATA 1 1001 3 -1 2 1001 3 1 3 1001 3 1 4 1001 3 2 5 1001 3 2 6 1001 3 3 7 1001 3 2 8 1001 3 4 9 1001 3 0 10 1001 3 0 11 2001 3 0 12 2001 3 0 13 2001 3 1 14 2001 3 1 15 2001 3 -1 16 2001 3 2 17 2001 3 2 18 2001 3 3 19 2001 3 4 20 2001 3 4 21 1001 6 -1 22 1001 6 0 23 1001 6 0 24 1001 6 1 25 1001 6 2 26 1001 6 3 27 1001 6 4 28 1001 6 3 29 1001 6 2 30 2001 6 1 31 2001 6 0 32 2001 6 -1 33 2001 6 1 34 2001 6 1 35 2001 6 1 36 2001 6 2 37 2001 6 2 38 2001 6 3 39 2001 6 4 40 2001 6 4 END DATA.

AGGREGATE OUTFILE = * /BREAK = schoolmi grade /rdgmiss = PIN(nroveral,-1,-1) /rdgne1 = PIN(nroveral,0,0) /rdgl1 = PIN(nroveral,1,1) /rdgl2 = PIN(nroveral,2,2) /rdgl3 = PIN(nroveral,3,3) /rdg3plus =PIN(nroveral,3,4) /rdgl4 = PIN(nroveral,4,4) /students = N.

DO REPEAT x1= rdgmiss TO rdgl4 /y1 = nbrmiss nbrne1 nbreq1 nbreq2 nbreq3 nbrge3 nbreq4. COMPUTE y1 = students/100*x1. END REPEAT. EXECUTE.

Jim Marks Senior Market Analyst LodgeNet Entertainment Corporation

-----Original Message----- From: Patricia Cleland [mailto:Patricia.Cleland@EQAO.com] Sent: Tuesday, September 16, 2003 1:39 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: need help with aggregation

Listers:

I have a data file that contains the assessment information, background and achievement scores, for all grade 3 and grade 6 students in the province of Ontario. The file has about 300,000 records, one for each student. I want to aggregate the data so that I have a file that has one record per school, with the grade 3 and 6 students separate, containing the number and percent of students at each of the provincial achievement levels. I can get the percentages easily using the AGGREGATE command below, where schoolmi is the school id.

AGGREGATE

/OUTFILE=

/BREAK=schoolmi grade

/rdgmiss=PIN(nroveral,-1,-1)

/rdgne1=PIN(nroveral,0,0)

/rdgl1=PIN(nroveral,1,1)

/rdgl2=PIN(nroveral,2,2)

/rdgl3=PIN(nroveral,3,3)

/rdg3plus=PIN(nroveral,3,4)

/rdg4=PIN(nroveral,4,4)

Is there a way to use aggregate to count the number of students at each level? If not, does anyone have any suggestions? I'd prefer having the N's and % in the same file but I can always merge files if that't not possible.

As always, TIA

Pat

------------------------------------------------------------------------ -

Patricia Cleland

Assessment Officer

Assessment and Reporting Unit

Education Quality and Accountability Office

2 Carlton Street, Suite 1200

Toronto, Ontario

M5B 2M9

Phone: (416) 314-7950

Fax: (416) 325-6622

email: patricia.cleland@eqao.com <mailto:patricia.cleland@eqao.com>

<file:///C:\Program%20Files\Common%20Files\Microsoft%20Shared\Stationery \fieruled.gif>


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