0

I did a glm in R and predicted a model out of the results I got. The values that I received the pred$fitvary between -1.2 and 0.7. However I would like to rescale these values to a range between 0 and 1 so I can observe it on a plot with the Y axis ranging between these 2 values. Changing the ylim is not enough since the negative values will not be seen. Is there a function that can be applied for this case?

ChzM
  • 13
  • 5

1 Answers1

0

do you mean something like this?

x <- seq(-1.2,0.7,.1)
as.numeric(cut(x,quantile(x, seq(0,1,.1), include.lowest=T)))/10
enroute
  • 183
  • 9
  • `model4=glm(Detection~Camouflage, data,family=binomial) summary(model4) anova(model4) nouv=expand.grid(Camouflage=unique(data$Camouflage)) pred=predict(model4, newdata=nouv, se.fit=T) nouv$fit=pred$fit nouv$min=pred$fit-pred$se.fit nouv$max=pred$fit+pred$se.fit` This is what I did, and the values given by the predict function are -1.2 and 0.7. I want these values to vary between 0 and 1 only. I don't want negative value while keeping the gap between the numbers quite the same. – ChzM Feb 22 '17 at 08:22