fit<- fitted (model)
and then plot them with points() or lines()
I am not sure what are you plotting though as y is not plotted at all from what I see.
I think you should be plotting y vs your regressors.
Hi guys,
This is probably a very simple question but I can't figure it out myself...
I have made a regression model and I found a way to plot this model but I can't figure out how to draw lines through these points that are based on the model I made.
the Regression model looks like this:
model<-glm(y~NDVI*Variety, binomial) (Variety is a factor with 3 levels).
I plotted the points with this code:
pAnimal<-split(Animal, Variety)
pNDVI<-split(NDVI, Variety)
plot(NDVI, Animal, type="n", ylab="proportion animal")
points(pNDVI[[1]], pAnimal[[1]], pch=16)
points(pNDVI[[2]], pAnimal[[2]], pch=16)
points(pNDVI[[3]], pAnimal[[3]], pch=16)
So I want lines that are based on the regression model drawn through the points I plotted.
Can anyone help me out?
Cheers,
Brenda
fit<- fitted (model)
and then plot them with points() or lines()
I am not sure what are you plotting though as y is not plotted at all from what I see.
I think you should be plotting y vs your regressors.
|
|