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
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: ivtobit with lagged dummy variables as instruments
Date
Thu, 14 Apr 2011 15:18:12 +0100
You don't need scalars for your example, as I explained.
Your name -minv- was your choice. You could use one character names. I
agree: evocative names are often better.
The only reason to use -scalar()- is to avoid name conflict with
variables. It is easy enough to use some personal convention that
always avoids any clashes. Thus, you could decide that variable names
are always lower case, scalar names always upper case.
So the call could be as short as
`= S'
Nick
On Thu, Apr 14, 2011 at 3:06 PM, Charles Koss <[email protected]> wrote:
> 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.
>>
*
* 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/