"raking" syntax

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"raking" syntax

leora lawton
Does anyone have syntax for 'raking' or something
known as multiway post-stratification?  I have a SAS*
macro but I really could use it in spss.

thanks
leora


* A SAS Macro for Balancing a Weighted Sample
http://www.asu.edu/sas/sugi25/



Dr. Leora Lawton
TechSociety Research
"Custom Social Science and Consumer Behavior Research"
2342 Shattuck Avenue PMB 362, Berkeley, CA  94704
(510) 548-6174; fax (510) 548-6175; cell (510) 928-7572
[hidden email]
www.techsociety.com
Reply | Threaded
Open this post in threaded view
|

Re: "raking" syntax

Peck, Jon
The Bonus Pack, which was sent to early adopters of SPSS 15, contains a Python implementation of a raking procedure in the new module rake.py.  It fits a main-effects log linear model and calculates weights accordingly after various adjustments.

The Bonus Pack modules, which require SPSS 15, will be generally available on SPSS Developer Central next week.  The raking module in particular requires the SPSS Advanced Models option because it uses GENLOG as part of its calculations.

Here is an example of using it for a two-dimensional model.  In the example, there are proportions for values 0 and 1 of variables x and y, and the new variable finalwt is calculated.
begin program.
import spss, spssaux, rake

spssaux.OpenDataFile("c:/spss15proj/program/rakingrawdata.sav")

rake.rake(['x', 'y'], [{0:50, 1: 25}, {0:40, 1:35}], 'finalwt')
end program.

HTH,
Jon Peck



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of leora lawton
Sent: Wednesday, November 01, 2006 10:47 AM
To: [hidden email]
Subject: [SPSSX-L] "raking" syntax

Does anyone have syntax for 'raking' or something
known as multiway post-stratification?  I have a SAS*
macro but I really could use it in spss.

thanks
leora


* A SAS Macro for Balancing a Weighted Sample
http://www.asu.edu/sas/sugi25/



Dr. Leora Lawton
TechSociety Research
"Custom Social Science and Consumer Behavior Research"
2342 Shattuck Avenue PMB 362, Berkeley, CA  94704
(510) 548-6174; fax (510) 548-6175; cell (510) 928-7572
[hidden email]
www.techsociety.com