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 1999)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 23 Sep 1999 14:59:40 +0200
Reply-To:     Dirk Enzmann <enzmann@KFN.UNI-HANNOVER.DE>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Dirk Enzmann <enzmann@KFN.UNI-HANNOVER.DE>
Organization: Kriminologisches Forschungsinstitut Hannover e.V.
Subject:      Re: coding challenge
Comments: To: "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
Content-Type: text/plain; charset=us-ascii

David,

perhaps I missed the solution to your problem in the list, but in any case, below you can find one.

By the way: What is the theil-index, and what is its use?

Yours, Dirk

* ----------------------------- .

* assuming your grouping variable is "group" and . * you don't have already the file "aggtemp.dat" in . * your directory "c:\windows\temp" (that exists): .

sort cases by group. AGGREGATE /OUTFILE='C:\windows\temp\aggtemp.dat' /BREAK=group /meany = MEAN(y). MATCH FILES /FILE=* /TABLE='C:\WINDOWS\TEMP\aggtemp.dat' /BY group. EXECUTE.

compute term1=$sysmis. do if meany<>0. + compute term1=(y/meany)*lg10(y/meany). end if. AGGREGATE /OUTFILE='C:\windows\temp\aggtemp.dat' /BREAK=group /ny = N(y) /sumterm1 = SUM(term1). MATCH FILES /FILE=* /TABLE='C:\WINDOWS\TEMP\aggtemp.dat' /BY group. EXECUTE. ERASE FILE='C:\WINDOWS\TEMP\aggtemp.dat'.

compute t=$sysmis. do if ny>0. + compute t = sumterm1/ny. end if. match files /file=* /drop meany term1 sumterm1 ny. execute.

* ---------------------- .

"David W. Wright" wrote: > > I am generating theil indexes for several different groups with a large > data set. For each group it is necessary to acquire both aggregate and > case-level data parameters in order to fully generate the index. The index > formula is: > > T = 1/n * sum [ (yi/y) * log10(yi/y)] > > where n = sample size > yi = income of case > y = average of income for group > > As one can see, it's necessary to have the aggregated mean of the group > under study before one can perform the case-level component. We are > currently doing this in 3 steps (aggregate for group mean, insert group > mean & run at case-level, aggregate again), however, its is very time > consuming and prone to data entry error (since we are manually entering the > group means). > > Ideally it would be nice to have a syntax that would perform the above

> calculations that we could then use for different groups such as > > SELECT IF (X1 eq x) > run syntax to acquire T > > The syntax approach would also easily allow us to upload the syntax to our > mainframe version of SPSS. > > Thanks for any & all the help, we have a ton of these to generate! > > David W. Wright, Ph.D. > Associate Professor > Graduate Coordinator > Wichita State University > Dept. of Sociology, Box 25 > Wichita, Kansas 67260-0025 > > Office phone: 316-978-7157 > Fax: 316-978-3280 > Internet: DWRIGHT@TWSUVM.UC.TWSU.EDU

************************************************* Dr. Dirk Enzmann Criminological Research Institute of Lower Saxony Luetzerodestr. 9 D-30161 Hannover Germany

phone: +49-511-348.36.32 fax: +49-511-348.36.10 email: ENZMANN@KFN.uni-hannover.de

http://sun1.rrzn-user.uni-hannover.de/~n5x5link/ *************************************************


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