Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: ivtobit with lagged dummy variables as instruments


From   Charles Koss <[email protected]>
To   [email protected]
Subject   Re: st: ivtobit with lagged dummy variables as instruments
Date   Thu, 14 Apr 2011 09:06:35 -0500

Dr. Cox, thank you for the follow up in the side issue of this thread.
Now I wonder, is there a faster way to give reference to scalars in
stata? In addition to the scalar's name, 11 caracters had to be typed
for it { `= scalar(minv)'  }, way too much!

Charles


Charles Koss
http://charlesonnet.blogspot.com

clear
webuse laborsup
describe
ivtobit fem_inc fem_educ kids (other_inc = male_educ), ll(12) twostep

summ other_inc
drop in 298 //delete inf. obs.
hist other_inc //histogram
summ other_inc
scalar minv = r(sd) //censoring
display minv
ivtobit fem_inc fem_educ kids (other_inc = male_educ), ll(`r(sd)') twostep
ivtobit fem_inc fem_educ kids (other_inc = male_educ), ll(`=
scalar(minv)') twostep


On Wed, Apr 13, 2011 at 9:07 AM, Nick Cox <[email protected]> wrote:
> Charles's post raised a side issue.
>
> Instead of
>
> summ other_inc
> scalar minv = r(min)
> display minv
> ivtobit fem_inc fem_educ kids (other_inc = male_educ), ll(.70566559) twostep
>
> you can just enter r(min) directly, as it has a local macro persona.
>
> summ other_inc
> ivtobit fem_inc fem_educ kids (other_inc = male_educ), ll(`r(min)') twostep
>
> Alternatively, if you were using a scalar, you need to evaluate it on the fly
>
> ... ll(`= scalar(minv)') ...
>
> See help for -macro-. That way, the expression
>
> scalar(minv)
>
> is evaluated before -ivtobit- looks at its input, so it just sees the
> numeric result.
>
> On Wed, Apr 13, 2011 at 1:59 PM, Charles Koss <[email protected]> wrote:
>> try the twostep option, for example (from the stata manual) :
>> clear
>> webuse laborsup
>> describe
>> ivtobit fem_inc fem_educ kids (other_inc = male_educ), ll(12) twostep
>> summ other_inc
>> drop in 298 //delete inf. obs.
>> summ other_inc
>> scalar minv = r(min)
>> display minv
>> ivtobit fem_inc fem_educ kids (other_inc = male_educ), ll(.70566559) twostep
>>
>> PS I had problem entering the scalar minv in the ll option of ivtobit,
>> so, i just copied.
>>
>> Charles
>>
>> --
>> Charles Koss
>> http://charlesonnet.blogspot.com
>>
>> On Wed, Apr 13, 2011 at 5:21 AM, Lamla, Bettina
>> <[email protected]> wrote:
>>> Hi everyone!
>>>
>>> I try to run ivtobit and get the following error message “could not find initial values”.
>>> This happens the moment I include lagged interaction variables as instruments. ivtobit works just fine for me  with lagged values as instruments as long as they are not interacted dummies.
>>> Any suggestions?
>>>
>>>
>>> The code is
>>>
>>> foreach x of varlist agecat_dummy1-agecat_dummy4{
>>> gen interW_`x'=log_wealth*`x'
>>>
>>> }
>>>
>>>
>>> foreach x of varlist log_income log_wealth interW_agecat_dummy1-interW_agecat_dummy4{
>>> gen l`x'=L1.`x'
>>> }
>>>
>>>
>>>
>>> /*ivtobit with lagged values as instruments*/
>>>
>>> ivtobit saving_rate $sociodemo (log_income log_wealth interW_agecat_dummy1-interW_agecat_dummy4 =llog_income llog_wealth linterW_agecat_dummy1 -linterW_agecat_dummy4), ll vce(cluster respid) first
>>>
>>> I use Stata 11.
>
> *
> *   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/
>

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index