Re: [R] nonmonotonic glm?

2015-01-12 Thread Vito M. R. Muggeo
dear Stanislav, Your data show two slopes with a kink at around 0. Thus, yet another approach would be to use segmented regression to fit a piecewise linear relationship with unknown breakpoint (being estimated as part of model fitting). While the resulting fitting is likely to be (slightly)

Re: [R] nonmonotonic glm?

2015-01-12 Thread Stanislav Aggerwal
Thanks very much Marc and Ben for the helpful suggestions Stan On Sun, Jan 11, 2015 at 10:28 PM, Ben Bolker bbol...@gmail.com wrote: If you're going to use splines, another possibility is mgcv::gam (also part of standard R installation) require(mgcv) gam(DV ~ s(IV), data=

Re: [R] nonmonotonic glm?

2015-01-12 Thread Michael Dewey
Comments in line On 12/01/2015 13:13, Vito M. R. Muggeo wrote: dear Stanislav, Your data show two slopes with a kink at around 0. Thus, yet another approach would be to use segmented regression to fit a piecewise linear relationship with unknown breakpoint (being estimated as part of model

Re: [R] nonmonotonic glm?

2015-01-12 Thread Bert Gunter
... but do realize that after you have looked at the data to determine the appropriate modeling approach, no statistical inference (significance tests, confidence intervals, etc.) should be done on the model used. Or more precisely, any that is done is wrong. Cheers, Bert Bert Gunter Genentech

[R] nonmonotonic glm?

2015-01-11 Thread Stanislav Aggerwal
I have the following problem. DV is binomial p IV is quantitative variable that goes from negative to positive values. The data look like this (need nonproportional font to view): o o o o o o o o

Re: [R] nonmonotonic glm?

2015-01-11 Thread Marc Schwartz
On Jan 11, 2015, at 4:00 PM, Ben Bolker bbol...@gmail.com wrote: Stanislav Aggerwal stan.aggerwal at gmail.com writes: I have the following problem. DV is binomial p IV is quantitative variable that goes from negative to positive values. The data look like this (need nonproportional

Re: [R] nonmonotonic glm?

2015-01-11 Thread Ben Bolker
If you're going to use splines, another possibility is mgcv::gam (also part of standard R installation) require(mgcv) gam(DV ~ s(IV), data= YourDataFrame, family=binomial) this has the advantage that the complexity of the spline is automatically adjusted/selected by the fitting algorithm

Re: [R] nonmonotonic glm?

2015-01-11 Thread Ben Bolker
Stanislav Aggerwal stan.aggerwal at gmail.com writes: I have the following problem. DV is binomial p IV is quantitative variable that goes from negative to positive values. The data look like this (need nonproportional font to view): [snip to make gmane happy] If these data were