Good Day,
As always, if anyone can direct me to an existing response in the archives
or answer these questions, it will be greatly appreciated.
This time I am trying to update a 2000 two-way table using 2004 one-way
information. I wanted to do it using IPF (iterative proportional fitting). I
soon learned that Nick Cox created a program (MSTDIZE) that may be useful.
However, I am obviously not framing the data correctly to obtain the desired
goal.
Here is a simplified version of the dilemma:
(1) Imagine a two-way table of proportions:
HSize00 1 2 Totals
Inc00 1 .55 .12 .67
Inc00 2 .20 .13 .33
Totals .75 .25 1.00
(2) Imagine two one-way tables to be used to update the two-way table:
Inc04 HSize04
1 .60 1 .65
2 .40 2 .35
(3) To attempt MSTDIZE, I have entered the data into Stata as follows:
Inc00 Hsize00 IbyH00 Inc04 HSize04
0.67 0.75 0.55 0.60 0.65
0.33 0.25 0.12 0.40 0.35
0.20
0.13
(4) So in Stata the data looks like this:
. list
+--------------------------------------------------+
| igroup00 hsize00 ibyh00 igroup04 hsize04 |
|--------------------------------------------------|
1. | .33 .22 .13 .4 .35 |
2. | .67 .78 .56 .6 .65 |
3. | . . .19 . . |
4. | . . .12 . . |
+--------------------------------------------------+
(5) When I run MSTDIZE, this is the output:
. mstdize ibyh00 igroup04 hsize04, by(igroup00 hsize00) generate (ibyh04)
----------------------
| Hsize00
Igroup00 | .22 .78
----------+-----------
.33 | 0.35
.67 | 0.65
----------------------
(2 missing values generated)
(6) Well, that is not what I hoped for. I was hoping for a new table
(ibyh04) with 4 observations (new row1/column1, new r1c2, new r2c1, and new
r2c2). Instead, I ended up with 2 observations that were exactly the same as
hsize04.
(7) This is probably a case of not really understanding what MSTDIZE is
designed to do. Does anyone have any suggestions on how I can get Stata (via
MSTDIZE or another means) to obtain an IPF adjusted ibyh04 (two-way table
updated from original two-way and two one-ways)?
(8) And, as a bonus. I gathered those proportions from tab hsize igroup,
cell command. So, if anyone knows how I could easily turn those relative
frequencies into a variable. I do know that the tab hsize igroup, cell
matcell (matname) produces a 2x2 matrix of actual (not relative)
frequencies. What I don't know is how to get relative frequencies in that
matrix? Or, how to transfer or use matrices in a simpler way than what I did
by hand above by transcribing the frequencies into excel for new data set
variable generation?
As always my advanced thanks for considering my question.
And, if anyone can suggest a course that I could attend or do on the web
regarding programming in Stata (matrices and macros, etc.), that would be
helpful as well.
Best Wishes,
Donnell
Donnell Butler
Ph.D. Candidate
Princeton University
125 Wallace Hall
Princeton, NJ 08540
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/