Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: cell match std errors


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: cell match std errors
Date   Thu, 5 Feb 2004 13:57:04 -0000

Not familiar with this stuff, sorry, but I note that you are cycling 
through binary representations of 0/63. There is a nice undocumented
way of doing that using -inbase-. Here is a way of getting that list: 

forval i = 0/63 { 
	qui inbase 2 `i'
	local list "`list' `r(base)'" 
}

If you needed all leading zeros, 

forval i = 0/63 { 
	qui inbase 2 `i' 
	local this : di %06.0f `r(base)' 
	local list "`list' `this'" 

... just in case you wanted to move up to 0/127 0/255 etc.  

So your code could be simplified to 

forval i = 0/63 { 
	qui inbase 2 `i' 
	local num `r(base)' 
	...
} 

Nick 
[email protected] 

Joao Pedro W. de Azevedo
> 
> I've written a Stata routine to estimate an exact (cell) match average
> treatment effect as suggested by Card and Sullivan (1988). So 
> far my ado
> file is only able to compute the average values of the non 
> treated, the
> treated, the difference and the weighted difference (att).
> 
> I would like to know if anyone could give me a suggestion on 
> how I could
> compute the std errors using Stata. Below follows an example 
> of the output
> and the do file that generates it.
> 
> Many thanks,
> 
> Joao Pedro
> 
> Reference:
> Card, D. and D. G. Sullivan (1988). "Measuring the Effect of 
> Subsidized
> Training Programs on Movements in and out of Employment." Econometrica
> 56(3): 497-530.
> 
> foreach num in 0 1 10 11 100 101 110 111 1000 1001 1010 1011 
> 1100 1101 1110
> 1111 10000 10001 10011 10101 10111 11000 11001 11010 11011 
> 11100 11101 11110
> 11111 100000 100001 100010 100011 100100 100101 100110 100111 
> 101000 101001
> 101011 101101 101110 101111 110000 110001 110010 110011 
> 110100 110101 110110
> 110111 111000 111001 111010 111011 111100 111101 111110 111111 {  

*
*   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/



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