Statalist


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

st: RE: RE: RE: RE: RE: RE: RE: re: problem using predictnl after obtaining non-linear estimates


From   Lopa Chakraborti <lchakraborti@arec.umd.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: RE: RE: RE: RE: re: problem using predictnl after obtaining non-linear estimates
Date   Sun, 26 Oct 2008 14:40:38 -0400

Yes you are right. I do have a simple linear model which I estimated using the BOD inputs as an explanatory variable. I just wanted to compare how well the linear coefficients perform when compared with the complicated NL functional form derived from the Streeter-Phelps.
But my predictnl problem does not go away even if I estimate only K1 and K2 i.e. dropping all the monitor dummies and year dummies.
________________________________________
From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox [n.j.cox@durham.ac.uk]
Sent: Sunday, October 26, 2008 2:16 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: RE: RE: RE: RE: RE: re: problem using predictnl after obtaining non-linear estimates

My worries on your behalf remain. If I were reviewing any paper in this
field with so many parameters in a model, I would ask for a clear
demonstration or argument that such complexity was essential.

I've made my point, so I won't pursue it beyond this.

Nick
n.j.cox@durham.ac.uk

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Lopa
Chakraborti
Sent: 26 October 2008 17:44
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: RE: RE: RE: RE: re: problem using predictnl after
obtaining non-linear estimates

I do have data on upstream water quality which explains why the R-square
is so high.
________________________________________
From: owner-statalist@hsphsun2.harvard.edu
[owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
[n.j.cox@durham.ac.uk]
Sent: Sunday, October 26, 2008 1:41 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: RE: RE: RE: re: problem using predictnl after obtaining
non-linear estimates

I've never used this command. Others should have better advice on it.

But if your model is not based on the flow data you would like, doesn't
a R-square of 98% worry you? How can you get a model fit that appears
that good without a scientifically sound model? I don't have your data
and I've not studied your model, but that implies overfitting to me.

Nick
n.j.cox@durham.ac.uk

Lopa Chakraborti

The problem I am having is figuring out what goes inside the parenthesis
in predict() since it is not the linear predictor xb(). Help on this
would be appreciated.

It is a very rough and approximate model for Streeter-Phelps. I do not
have any stream flow etc data and hence I am using the monitoring
station dummies to control for them.

Nick Cox [n.j.cox@durham.ac.uk]

No programming is needed; this is something available to you as part of
your -predictnl- command.

Kit is pointing you to special functions -predict()- and -xb()- that you
can use within -predictnl-. I too no longer have Stata 8.2 on my machine
but I do have the Stata 8 manuals, which indicate to me that these
functions were present in -predictnl- in Stata 8.

Therefore study the on-line help first and then the manual entry.

Incidentally, I feel very queasy about an 91-parameter model, even with
this kind of data (which is not alien to me). What's the engineering
hydrology behind that?

Lopa Chakraborti

Thanks you have pointed me to the right direction. However, I am not
using either predict() or xb() functions. Instead, I have:
 predictnl bod1 =
($K2/($K1-$K2))*exp(-$K1*aggthirdfourthadd)*(exp(-$K2*seconddistadd)-exp
(-$K1*seconddistadd)). That said my limited knowledge in programming
might also explain why I cannot make the connection.

Kit Baum [baum@bc.edu]

Lopa said
I have a general question about predictnl and that is does it evaluate
any function as in any NL function of the parameters and some
explanatory variables or does it only predict dependent variables as
is usually done.



  [R] predictnl -- Obtain nonlinear predictions, standard errors,
etc., after
                        estimation

That help indicates that " pnl_exp is any valid Stata expression" so
that you may calculate any function for each observation, not just the
standard predicted value.

In Stata 10 help,

     When calculating inference-related quantities such as standard
errors, pnl_exp is
     evaluated repeatedly for different values of the model
parameters.  Therefore, think
     of predict() and xb() as a means of substituting for the formula
of the calculation
     and not a means of substituting the value of the calculation that
is obtained when
     the model parameters are set to any specific values.  For example,

         . predict double pred_var, predict_options
         . predictnl newvar = pred_var, se(newvar_se)

     will give standard errors (newvar_se) equal to zero, since once
evaluated, pred_var
     will contain values that are fixed with respect to e(b).  Instead,

         . predictnl newvar = predict(predict_options), se(newvar_se)

     will produce what is intended.



which states that zero standard errors will result. I have no idea
whether it works this way in Stata 8.2.


*
*   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/



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