Plot some Normal curves on the same graph:
plotDist("norm",mean=3,sd=2)
plotDist("norm",mean=3,sd=3,add=T,col="red")
plotDist("norm",mean=5,sd=2,add=T,col="green")
Plot a Normal curve with mean 0 and standard deviation 3 with the area between the values -2 and 1 shaded (it will be shaded in green):
pdist("norm", c(-2, 1), mean=0, sd=3)
## [1] 0.2524925 0.6305587
Plot a Normal curve with mean 0 and standard deviation 3 with the area between the 40th and 70th percentile shaded (it will be shaded in green):
qdist("norm",c(0.4, 0.7), mean=0, sd=3)
## [1] -0.7600413 1.5732015
Plot a Normal curve with mean 3 and standard deviation 4 with the area to the left of the value 2 shaded:
xpnorm(2,mean=3, sd=4)
##
## If X ~ N(3,4), then
##
## P(X <= 2) = P(Z <= -0.25) = 0.4013
## P(X > 2) = P(Z > -0.25) = 0.5987
## [1] 0.4012937
Plot a Normal curve with mean 3 and standard deviation 4 with the area to the left of the 60th percentile shaded:
xqnorm(.6,mean=3,sd=4)
## P(X <= 4.0133884125432) = 0.6
## P(X > 4.0133884125432) = 0.4
## [1] 4.013388
In a certain year, the SAT scores of 1.4 million students who took the test was Normally distributed with mean 1026 and standard deviation 209. Plot the Normal curve with these values:
plotDist("norm", mean=1026, sd=209)
What percentage of students got an SAT score higher than 1100? We can use the xpnorm to command to find out:
xpnorm(1100, mean=1026, sd=209)
##
## If X ~ N(1026,209), then
##
## P(X <= 1100) = P(Z <= 0.354) = 0.6384
## P(X > 1100) = P(Z > 0.354) = 0.3616
## [1] 0.6383557
From the graph, we can see that 63.84% of the test takers had a score less than or equal to 1100, and 36.16% had a score higher than 1100.
What was the cutoff score that a student had to achieve to be above the 80th percentile? We can use the xqnorm command to find out:
xqnorm(.8, mean=1026,sd=209)
## P(X <= 1201.89883781674) = 0.8
## P(X > 1201.89883781674) = 0.2
## [1] 1201.899
From the graph, we can see that a score of more than 1202 means that the test taker was above the 80th percentile.
What percentage of the test takers had an SAT score between 900 and 1100? We can use the pdist command to find out:
pdist("norm",c(900, 1100), mean=1026, sd=209)
## [1] 0.2732973 0.6383557
From the graph, we can see that 36.5% of the test takers got an SAT score between 900 and 1100.
Create a Normal quantile plot for the timetostart24 data:
time24<-read.file("/home/emesekennedy/Data/Ch1/timetostart24.txt")
## Reading data with read.table()
xqqmath(~TimeToStart,data=time24)
From the graph we can conclude that the observations are close to Normally distributed.
Create a Normal quantile plot for data set with the distribution of undergraduate students in the USA by state:
state<-read.file("/home/emesekennedy/Data/Ch1/collegebystate.txt",sep="\t", header=T)
## Reading data with read.table()
xqqmath(~Undergrads,data=state)
From the graph we can conclude that the observations are not Normally distributed.