Graphics Reference
In-Depth Information
By default, stat_smooth() also adds a 95% confidence region for the regression fit. The con-
fidence interval can be changed by setting level , or it can be disabled with se=FALSE ( Fig-
ure 5-18 ) :
# 99% confidence region
sp + geom_point() + stat_smooth(method = lm, level = 0.99 )
# No confidence region
sp + geom_point() + stat_smooth(method = lm, se = FALSE
FALSE )
The default color of the fit line is blue. This can be change by setting colour . As with any other
line, the attributes linetype and size can also be set. To emphasize the line, you can make the
dots less prominent by setting colour ( Figure 5-18 , bottom right):
sp + geom_point(colour = "grey60" ) +
stat_smooth(method = lm, se = FALSE
FALSE , colour = "black" )
Search WWH ::




Custom Search