Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

((using R progrem do the following )) 2. Standard normal distribution. Compute the following probabilities and quantiles. (a) P(1.6 < Z < 2.3). (b) P(Z

((using R progrem do the following ))

2. Standard normal distribution. Compute the following probabilities and quantiles. (a) P(1.6 < Z < 2.3). (b) P(Z < 1.64). (c) P(1.64 < Z < 1.02). (d) P(0 < Z < 1.96). (e) P(1.96 < Z < 1.96). (f) The quantiles z0.025, z0.05, z0.5, z0.95, and z0.975.

((script )) ######################################## # 3.2.2 Normal distribution ########################################

# Example 1 . ... library(TeachingDemos) vis.normal()

# Example 2. When population X is distributed as N(1.9, .25)... x <- rnorm(10000,1.9,0.5) mean(x) sd(x)

# Example 3. Suppose that the CCND3 (Cyclin D3) gene expression... pnorm(1.4, 1.9, 0.5) # left-side tail of the Normal cumulative density function (CDF)

dnormFun <- function(x) { dnorm(x,1.9,0.5) } x1<- seq(0,1.4,0.1) x2<- seq(1.4,4,0.1) plot(dnormFun, # function 0, # start 4, # end cex.lab=1.5, # make axis labels big xlab="x", ylab="Normal probability density function f(x)") polygon(c(0.0,x1,1.4), c(0,dnormFun(x1),0), col="magenta") polygon(c(1.4,x2,4.0), c(0,dnormFun(x2),0), col="lightblue") mtext("1.4",side=1,at=1.4, col="red") arrows(0.6,0.43,1.0,0.1, lwd=3, col="green") text(0.3, 0.55 - c(0,.10), cex = 1.2, adj=c(0,0), col="blue", c(expression(P(X <= 1.4)), expression(paste(" = ", integral(f(x) * dx, -infinity, 1.4)))))

pnormFun <- function(x) { pnorm(x,1.9,0.5) } plot(pnormFun, # function 0, # start 4, # end cex.lab=1.5, # make axis labels big col="red", lwd=6, # make line thicker xlab="x", ylab="Normal cumulative distribution function F(x)") mtext("1.4",side=1,at=1.4, col="red") mtext("0.16",side=2,at=0.16, col="red") arrows(0.9,0.45,1.4,0.16, lwd=3, col="green") text(0.5, 0.9 - c(0,.1,.2,.3,.4), cex=1.2, adj=c(0,0), col="blue", c(expression(P(X <= 1.4)), expression(paste(" = ", integral(f(x) * dx, -infinity, 1.4))), expression(paste(" = ", bgroup("[", F(x) ,"]")[-infinity]^1.4)), expression(paste(" = ", CDF(1.4))), expression(paste(" = ", 0.16))))

1 - pnorm(2.4, 1.9, 0.5) # right-side tail of normal cumulative density function (CDF) pnorm(2.4, 1.9, 0.5) - pnorm(1.4, 1.9, 0.5) # central area of the normal cumulative density function (CDF)

qnorm(0.025,1.9,0.5) # Normal quantile function pnorm(0.920018,1.9,0.5) # left-side tail of the Normal cumulative density function (CDF)

# Normal approximation to the binomial. x <- 0:20 np=11 xPolygon<- seq(0,20,0.1) dnormFun <- function(x) { dnorm(x,np,sqrt(np)) } plot(dnormFun, # normal density function 0, # start 20, # end col="lightblue", ylim=c(0,0.4), # range of the y-axis xlab="x", ylab="Density function f(x)", cex.lab=1.5) # make axis labels big polygon(c(0.0,xPolygon,20), c(0,dnormFun(xPolygon),0), col="lightblue") for (counter in 1:9) { lines(x, dbinom(x, size=counter*12, prob=np/(counter*12)), col=counter, lwd=2) } legend("topleft", lty=rep(1,10), lwd=rep(2,10), col=c("lightblue",1:9), legend=c(expression(Normal(mu == 11, sigma^2 == 11)), as.expression(sapply(seq(12,108, 12), function(x) bquote(B(n ==.(x), p == 11/.(x)))))))

# Normal approximation to the Poisson. x <- 0:20 xPolygon<- seq(0,20,0.1) dnormFun <- function(x) { dnorm(x,11,sqrt(11)) } plot(dnormFun, # normal density function 0, # start 20, # end col="lightblue", ylim=c(0,0.4), # range of the y-axis xlab="x", ylab="Density function f(x)", cex.lab=1.5) # make axis labels big polygon(c(0.0,xPolygon,20), c(0,dnormFun(xPolygon),0), col="lightblue") for (counter in 1:11) { lines(x, dpois(x,counter), col=counter, lwd=2) } legend("topright", lty=rep(1,12), lwd=rep(2,12), col=c("lightblue",1:11), legend=c(expression(Normal(mu == 11, sigma^2 == 11)), as.expression(sapply(1:11, function(x) bquote(Poisson(lambda ==.(x)))))))

######################################## # 3.2.2 Normal distribution ########################################

# Example 1 . ... library(TeachingDemos) vis.normal()

# Example 2. When population X is distributed as N(1.9, .25)... x <- rnorm(10000,1.9,0.5) mean(x) sd(x)

# Example 3. Suppose that the CCND3 (Cyclin D3) gene expression... pnorm(1.4, 1.9, 0.5) # left-side tail of the Normal cumulative density function (CDF)

dnormFun <- function(x) { dnorm(x,1.9,0.5) } x1<- seq(0,1.4,0.1) x2<- seq(1.4,4,0.1) plot(dnormFun, # function 0, # start 4, # end cex.lab=1.5, # make axis labels big xlab="x", ylab="Normal probability density function f(x)") polygon(c(0.0,x1,1.4), c(0,dnormFun(x1),0), col="magenta") polygon(c(1.4,x2,4.0), c(0,dnormFun(x2),0), col="lightblue") mtext("1.4",side=1,at=1.4, col="red") arrows(0.6,0.43,1.0,0.1, lwd=3, col="green") text(0.3, 0.55 - c(0,.10), cex = 1.2, adj=c(0,0), col="blue", c(expression(P(X <= 1.4)), expression(paste(" = ", integral(f(x) * dx, -infinity, 1.4)))))

pnormFun <- function(x) { pnorm(x,1.9,0.5) } plot(pnormFun, # function 0, # start 4, # end cex.lab=1.5, # make axis labels big col="red", lwd=6, # make line thicker xlab="x", ylab="Normal cumulative distribution function F(x)") mtext("1.4",side=1,at=1.4, col="red") mtext("0.16",side=2,at=0.16, col="red") arrows(0.9,0.45,1.4,0.16, lwd=3, col="green") text(0.5, 0.9 - c(0,.1,.2,.3,.4), cex=1.2, adj=c(0,0), col="blue", c(expression(P(X <= 1.4)), expression(paste(" = ", integral(f(x) * dx, -infinity, 1.4))), expression(paste(" = ", bgroup("[", F(x) ,"]")[-infinity]^1.4)), expression(paste(" = ", CDF(1.4))), expression(paste(" = ", 0.16))))

1 - pnorm(2.4, 1.9, 0.5) # right-side tail of normal cumulative density function (CDF) pnorm(2.4, 1.9, 0.5) - pnorm(1.4, 1.9, 0.5) # central area of the normal cumulative density function (CDF)

qnorm(0.025,1.9,0.5) # Normal quantile function pnorm(0.920018,1.9,0.5) # left-side tail of the Normal cumulative density function (CDF)

# Normal approximation to the binomial. x <- 0:20 np=11 xPolygon<- seq(0,20,0.1) dnormFun <- function(x) { dnorm(x,np,sqrt(np)) } plot(dnormFun, # normal density function 0, # start 20, # end col="lightblue", ylim=c(0,0.4), # range of the y-axis xlab="x", ylab="Density function f(x)", cex.lab=1.5) # make axis labels big polygon(c(0.0,xPolygon,20), c(0,dnormFun(xPolygon),0), col="lightblue") for (counter in 1:9) { lines(x, dbinom(x, size=counter*12, prob=np/(counter*12)), col=counter, lwd=2) } legend("topleft", lty=rep(1,10), lwd=rep(2,10), col=c("lightblue",1:9), legend=c(expression(Normal(mu == 11, sigma^2 == 11)), as.expression(sapply(seq(12,108, 12), function(x) bquote(B(n ==.(x), p == 11/.(x)))))))

# Normal approximation to the Poisson. x <- 0:20 xPolygon<- seq(0,20,0.1) dnormFun <- function(x) { dnorm(x,11,sqrt(11)) } plot(dnormFun, # normal density function 0, # start 20, # end col="lightblue", ylim=c(0,0.4), # range of the y-axis xlab="x", ylab="Density function f(x)", cex.lab=1.5) # make axis labels big polygon(c(0.0,xPolygon,20), c(0,dnormFun(xPolygon),0), col="lightblue") for (counter in 1:11) { lines(x, dpois(x,counter), col=counter, lwd=2) } legend("topright", lty=rep(1,12), lwd=rep(2,12), col=c("lightblue",1:11), legend=c(expression(Normal(mu == 11, sigma^2 == 11)), as.expression(sapply(1:11, function(x) bquote(Poisson(lambda ==.(x)))))))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Evaluate the impact of unions on nurses and physicians.

Answered: 1 week ago

Question

Describe the impact of strikes on patient care.

Answered: 1 week ago

Question

Evaluate long-term care insurance.

Answered: 1 week ago