Hi Christian, Thank you very much for the help. Now I can run. But my main interest is on the region of x[-200 to +200] and as you can see this logistic regression not fit very well.
You think that using other package / function I can get better fit of these data? Best wishes, miltinho brazil-toronto sp.coredep.attr<-read.table(stdin(), head=T, sep=",") species,dst,preference,probdye coredep,-7500,1,0.001 coredep,-1000,0.95,0.002 coredep,-500,0.9,0.003 coredep,-250,0.8,0.005 coredep,-120,0.7,0.01 coredep,-100,0.5,0.02 coredep,-90,0.3,0.03 coredep,-60,0.2,0.05 coredep,-30,0.15,0.065 coredep,0,0.1,0.08 coredep,30,0.09,0.1 coredep,60,0.08,0.15 coredep,90,0.07,0.2 coredep,120,0.06,0.3 coredep,240,0.05,0.4 coredep,500,0.04,0.5 coredep,1000,0.02,0.6 coredep,7500,0.01,0.7 plot(preference~as.factor(dst), data=sp.coredep.attr, type="n", cex=0.001, col="transparent", xlab="Distance (m)", main="CORE Dependent") lines(sp.coredep.attr$preference, type="b", lwd=2, col="blue") abline(v=10, col="blue", lty=3) text(10, 1, "EDGE", cex=1.5) text(7, 1, "CORE", cex=1.5, col="green") text(13, 1, "MATRIX", cex=1.5, col="red") text(4,0.65, "Preference", col="blue") text(16,0.65, "Prob.Die", col="red") lines(sp.coredep.attr$probdye, type="b", lwd=2, col="red", lty=2) require(drc) sp.coredep.attr.m1 <- drm(preference~dst, data=sp.coredep.attr, fct=L.4()) x11() plot(sp.coredep.attr.m1, log = "") x11() plot(sp.coredep.attr.m1, log = "", xlim = c(-500, 500), ylim = c(0, 1)) summary(sp.coredep.attr.m1) On Thu, Apr 23, 2009 at 1:41 AM, Christian Ritz <r...@life.ku.dk> wrote: > Hi Milton, > > you're right that most of the functions in the package "drc" are suited for > sigmoidal/s-shaped curves defined on the positive axis. > > However, there is one exception: the logistic model: > > library(drc) > > sp.coredep.attr.m1 <- drm(preference~dst, data=sp.coredep.attr, fct=L.4()) > > plot(sp.coredep.attr.m1, log = "") > plot(sp.coredep.attr.m1, log = "", xlim = c(-500, 500), ylim = c(0, 1)) > > summary(sp.coredep.attr.m1) > > > The fit isn't very good, possibly because the curve you've observed seems > to have a kind > of bent at or close to 0. > > Christian > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.