attach(spruce) south.slope <- -.1326 north.slope <- .45 south.int <- -.2381 north.int <- -4.48 ## elevation has been divided by 100 ## I think these parameter estimates might be right, but you should check elevation.values_seq(from=6,to=18,by=.1) # these are where we evaluate the function logit.back.transform <- function(X) exp(X)/(1+exp(X)) south.fit.logscale <- south.int+south.slope*elevation.values north.fit.logscale <- north.int+north.slope*elevation.values south.fit <- logit.back.transform(south.fit.logscale) north.fit <- logit.back.transform(north.fit.logscale) plot(elevation,percent,ylim=c(0,1)) ## this can also be a coded scatterplot of data values lines(elevation.values,north.fit,lty=1) lines(elevation.values,south.fit,lty=2) ## don't worry about the warning messages this produces