Re: [R] Adding weights to optim

2011-09-23 Thread Ahnate Lim
) } (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=whatever weights you had in mind) HTH cheers, Rolf Turner On 23/09/11 13:47, Ahnate Lim wrote: I

[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] Extrapolating values from a glm fit

2011-01-27 Thread Ahnate Lim
this predict? On Wed, Jan 26, 2011 at 11:41 PM, Gavin Simpson gavin.simp...@ucl.ac.ukwrote: 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 provided syntax, I would expect y

[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

Re: [R] Extrapolating values from a glm fit

2011-01-26 Thread Ahnate Lim
...@comcast.netwrote: 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 are time separation in miliseconds, and the y values are proportion