Bibliotecas:
library(RcmdrMisc)
library(car)
library(carData)
library(sandwich)
x =seq(-3.291, 3.291, length.out=1000)
Z ~ N(0,1) Pr(-1 <z <2,1) = Pr(1 <z <0) - Pr(0 <z <2,1) = 0,98214 - 0,84134 = 0,1408
0.98214 - 0.84134
## [1] 0.1408
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(-1,0), c(0,2.1)), col = c("tomato", "pink"), legend = FALSE)
pnorm(2.1) - pnorm(1)
## [1] 0.1407908
Pr(-0,87 <z <1,54) = Pr(o,87 <z <0) + Pr(0 <z <1,547) = 0,3078 + 0,4382 = 0,746
0.3078 + 0.4382
## [1] 0.746
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(-0.87,0), c(0,1.54)), col = c("tomato", "pink"), legend = FALSE)
pnorm(1.54) - pnorm(-0.87)
## [1] 0.7460696
Pr(z = 1,54) = 0,9382198
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(0,1.54)), col = c("tomato"), legend = FALSE)
pnorm(1.54)
## [1] 0.9382198
Pr(Z > 2,5) = Pr(2,5 <z <3) = 0,0049
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(2.5,3)), col = c("tomato"), legend = FALSE)
pnorm(3) - pnorm(2.5)
## [1] 0.004859767
X ~ N(500,300) Pr(x <500) = Pr(-350/300 < x) = Pr(0 < x) = 0,9986501
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(0,3)), col = c("tomato"), legend = FALSE)
pnorm(3)
## [1] 0.9986501
Pr(400 <x < 710) = Pr(-100/300 <x <210/300) = Pr(-0,33 <x <0,7) = 0,2580 + 0,1299 = 0,3873
0.2580 + 0.1293
## [1] 0.3873
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(-0.33,0), c(0,0.7)), col = c("tomato", "pink"), legend = FALSE)
pnorm(0.7) - pnorm(-0.33)
## [1] 0.3873364
Pr(330 < x <450) = Pr(-170/300 <x <-50/300) = Pr(-0,56 <x <-0,16) = -0,1487008
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(-0.56,0), c(-0.16,0)), col = c ("tomato", "pink"), legend = FALSE)
pnorm(-0.56,0) - pnorm(-0.16)
## [1] -0.1487008
Y ~ N(100,20) Pr(50 <y < 70) = Pr(-50/20 <y <-30/20) = Pr(-2,5 <x < -1,5) = Pr(2,5 <x <1,5) = 0,06059754
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(-2.5,0), c(-1.5,0)), col = c ("tomato", "pink"), legend = FALSE)
pnorm(2.5) - pnorm(1.5)
## [1] 0.06059754
Pr(150 <y <110) = Pr(5/20 <y < 10/20) = Pr(0,25 <y < 0,5) = -0,09275614
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list(c(0,0.5), c(0,0.25)), col = c ("tomato", "pink"), legend = FALSE)
pnorm(0.25) - pnorm(0.5)
## [1] -0.09275614
Pr(y > 75) = Pr(y > 25/20) = Pr(y > -1,25) = 0,8930003
plotDistr(x, dnorm(x, mean = 0, sd = 1), cdf = FALSE, regions = list( c(-1.25,3)), col = c ("tomato"), legend = FALSE)
pnorm(3) - pnorm(-1.25)
## [1] 0.8930003