# Scott Merrill # p-value slope part 2 # Oct 24th class # continued from other editor but kept apart for quick compiling of other half sin.function.y = 20*sin(x/5) + data.error sin.function.y.real = 20 *sin(x/5) y = plot(x,sin.function.y, lwd =2, ps=40, xlab = "Day",family="sans", ylab = "Shrew Activity",cex.lab = 1.3) mtext("Shrew noctural activity by day", cex = 2) windowsFonts( A=windowsFont("Arial Black"), B=windowsFont("Bookman Old Style"), C=windowsFont("Comic Sans MS"), D=windowsFont("Symbol") ) points(x,sin.function.y.real,lwd = 3, col = 3, type = "l") rect(0,-32,19,-27,col = "bisque") text(9.5,-30,family="D","Phases of the moon not depicted") rect(0,-32,19,-27,col = "bisque") text(9.5,-30,family="c","Phases of the moon not depicted") mod.sin.coerced.linear = lm(sin.function.y~x) summary(mod.sin.coerced.linear) abline(mod.sin.coerced.linear$coefficients, lwd = 3, col = 4) se.sin.mod = abline(mod.sin.coerced.linear$coefficients[1],mod.sin.coerced.linear$coefficients[2]+ se.slope*1.96, col = 4, lwd = 3, lty = 3) abline(mod.sin.coerced.linear$coefficients[1],mod.sin.coerced.linear$coefficients[2]- se.slope*1.96, col = 4, lwd = 3, lty = 3)