I should spell out an equivocation here.
-logit()- is mathematically possible because
the response lies within [0,1]. That doesn't
mean that applying logit models makes any
assumptions behind those apply if they don't
otherwise do so. The one graph I used does
suggest that the model is not crazy, but
only Serguei can comment on the substantive
or scientific fit.
Nick
[email protected]
Nick Cox
> An alternative is to pass your -q- through -logit()- and
> feed the thus-transformed response to -regress-.
>
> . gen logit_q = logit(q)
> . twoway connected logit_q year
> . regress logit_q year
> . predict logit_q_hat
> . gen q_hat = invlogit(logit_q_hat)
>
> The error assumptions are naturally different, but
> if the model is any good, that should not matter
> too much.
>
> This doesn't fix the asymptote, but the by-product of
> being able to check for linearity on the logit scale
> could be useful.
>
> Yet another alternative, even simpler, is
>
> -glm, link(logit) family(gaussian)-
>
> even though a glance at the help for -glm- might lead
> you to suppose that this combination was not allowed.
>
> I read in your data, did
>
> . glm q year, link(logit) family(gaussian)
>
> and followed with
>
> . regplot, bands(200)
>
> where -regplot- comes from -modeldiag- (-search
> modeldiag- for download information).
>
> The error assumptions are different again, but
> I make the same assertion.
>
> The graph shows that your data all seem to fall
> on the accelerating part of the curve: the asymptote
> can not be glimpsed, let alone touched.
>
> Those interested in the history of ideas might know
> that Berkson played with logistic curves before he
> came up with what we now know as logit models. He
> was not the first to do that either.
>
> Nick
> [email protected]
>
> Maarten buis
>
> > --- Serguei Kaniovski asked:
> > > How can I fit the logistic curve to a time-series "q" so that
> > > I can control the asymptotes, i.e. I what the fitted curve to
> > > level out at the value of q=0.04?
> >
> > Serguei:
> > You can do that with the -nl- command which estimates a nonlinear
> > least squares model. See the example below. You don't have to fix
> > the minimum and maximum, you can also estimate them. Even if you
> > want to fix them this may be useful as a model to compare with
> > for e.g. a likelihood ratio test, BIC and AIC, or just graphically,
> > as is also shown in the example below.
> >
> > The parameter in my example called {min} is the lower asymptote,
> > {max} is the higher asymptote, {b1} is the slope, and {b2} is the
> > year where the curve is halfway between {min} and {max}.
> >
> > HTH,
> > Maarten
> >
> >
> > *---------------begin example----------------
> > set more off
> > capture drop _all
> > input year q
> > 1981 .01102246
> > 1982 .01127048
> > 1983 .01152055
> > 1984 .0118841
> > 1985 .01211535
> > 1986 .01247724
> > 1987 .0129496
> > 1988 .01321121
> > 1989 .01319597
> > 1990 .01362598
> > 1991 .014358
> > 1992 .01417304
> > 1993 .01437101
> > 1994 .01509818
> > 1995 .01539195
> > 1996 .01586584
> > 1997 .01686939
> > 1998 .01767208
> > 1999 .01880662
> > 2000 .01914837
> > 2001 .02034989
> > 2002 .02122596
> > 2003 .02201964
> > 2004 .02243478
> > 2005 .02346839
> > 2006 .02428688
> > end
> >
> > twoway line q year
> >
> > nl ( q = .04/(1+exp(-{b1}*(year-{b2=2000}))) )
> > est store const
> > predict qconst
> > label var qconst "min and max constrained"
> >
> > nl ( q = {min=0} + {max=.04}/(1+exp(-{b1}*(year-{b2=2000}))) )
> > nl log4: q year
> > est store minmax
> > predict qminmax
> > label var qminmax "min and max not constrained"
> >
> > twoway line q qconst qminmax year
> > /* The graph shows that the unconstrained
> > model fits better */
> >
> > lrtest const minmax
> > /* hypothesis that min = 0 and
> > max = .4 is rejected */
> >
> > est stats const minmax
> > /* AIC and BIC also show that the
> > unconstrained model fits better */
> > *----------------end example ----------------
*
* 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/