[R] what is the cost in cv.glm?

2012-11-30 Thread mael
Hi, I have a question regarding the cv.glm function in the package boot. What is exactly the cost? Is it the threshold value for an estimated value to be classified as either 0 or 1? I have troubles understanding the explanation in R. Lets say I want all estimations >0.65 to be classified as 1s an

[R] All possible models with nls()

2012-08-23 Thread mael
Hi all, I am trying to make a script that prints all possible models from a model I've created using nls(). It is a logisitc model which in total includes 13 variables. So its >8000 models I need to create, which I don't want to do manually. I've tried modify scripts made for linear models with no

[R] Cross validation for nls function

2012-08-01 Thread mael
Hi, I've written a logistic function using nls and I'd like to do cross validation for this. Is there a package for that? Below is an example of my data and the function. N terms are presence/absence data and the response is succesful/failed data. y1<-sample(0:1,100,replace=T) N1<-sample(0:1,100

[R] writing my own logistic regression function

2012-05-22 Thread mael
Hi, I have problems writing a script for a logistic model. My data looks something like this: PI A N1 N2 N3 0 9 0 1 0 1 4 1 0 1 0 8 0 0 0 1 6 0 1 0 And so on… The model I

[R] model selection using logistf package

2011-09-27 Thread mael
Hi everyone, I'm wondering how to select the "best" model when using logistf? AIC does not work neither does anova. I tried fitting a glm model but got the separation warning message so I tried using the logistf package but as I stepwise simplify the model I don't know if the simplification is mot

[R] Add a function in rq

2011-09-20 Thread mael
Hi, I am trying to add a function in a linear quantile regresion to find a breakpoint. The function I want to add is: y=(k+ax)(xB) How do I write it in the rq() function? Do I need to define the parameters in any way and how do I do that? I'm a biologist new to R. Thanks!