Re: [R] Fit a logit curve to the data

From: Ted Harding <>
Date: Fri, 14 Mar 2008 00:41:01 +0000 (GMT)

On 13-Mar-08 22:56:16, Alfonso Pérez wrote:
> Hello, my name is Alfonso. My data are 0 and 1 values in
> the y axis and fish length in the x axis. I'm trying to get
> a graph where it could be fitted a logit curve to my data,
> how could I get it?

Have a look at


In particular (just going on your bare statement of your problem) let 'y' denote your vector or 0/1 results:

  x <- fishlength
  y <- glm(y ~ fishlength, family=binomial)$fit   plot(x,y)

would be a start.

However, I'm intrigued by what your variable y (more likely to be 1 as fishlength increases) might be. "Sexually mature"?

There might be a better model for it than the logistic curve.

Best wishes,

E-Mail: (Ted Harding) <> Fax-to-email: +44 (0)870 094 0861
Date: 14-Mar-08                                       Time: 00:40:59
------------------------------ XFMail ------------------------------

______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 14 Mar 2008 - 00:43:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 14 Mar 2008 - 01:30:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive