# code to illustrate various aspects of plotting functions in R
p <- seq( 0.001, 0.999, length = 500 )
plot( p, log( p / ( 1 - p ) ), type = 'l', lwd = 2,
ylab = 'logit( p ) = log( p / ( 1 - p ) )' )
text( 0.4, 4.0, 'this is the logistic or logit transformation;' )
text( 0.4, 3.25, 'it maps probabilities onto the whole real line' )
lines( p, 4 * p - 2, lty = 2, lwd = 2, col = 'red' )
text( 0.6, -4.0, "it's approximately linear for p in ( 0.3, 0.7 )" )
# use this code to make a PDF file to incorporate into your test
pdf( 'logit-plot.pdf' )
plot( p, log( p / ( 1 - p ) ), type = 'l', lwd = 2,
ylab = 'logit( p ) = log( p / ( 1 - p ) )' )
text( 0.4, 4.0, 'this is the logistic or logit transformation;' )
text( 0.4, 3.25, 'it maps probabilities onto the whole real line' )
lines( p, 4 * p - 2, lty = 2, col = 'red' )
text( 0.6, -4.0, "it's approximately linear for p in ( 0.3, 0.7 )" )
dev.off( )