Plot some Normal curves on the same graph:
plotDist("norm",mean=3,sd=4)
plotDist("norm",mean=3,sd=5,add=T,col="red")
plotDist("norm",mean=5,sd=5,add=T,col="green")
Plot a Normal curve with mean 1 and standard deviation 3 with the area between the values -2 and 3 shaded (it will be shaded in green):
pdist("norm", c(-2,3), mean=1, sd=3)
## [1] 0.1586553 0.7475075
Plot a Normal curve with mean 1 and standard deviation 3 with the area between the 45th and 70th percentile shaded (it will be shaded in green):
qdist("norm", c(0.45, 0.7), mean=1,sd=3)
## [1] 0.623016 2.573202
Plot a Normal curve with mean 3 and standard deviation 2 with the area to the left of the value 2 shaded:
xpnorm(2, mean=3, sd=2)
##
## If X ~ N(3,2), then
##
## P(X <= 2) = P(Z <= -0.5) = 0.3085
## P(X > 2) = P(Z > -0.5) = 0.6915
## [1] 0.3085375
Plot a Normal curve with mean 3 and standard deviation 2 with the area to the left of the 60th percentile shaded:
xqnorm(0.6, mean=3, sd=2)
## P(X <= 3.5066942062716) = 0.6
## P(X > 3.5066942062716) = 0.4
## [1] 3.506694
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(0.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.
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.