Hi Derek, have a look at the following made-up example: f1 <- function(x){2*x} f2 <- function(x){-10*x+1} x<-rnorm(10) x (x<0)*f1(x) (x>=0)*f2(x) (x<0)*f1(x) + (x>=0)*f2(x) Therefore I suggest you should specify the model as follows: yourNLSmodel <- nls(Y ~ (X<Z) * f(X,a,b,c) + (X>=Z) * g(X,a,d,e), data = myData, ...) Christian