Graphics Reference
In-Depth Information
Finally, we'll make the graph with jittered points and the
fitlogistic
line. We'll make the line
# Get predicted values
glm_predicted
<-
predictvals(fitlogistic,
"V1"
,
"classn"
, type
=
"response"
)
ggplot(b, aes(x
=
V1, y
=
classn))
+
geom_point(position
=
position_jitter(width
=
.3
, height
=
.08
), alpha
=
0.4
,
shape
=
21
, size
=
1.5
)
+
geom_line(data
=
glm_predicted, colour
=
"#1177FF"
, size
=
1
)
Figure 5-23. A fitted logistic model