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

Re: st: RE: Listing coefficient of one variable


From   "FUKUGAWA, N." <[email protected]>
To   [email protected]
Subject   Re: st: RE: Listing coefficient of one variable
Date   Wed, 14 Sep 2005 02:03:48 +0900

Thank you for your answers.
A correct model does not include "c" in the main equation.
treatreg y a b , treat(c= l m n) twostep
My intention was to list selection-corrected coefficients of "c" according to "d" varying between 1 and 100.

One suggestion was as follows.
xi: treatreg y a b i.d*c , treat(c=l m n) twostep
This model works while I am not sure if it is appropriate to specify "i.d*c" in the main equation.

Another suggestion was as follows.
statsby, by(d):treatreg y a b , treat(c=l m n) twostep
I obtained error message "treat() invalid r(198);" while the difference between this model and the example shown below is unclear.

The last suggestion was as follows.
forvalues i=1/100 {
treatreg y a b if d==`i', treat(c= l m n ) twostep
}
I obtained error message "treatments do not vary r(2000);".

Any further suggestion will be appreciated.
--
FUKUGAWA Nobuya, Ph.D.
[email protected]

Scott Merryman wrote:

-statsby- seems to work for me:
. use http://www.stata-press.com/data/r9/labor.dta,clear

. mark wc if we>12

. statsby, by(cit) clear:treatreg ww wa , treat(wc=wmed ) twostep
(running treatreg on estimation sample)

command: treatreg ww wa, treat(wc=wmed ) twostep
by: cit

Statsby groups
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 ..

. l, noobs

+-------------------------------------------------------------------------+
| cit ww_b_wa ww_b_wc ww_b_c~s wc_b_w~d wc_b_cons hazard~a
|
|-------------------------------------------------------------------------|
| 0 -.0195075 2.130432 2.50804 .2851474 -3.925529 -.608214
|
| 1 -.0066475 .723393 2.440629 .1568492 -1.91108 .4416668
|
+-------------------------------------------------------------------------+

In your original formulation:
-treatreg y a b c if d==`i', treat(c= l m n) twostep- ^^^

This c variable will be dropped since it is the treatment equation.

What error message do you receive with the -forv- loop?


Scott





-----Original Message-----
From: [email protected] [mailto:owner-
[email protected]] On Behalf Of FUKUGAWA, N.
Sent: Tuesday, September 13, 2005 9:54 AM
To: [email protected]
Subject: Re: st: RE: Listing coefficient of one variable

Thank you for your cooperation.
"treatreg" does not allow to use "statsby" and the program I wrote in the
previous mail does not work.
Any help would be appreciated.
*
*   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