Bookmark and Share

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: documentation on iteration for a non linear regression


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: documentation on iteration for a non linear regression
Date   Wed, 13 Jun 2012 11:39:35 -0400

tashi lama <[email protected]>:
You seem to be assuming additive Gaussian errors for a count outcome,
which strikes me as a bad idea. Compare the plausibility of the
various equivalent models below, and read the corresponding manual
entries for those commands.

clear
input x y
1 211
2 60
3 28
4 16
end
nl exp2: y x, nolog
di [b1]_b[_cons], [b2]_b[_cons]
nl exp2 y x, nolog
di _b[b1], _b[b2]
glm y x, link(log) fam(gaussian) nolog
di exp(_b[_cons]), exp(_b[x])
glm y x, link(log) fam(poisson) nolog
di exp(_b[_cons]), exp(_b[x])
poisson y x, nolog
di exp(_b[_cons]), exp(_b[x])


On Wed, Jun 13, 2012 at 11:04 AM, tashi lama <[email protected]> wrote:
> That would help. Thanx... but it doesn't hurt to learn more although I am planning to spend a day or two to go through the manual on matrix, sth I haven't looked at before. I had a dataset as follows
>
>
>
>            day     hits   b          v |
>     |---------------------------------|
>  1. | 03jan2011    211   1   209.0752 |
>  2. | 04jan2011     60 2 69.08601 |
>  3. | 05jan2011     28 3 22.82851 |
>  4. | 06jan2011     16   4   7.543365 |
> ----------------------------------------
>
>
>
> v is my predicted value. day and hits are my original value and I generated b to use it as independant variable instead of day for simplification. Drawing a scatter plot helped me identify the nature of the curve which is exponential so i decided to use one of the built in exp models. So, I said
>
>
>
> nl exp2 :hits b
>

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index