Dear SPSS Gurus,
One way to assess the relative bias of an unweighted sample is to compare the unweighted means of a set of variables with the weighted means of the same set of variables. When each difference between the unweighted mean and the weighted mean is subsequently divided by the standard error of the unweighted mean, one obtains an estimate of the bias ratio (B/S) according to Kish's 1992 article in the Journal of Official Statistics. However, getting the weighted and unweighted means into a single table, obtaining their differences, and dividing the differences by their unweighted standard errors is a laborious task because SPSS forces separate runs for weighted and unweighted data. Moreover, manually copying the intermediate results from each run into a single table introduces a lot of chances for errors. Of course, computing the end result (Unweighted Xbar - Weighted Xbar / ste of Unweighted Xbar) is trivial after one has the components in place. Is there some way to automate this procedure so that one can get the end result without multiple runs and manual copying? In other words, is there a way to capture all of the relevant statistics in one place so that the final computation can be readily excuted for each variable? Please assume that I am using SPSS 20.0 with the Custom Tables module and with the Python Plug In. Please also note that I prefer an approach using a macro because I am not Python-literate. I welcome your suggestions about how I should proceed and any code which you wish to share. I am on a daily digest; thus, I can respond on the next day if there are any questions. Thank you. David ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
Have you looked at OMS? I.e., use OMS to send the output of the weighted and unweighted runs to a new dataset. Then activate that dataset, do a little bit of data management and some straightforward computations (involving the LAG function), and use SUMMARIZE to generate a table of results.
HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
In reply to this post by David B. Nolle-2
Here is an example of a simple way to do
this using CTABLES and the STATS TABLE CALC extension command for a variable
named salary and a weight named wt.
With weights off, compute wtsalary = salary * wt. ctables /table by salary[mean stddev] + wtsalary [mean]. stats table calc="Custom Table" /target formula="(x2-x0)/x1" location=2 label="Standardized Difference of Means" mode=after /format decimals=4. This adds a column to the table with the desired result. Adding a row or column requres V21, but in V20 one could just generate the table with an extra final column and use mode=replace to replace those values with the computed result. The formula notation used here refers to absolute column numbers, which start from 0, so x0 refers to the unweighted mean column. It would be possible to do multiple variables in one table with a little bit more work. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: "David B. Nolle" <[hidden email]> To: [hidden email], Date: 01/28/2013 08:12 AM Subject: [SPSSX-L] Comparing Weighted and Unweighted Means in the Same Table Sent by: "SPSSX(r) Discussion" <[hidden email]> Dear SPSS Gurus, One way to assess the relative bias of an unweighted sample is to compare the unweighted means of a set of variables with the weighted means of the same set of variables. When each difference between the unweighted mean and the weighted mean is subsequently divided by the standard error of the unweighted mean, one obtains an estimate of the bias ratio (B/S) according to Kish's 1992 article in the Journal of Official Statistics. However, getting the weighted and unweighted means into a single table, obtaining their differences, and dividing the differences by their unweighted standard errors is a laborious task because SPSS forces separate runs for weighted and unweighted data. Moreover, manually copying the intermediate results from each run into a single table introduces a lot of chances for errors. Of course, computing the end result (Unweighted Xbar - Weighted Xbar / ste of Unweighted Xbar) is trivial after one has the components in place. Is there some way to automate this procedure so that one can get the end result without multiple runs and manual copying? In other words, is there a way to capture all of the relevant statistics in one place so that the final computation can be readily excuted for each variable? Please assume that I am using SPSS 20.0 with the Custom Tables module and with the Python Plug In. Please also note that I prefer an approach using a macro because I am not Python-literate. I welcome your suggestions about how I should proceed and any code which you wish to share. I am on a daily digest; thus, I can respond on the next day if there are any questions. Thank you. David ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |