# NOT RUN {
par( mfrow=c(2,2) )
# Plots standard normal density in black, t density with 3 d.f. in red, and
# non-central t density with 3 d.f. and non-centrality parameter=1.4 in green.
plotDist( "dnorm", 0, 1, "dt", 3, 0, "dt", 3, 1.4,
main=expression(paste("Standard Normal,", T[3],", and ", T[paste(3,",",1.4)], sep="")) )
plotDist( "dchisq", 15, , "dnorm", 15, sqrt(2*15), col=c("blue", "hotpink"),
main=expression(paste("Normal approximation to ",chi[~(15)]^{~2})) )
# Cumulative distribution functions.
plotDist( "pnorm", 50, 10, "pcauchy", 50, 10, col=c("purple","orange"),
main = "Normal and Cauchy CDFs" )
# Plots sample proportion by calling function shadePhat.
plotDist( "dprop", 15, 0.3, col="turquoise", main = "Sample proportion" )
par( mfrow=c(1,1) )
# }
Run the code above in your browser using DataLab