#Variable 1 = SAT score #Variable 2 = college GPA mu1 <- 1040 mu2 <- 3.02 sigma1 <- 153 sigma2 <- 0.58 rho <- 0.35 library(mvtnorm) mu.vec=c(mu1,mu2) covar <- sigma1*sigma2*rho covmat=matrix(c(sigma1^2,covar,covar,sigma2^2),nrow=2,byrow=T) # What is the probability that a randomly selected student has # an SAT of less than 1000 and a GPA of less than 2.7? pmvnorm(lower=c(-Inf,-Inf), upper=c(1000,2.7), mean=mu.vec, sigma=covmat)[1] # What is the probability that a randomly selected student has # an SAT of more than 1100 and a GPA of less than 2.7? pmvnorm(lower=c(1100,-Inf), upper=c(Inf,2.7), mean=mu.vec, sigma=covmat)[1] # What is the probability that a randomly selected student has # an SAT of between 900 and 1000 and a GPA of between 3.6 and 3.9? pmvnorm(lower=c(900,3.6), upper=c(1000,3.9), mean=mu.vec, sigma=covmat)[1]