Loading the Mosaic Package

Let’s load the Mosaic package:

require(mosaic)



Examples from Activity #14

Let’s recreate the graphs displayed at the beginning of this activity:
# Poisson Distribution
plotDist('pois', type="h", params=list(2), xlim=c(-.5,25.5), ylim=c(0,.3), lwd=20, lineend = 1, col="darkgrey", main="Poisson with lambda=2")

plot of chunk unnamed-chunk-3

plotDist('pois', type="h", params=list(10), xlim=c(-.5,25.5), ylim=c(0,.15), lwd=20, lineend = 1, col="darkgrey", main="Poisson with lambda=10")

plot of chunk unnamed-chunk-3

# Binomial Distribution
plotDist('binom', type="h", params=list(size=10, prob=0.300), xlim=c(-.5,10.5), ylim=c(0,.3), lwd=50, lineend = 1, col="darkgrey", main="Binomial with p=0.30 and n=10")

plot of chunk unnamed-chunk-3

plotDist('binom', type="h", params=list(size=10, prob=0.800), xlim=c(-.5,10.5), ylim=c(0,.3), lwd=50, lineend = 1, col="darkgrey", main="Binomial with p=0.30 and n=10")

plot of chunk unnamed-chunk-3

# Normal Distribution
plotDist("norm", params=list(mean=100, sd=16), lwd=4, col="black", main="Normal with mu=100, sigma=16")

plot of chunk unnamed-chunk-3

plotDist("norm", params=list(mean=110, sd=7), lwd=4, col="black", xlim=c(39,161), main="Normal with mu=110, sigma=7")

plot of chunk unnamed-chunk-3

Item characteristic curves similar to those displayed in question #4:
require(ltm)
## Loading required package: ltm
## Loading required package: MASS
## Loading required package: msm
## Loading required package: polycor
## Loading required package: mvtnorm
## Loading required package: sfsmisc
## Item Characteristic Curves LSAT questions
  pl3 <- plot(tpm(LSAT, type = "rasch", max.guessing = 1))
  text(2, 0.35, "Rasch model\nwith Guessing parameter")

plot of chunk unnamed-chunk-4