Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: IPF troubles


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: IPF troubles
Date   Fri, 15 May 2009 15:26:49 +0000 (GMT)

--- On Fri, 15/5/09, Andrew Criswell wrote:
> This seems like a straight forward example. But I don't
> understand why it fails. I am using version 10.1
> 
> input str6 gender str8 party wgt
> gender party wgt
> male democrat 55
> male repub 65
> female democrat 50
> female repub 30
> end
> 
> . ipf [fweight = wgt], fit(gender + party)

In Stata strings are hardly ever used in computations. It is much 
more common to represent the categories with numbers, and attach 
appropriate value labels or use conventions like 1 is true and 0 
is false (so a value 0 on a variable female means "not a female" 
ergo "male"). Anyhow, without strings the version of -ipf- I 
have works:

*------- begin example ------------
drop _all
input female repub wgt
0 0 55
0 1 65
1 0 50
1 1 30
end

ipf [fweight = wgt], fit(female + repub)
*------------- end exampele ---------------

Notice that it is important to report where you got user written 
software from, as often there are multiple versions floating 
around in cyber space. My version of -ipf- came from the Stata 
Journal, vol. 2, nr. 1.

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://home.fsw.vu.nl/m.buis/
-----------------------------------------




      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index