Dear Jonh,
there is probably an easier way, but i find this to give nice smooth 
plots.
 good luck with it.

### R-file

alive <- data$num - data$numdead
numdead <- data$numdead
temp <- data$temp

data.table <- cbind(numdead, alive)
points.graph <-   data$alive/data$num

glm.mort<-glm(data.table ~ temp, family=binomial)

 fit <- predict(glm.mort, type='response' )


a <- glm.mort$coef[1]    # writes model parameters to named variable, you 
can also use them directly in a function, as you like
b <- glm.mort$coef[2]

          x2 <- c((logit(fit)-(a))/b)
         p2 <- c ((inv.logit(a+b*x2)) )
         y2 <- c ( a+b*x2)


plot(c(30,55), c(0,1),type="n", main= "survival",xlab = "Log x", ylab = 
"Probability")
  lines( sortedXyData( (logit(p2)-(a))/b,p2),type="l",lty=1 
,col="blue",ylim=c(0,1.2) )
  points(temp,fit,pch=4,type= "p",col="black")
 
## This will plot a smooth cuve

x  <-  c(x=(rep(33:55,1)))
p <- c ((inv.logit(a+b*x)) )
y  <-  c ( a+b*x)

plot(c(30,55), c(0,1),type="n", main= "survival",xlab = "Log x", ylab = 
"Probability")
  lines( sortedXyData( (logit(p)-(a))/b,p),type="l",lty=1 
,col="blue",ylim=c(0,1.2) )
  points(temp,fit,pch=4,type= "p",col="black")

### END 



Willems Tom

E-mail: towil@var.fgov.be

 


Disclaimer: click here
	[[alternative HTML version deleted]]

