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: AW: st: FW: Elasticity using nlcom
From
HENRY AKAEZE <[email protected]>
To
[email protected]
Subject
Re: AW: st: FW: Elasticity using nlcom
Date
Tue, 8 Jun 2010 08:52:39 -0700 (PDT)
OK, but could you please tell me what is the right command for margins/mfx. I used mfx compute but it complained:
mfx compute ((-.0093/cpi)*((gdpca/cifprice1)-$b*(lagimportca-$a*laglocalca))*8.89)
varlist not allowed
--- On Tue, 6/8/10, Martin Weiss <[email protected]> wrote:
> From: Martin Weiss <[email protected]>
> Subject: AW: st: FW: Elasticity using nlcom
> To: [email protected]
> Date: Tuesday, June 8, 2010, 8:46 AM
>
> <>
>
> The diagnosis is unchanged, I am afraid: You are feeding
> variables instead
> of estimators to -nlcom-, and -nlcom- is not designed for
> that. Maybe you
> want elasticities from -margins-/-mfx-?
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]]
> Im Auftrag von HENRY AKAEZE
> Gesendet: Dienstag, 8. Juni 2010 14:55
> An: [email protected]
> Betreff: RE: st: FW: Elasticity using nlcom
>
> 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
> non-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)
>
>
> However, when I wanted to compute point elasticity using
> the nlcom command:
>
> nlcom
> ((-.0093/cpi)*((gdpca/cifprice1)-$b*(lagimportca-$a*laglocalca))*8.89)
>
> the following complaint was made by stata:
>
> expression
> ((-.0093/cpi)*((gdpca/cifprice1)-.7468116010052702*(lagimportca-.13863891656
> 74462*laglocalca))*8.89) contains
> reference to X rather than _b[X].
>
> There was no output. I intend to evaluate this elasticity
> at the mean using
> nlcom. Please, tell me the stata command to use. I guess
> when I inserted the
> scalars for the means, stata displayed a scalar without
> standard errors,
> t-stat, p-value and confidence interval. Maybe there is a
> stata command I
> need to used with the nlcom that will compute the point
> elasticity at their
> mean values that will provide standard error, t-stat and
> others.
>
> Please let me know this command.
>
> Thanks
>
> Henry
>
>
> --- 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/
>
>
> *
> * 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/