Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: ivtobit with lagged dummy variables as instruments


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: ivtobit with lagged dummy variables as instruments
Date   Wed, 13 Apr 2011 15:07:16 +0100

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 <hqtiger@gmail.com> 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
> <Bettina.Lamla@rwi-essen.de> 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/


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