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: RE: could be simple but I don't get the error message on range
From
Nirina F <[email protected]>
To
[email protected]
Subject
Re: st: RE: could be simple but I don't get the error message on range
Date
Thu, 16 Feb 2012 07:10:20 +0300
Thank you Jesper and Nick.
I use Stata 11.0
I had to translate as I could not find a way to send you the data.
Thank you for your understanding.
Ni
On Wed, Feb 15, 2012 at 11:52 AM, Nick Cox <[email protected]> wrote:
> Jesper is right. In addition, if you think your Stata is not
> up-to-date, you should tell us what version you are using. However,
> that is unlikely to be an issue here.
>
> In your first example
>
> twoway (function y =_b[mpg]*x+(_b[_cons])), range(mpg) xtitle(x) ytitle(Marginal effect))
>
> the () around (function ...) have the effect of stating that -range()-
> is an option of -twoway-, not of -twoway function-, which is wrong.
> Remove those () and a problem remains that the very last ) is
> unmatched and not needed.
>
> In your second example the statement won't work because -i_age- is not
> a variable in the auto dataset. I guess your translation from your
> real example was messed up.
>
> Nick
>
> On Wed, Feb 15, 2012 at 7:37 AM, Jesper Lindhardsen
> <[email protected]> wrote:
>
>> This works for me:
>>
>>
>> sysuse auto
>>
>> probit foreign mpg
>> mfx
>> #delimit ;
>> twoway function y =_b[mpg]*x+(_b[_cons]), xtitle(x) ytitle(Marginal effect) range(mpg)
>> ;
>>
> Nirina F
>
>> could you please rescue me on how to run these two graphs as I get error
>> messages all the time on range or parentheses. May be my stata was not
>> up to date?
>>
>> sysuse auto
>>
>> probit foreign mpg
>> mfx
>> #delimit ;
>> twoway (function y =_b[mpg]*x+(_b[_cons])), range(mpg) xtitle(Years
>> of Schooling) ytitle(Marginal effect))
>> ;
>>
>>
>>
>> probit foreign mpg
>> mfx
>> sum price
>> local price = r(mean)
>>
>> #delimit ;
>> twoway (function y
>> =_b[mpg]*normden(_b[i_a]*`price'_b[mpg]*x+_b[_cons]), range(mpg)
>> ytitle(Marginal effect) xtitle(x)) ;
>
> *
> * 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/