hello, can anyone help with this: ########################################################### ###data: measurments (response = trans) run several times at the same predictor value level (press) por<-data.frame(list(structure(list(run = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L), .Label = c("1", "3", "4"), class = "factor"), press = c(15, 21, 24, 29.5, 15, 21, 24, 29.5, 15, 21, 24, 29.5), tr_rel = c(1, 0.459454191, 0.234697856, 0.135282651, 1, 0.853283066, 0.306314797, 0.186302231, 1, 0.42980063, 0.103882476, 0.086463799), tr = c(513, 235.7, 120.4, 69.4, 318.3, 271.6, 97.5, 59.3, 476.5, 204.8, 49.5, 41.2)), .Names = c("run", "press", "tr_rel", "tr"), row.names = c(NA, -12L), class = "data.frame"))) attach(por) ###nls: summary(mod1<-nls(tr ~ SSlogis( log(press), Asym, xmid, scal))) press_x <- seq(15, 30, length = 100) ####predict() somehow doesn't recognize the list and returns values ####as if list argument was absent: predict(mod1,list(Pressure=press_x)) ####consequently plotting of fitted line doesn't work either: plot(press,tr) lines(press_x,predict(mod1,list(pressure=press_x))) ########################################################### thanks a lot in advance for any hints - greetings, kay -- View this message in context: http://n4.nabble.com/nls-predict-problem-tp1690561p1690561.html Sent from the R help mailing list archive at Nabble.com.
hello, sorry to have hassled you with this - in the end it is all quite simple and after digging deeper into the help files, also of predict.lm, i finally managed to do it. here is the worked example with solution for anyone beeing clumsy as i was: ########################################################### por<-data.frame(list(structure(list(run = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L), .Label = c("1", "3", "4"), class = "factor"), press = c(15, 21, 24, 29.5, 15, 21, 24, 29.5, 15, 21, 24, 29.5), tr_rel = c(1, 0.459454191, 0.234697856, 0.135282651, 1, 0.853283066, 0.306314797, 0.186302231, 1, 0.42980063, 0.103882476, 0.086463799), tr = c(513, 235.7, 120.4, 69.4, 318.3, 271.6, 97.5, 59.3, 476.5, 204.8, 49.5, 41.2)), .Names = c("run", "press", "tr_rel", "tr"), row.names = c(NA, -12L), class = "data.frame"))) attach(por) summary(mod1<-nls(tr ~ SSlogis( log(press), Asym, xmid, scal))) predict(mod1, x_press) x_press<-data.frame(press=seq(from=5,to=35,by=0.5)) y_pred<-data.frame(tr=predict(mod1, x_press)) plot(press,tr, xlim=c(10,30)) lines(cbind(x_press,y_pred)) ########################################################### greetings, kay -- View this message in context: http://n4.nabble.com/nls-predict-problem-tp1690561p1692061.html Sent from the R help mailing list archive at Nabble.com.