[R] Extrapolating values from a glm fit

2011-01-26 Thread Ahnate Lim
Dear R-help, I have fitted a glm logistic function to dichotomous forced choices responses varying according to time interval between two stimulus. x values are time separation in miliseconds, and the y values are proportion responses for one of the stimulus. Now I am trying to extrapolate x value

Re: [R] Extrapolating values from a glm fit

2011-01-26 Thread Ahnate Lim
PM, David Winsemius wrote: > > On Jan 26, 2011, at 10:52 PM, Ahnate Lim wrote: > > Dear R-help, >> >> I have fitted a glm logistic function to dichotomous forced choices >> responses varying according to time interval between two stimulus. x >> values

Re: [R] Extrapolating values from a glm fit

2011-01-27 Thread Ahnate Lim
istic binomial, what does this predict? On Wed, Jan 26, 2011 at 11:41 PM, Gavin Simpson wrote: > On Wed, 2011-01-26 at 19:25 -1000, Ahnate Lim wrote: > > Even when I try to predict y values from x, let's say I want to predict y > at > > x=0. Looking at the graph from the pro

[R] Adding weights to optim

2011-09-22 Thread Ahnate Lim
I realize this may be more of a math question. I have the following optim: optim(c(0.0,1.0),logis.op,x=d1_all$SOA,y=as.numeric(md1[,i])) which uses the following function: logis.op <- function(p,x,y) { ypred <- 1.0 / (1.0 + exp((p[1] - x) / p[2])); res <- sum((y-ypred)^2) return(res) }

Re: [R] Adding weights to optim

2011-09-23 Thread Ahnate Lim
t;ypred <- 1.0 / (1.0 + exp((p[1] - x) / p[2])); >sum(w*(y-ypred)^2) > } > > (Note that your ``res <- ...'' and ``return(res)'' are unnecessary.) > > optim(c(0.0,1.0),logis.op,x=**d1_all$SOA,y=as.numeric(md1[,**i]), > w=