Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: how to perform Wald tests with NLS


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: how to perform Wald tests with NLS
Date   Fri, 12 Aug 2005 16:59:51 -0500

1.  I believe the syntax is testnl _b[var1] = _b[var2]

2.  Adding the variables together does not seem to be problem, see example
below.


Scott


. sysuse auto,clear
(1978 Automobile Data)

. nl(price = {alpha} + (mpg/10)^{beta1} + (weight+ length)/{beta2= 1}),
nolog
(obs = 74)

      Source |       SS       df       MS            Number of obs =
74
-------------+------------------------------         F(  2,    71) =
14.52
       Model |   184307375     2  92153687.4         Prob > F      =
0.0000
    Residual |   450758021    71  6348704.53         R-squared     =
0.2902
-------------+------------------------------         Adj R-squared =
0.2702
       Total |   635065396    73  8699525.97         Root MSE      =
2519.664
                                                     Res. dev.     =
1366.059

----------------------------------------------------------------------------
--
       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
       alpha |  -648.8763   1421.597    -0.46   0.649     -3483.46
2185.708
       beta1 |   5.058991   1.353238     3.74   0.000     2.360712
7.75727
       beta2 |   .4773436   .0940605     5.07   0.000     .2897923
.6648948
----------------------------------------------------------------------------
--
* Parameter alpha taken as constant term in model & ANOVA table
 (SEs, P values, CIs, and correlations are asymptotic approximations)

. testnl _b[beta1] = _b[beta2]

  (1)  _b[beta1] = _b[beta2]

              F(1, 71) =       10.74
              Prob > F =        0.0016



. testnl _b[beta2] = 1

  (1)  _b[beta2] = 1

              F(1, 71) =       30.88
              Prob > F =        0.0000

> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Paulo Regis
> Sent: Friday, August 12, 2005 4:40 PM
> To: [email protected]
> Subject: st: how to perform Wald tests with NLS
> 
> Dear all,
> 
> I am using nl command to estimate a nonlinear specification. In short, my
> model is:
> 
> y=C0+b0*(x1^b1)*(X2^b2)+C1*x3+C2*x4+e
> 
> and my output looks like
> 
> dgr5y   Coef   Std. Err.
>   C0	.02	.0083	etc.
>   b0	.06	.2828	etc.
>   b1	1.2            .89	etc
>   b2	.93	.282	etc
>   C1	.97	.008	etc
>  C2	.16	.008	etc
> 
> 
> and I want to test C1=C2. I have tryed to use the test command after
> running my programs (both nl and ml) but it didnt work. If i type
> 
> test C1+C2
> 
> it doesnt work althoug it perform "test C1" (the h0 is C1=0) but not "test
> C1=2". What can i do? I tryed two things. first I regressed
> 
> y=C0+b0*(x1^b1)*(X2^b2)+C1*(x3+x4)
> 
> and I did "test C1".
>  In shorth, I want to know
> 1- why test didnt work?
> 2- It is ok to do the regression with x5=(x3+x4) and "test C1"?
> 
> Cheers,
> 
> Paulo
> 


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index