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: FW: Elasticity using nlcom
From
HENRY AKAEZE <[email protected]>
To
[email protected]
Subject
RE: st: FW: Elasticity using nlcom
Date
Tue, 8 Jun 2010 05:43:46 -0700 (PDT)
Martin,
You are right: it doesn't make sense to multiply by zero, but stata was able to choose the right value for "a" and "b". When I reset the global to no-zero it still gives me the same value for a and b. It also gave the same values when I did not set a and b to any constant. Please stata output
program nlAI
version 8.0
if "`1'"=="?"{
global S_1"g0 b a d2 y"
global g0=0.1
global d2=0.1
global y=0.1
exit
}
replace `1'=$g0+$b*(lagimportca+$a* laglocalca)-$a*predictlocal+( (gdpca-$b* cifprice1*( lagimportca+$a* laglocalca))/ cifprice1)*($g0-($y+$d2)*ln( cifprice1)+$d2*ln(cpi)+$y*ln(( gdpca-$b* cifprice1*(lagimportca+$a* laglocalca))/priceindex1))
end
nl AI importca
(obs = 46)
Iteration 0: residual SS = 520270.6
Iteration 5: residual SS = 138.2019
Source | SS df MS Number of obs = 46
-------------+------------------------------ F( 5, 41) = 71.68
Model | 1208.15295 5 241.63059 Prob > F = 0.0000
Residual | 138.201885 41 3.37077768 R-squared = 0.8974
-------------+------------------------------ Adj R-squared = 0.8848
Total | 1346.35484 46 29.2685834 Root MSE = 1.835968
Res. dev. = 181.1458
(AI12)
------------------------------------------------------------------------------
importca | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
g0 | -.0124388 .0305046 -0.41 0.686 -.074044 .0491665
b | .7468116 .1050251 7.11 0.000 .5347091 .9589141
a | .1386389 .0638289 2.17 0.036 .0097338 .267544
d2 | .0011694 .0031635 0.37 0.714 -.0052194 .0075581
y | .0019213 .0048115 0.40 0.692 -.0077958 .0116384
------------------------------------------------------------------------------
(SEs, P values, CIs, and correlations are asymptotic approximations)
nlcom ((-.0093/cpi)*((gdpca/cifprice1)-$b*(lagimportca-$a*laglocalca))*8.89)
--- On Mon, 6/7/10, Martin Weiss <[email protected]> wrote:
> From: Martin Weiss <[email protected]>
> Subject: RE: st: FW: Elasticity using nlcom
> To: [email protected]
> Date: Monday, June 7, 2010, 2:38 PM
>
> <>
>
> This only deepens the mystery for me, to be honest. Why
> would you want to
> multiply -(lagimportca-$a*laglocalca)- by zero? If you
> really want "...point
> elasticity estimates, standard errors, test statistics,
> significance levels,
> and confidence intervals for nonlinear combinations of
> parameters", why do
> you not put the parameters into your -nlcom- call, but
> constants?
>
>
> HTH
> Martin
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]
> On Behalf Of HENRY AKAEZE
> Sent: Montag, 7. Juni 2010 22:57
> To: [email protected]
> Subject: Re: st: FW: Elasticity using nlcom
>
> Hello Martin,
>
> Thanks for the quick reply. My globals for "a" and "b" are
> zeros (0).
> Indeed, I intend to compute point elasticity estimates,
> standard errors,
> test statistics, significance levels, and confidence
> intervals for nonlinear
> combinations of parameters. The nlcom is post estimation
> command after using
> writing and estimating an nl program in stata.
>
> Thank you.
>
> Henry
>
> --- On Mon, 6/7/10, Martin Weiss <[email protected]>
> wrote:
>
> > From: Martin Weiss <[email protected]>
> > Subject: st: FW: Elasticity using nlcom
> > To: [email protected]
> > Date: Monday, June 7, 2010, 12:38 PM
> >
> > <>
> >
> > So Henry sent this query to me privately. I am not
> sure
> > what his -global-s
> > "a" and "b" contain, but from his second example, I
> think
> > they represent
> > scalars. Henry should think about the point of using
> > -nlcom-: "nlcom
> > computes point estimates, standard errors, test
> statistics,
> > significance
> > levels, and confidence intervals for (possibly)
> nonlinear
> > combinations of
> > parameter estimates after any Stata estimation
> command."
> > (see the help file)
> >
> > So when Henry feeds -nlcom- his call
> >
> -nlcom((-.0093/cpi)*((gdpca/cifprice1)-$b*(lagimportca-$a*laglocalca))*8.89)
> > -, Stata sees variable names instead of parameter
> > estimates, and the error
> > message makes the problem abundantly clear. Let me
> > replicate:
> >
> > **
> > sysuse auto, clear
> > reg price weight length
> > nlcom (myratio: weight/length )
> > **
> >
> > His second -nlcom- call is:
> > -nlcom((-.0093/35)*((36/.33)-$b*(3.7-$a*14.4))*8.89)-
> which
> > Stata evaluates
> > to -nlcom
> >
> ((-.0093/35)*((36/.33)-.6892200041267298*(3.7-.1785226557738297*14.4))*8.89)
> > -. This, of course, does not contain a reference to a
> > parameter estimate,
> > either, so Stata returns a scalar, and no other
> values.
> > Where is a standard
> > error supposed to come from for a _scalar_?
> >
> > All of which makes me think that Henry really wants
> > something else, and my
> > money is on -predictnl-.
> >
> >
> > HTH
> > Martin
> >
> > -----Original Message-----
> > From: HENRY AKAEZE [mailto:[email protected]]
> >
> > Sent: Montag, 7. Juni 2010 20:46
> > To: [email protected]
> > Subject: Elasticity using nlcom
> >
> > Dear Martin,
> >
> > I am doing estimation using the AIDS model. In order
> to
> > estimate elasticity,
> > I used nlcom command on an elasticity function I
> derived
> > through
> > differentiation as follows:
> >
> >
> nlcom((-.0093/cpi)*((gdpca/cifprice1)-$b*(lagimportca-$a*laglocalca))*8.89)
> >
> > The exogenous variables are CPI, CIF and the lags of
> import
> > and domestic
> > products.
> >
> > However, stata complained that reference was made to
> X
> > rather
> > than _b[X] as follows:
> >
> >
> >
> >
> expression((-.0093/cpi)*((gdpca/cifprice1)-.6892200041267298*(lagimportca-.1
> > 785226557738297*laglocalca))*8.89)
> > contains reference to X rather than _b[X]
> >
> > When evaluated at their means I got a value but
> without
> > standard errors and
> > p-value as below:
> >
> >
> nlcom((-.0093/35)*((36/.33)-$b*(3.7-$a*14.4))*8.89)
> >
> >
> >
> _nl_1:(-.0093/35)*((36/.33)-.6892200041267298*(3.7-.1785226557738297*14.4))*
> > 8.89
> >
> >
> >
> >
> ----------------------------------------------------------------------------
> > --
> >
> > importca
> > |
> > P>|t| Coef.
> >
> > [95% Conf. Interval]
> >
> > Std. Err.
> > t
> >
> -------------+--------------------------------------------------------------
> > --
> > _nl_1 -.255856 .
> > .
> >
> > .
> >
> >
> >
> >
> ----------------------------------------------------------------------------
> > --
> >
> > I need to know what is going on and what I must do to
> get
> > values for the
> > standard errors, t-stat and conf. interval.
> >
> > Thank you,
> >
> > Henry
> >
> >
> >
> >
> > *
> > * 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/
>
>
> *
> * 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/