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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Test for significance of the difference between knee locations?


From   Joerg Luedicke <joerg.luedicke@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Test for significance of the difference between knee locations?
Date   Thu, 18 Oct 2012 22:21:43 -0500

Nice, thanks!

Joerg

On Thu, Oct 18, 2012 at 9:32 PM, Austin Nichols <austinnichols@gmail.com> wrote:
> Joerg Luedicke <joerg.luedicke@gmail.com>:
> Stata 12 allows you to test coefs that have no corresponding variables
> in the data; Stata 11 gives an error msg, so you must instead:
> test _b[k1]==_b[k2]
>
> On Thu, Oct 18, 2012 at 6:12 PM, Joerg Luedicke
> <joerg.luedicke@gmail.com> wrote:
>> I was just putting together some example code, similar in principle to
>> Austin's code, but encountered difficulties with the -test- command.
>> If we use Austin's code:
>>
>> *--Austin Nichols' code--
>> sysuse nlsw88, clear
>> *compare extremum positions for quadratics, e.g. for
>> *tw qfit wage age if union==0||qfit wage age if union==1
>> reg wage c.age##c.age##i.union, nohe
>> loc 1 (k1:-_b[age]/_b[c.age#c.age]/2)
>> loc 2 (k2:-(_b[age]+_b[1.union#c.age])/
>> loc 2 `2'(_b[c.age#c.age]+_b[1.union#c.age#c.age])/2)
>> nlcom `1' `2', post
>> test k1==k2
>> *-------------------------------
>>
>> I get an error message after -test k1==k2-:
>>
>> . test k1==k2
>> k1 not found
>> r(111);
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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