library(RcmdrMisc)
## Loading required package: car
## Loading required package: carData
## Loading required package: sandwich
.x <- seq(-3.291, 3.291, length.out=1000)
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x", ylab="Densidade",regions=list(c(-1, 1)), col=c('#0080C0', '#BEBEBE'), legend=FALSE)
#X ~ N(mu, sigma)
#Distribuição Normal Padrão #X ~ N( 0, 1 )
#Pr(-1<X<1) = 0,6826
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x", ylab="Densidade",regions=list(c(-1, 1)), col=c('#0080C0', '#BEBEBE'), legend=FALSE)
#Pr(-2<X<2) = 0,9544
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x", ylab="Densidade",regions=list(c(-2, 2)), col=c('darkgreen', '#BEBEBE'), legend=FALSE)
#Pr(-3<X<3) = 0,9974
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x", ylab="Densidade",regions=list(c(-3, 3)), col=c('skyblue', '#BEBEBE'), legend=FALSE)
#Pr(0<X<1) = 0,3413
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(0, 1)),
col=c('#0080C0', '#BEBEBE'), legend=FALSE)
#Pr(-2<X<0) = 0,9544/2 = 0,4772
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(-2, 0)),
col=c('darkgreen', '#BEBEBE'), legend=FALSE)
#Pr(0<X<3) = 0,9974/2 = 0,4987
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(0, 3)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
#Pr(1<X<2) = Pr(0<X<2) - P(0<X<1) = 0,4772 - 0,3413 = 0,1359
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(1,2)),
col=c('#BEBEBE', '#BEBEBE'), legend=FALSE)
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(0, 1),c(1,2)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
#Pr(2<X<3) = Pr(0<X<3) - Pr(0<X<2) = 0,4987-0,4772 = 0,0215
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(2,3)),
col=c('#BEBEBE', '#BEBEBE'), legend=FALSE)
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(0, 2),c(2,3)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
# Pr(-3<X<-2) = 0,0215
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(-3,-2)),
col=c('#BEBEBE', '#BEBEBE'), legend=FALSE)
#Pr(-3<X<-1) = P(-3<X<0) - P(-1<X<0) = 0,4987 - 0,3413 = 0.1574
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(-3,0),c(-1,0)),
col=c('#BEBEBE', 'skyblue'), legend=FALSE)
#Pr(-3<X<1) = P(-3<X<0) + P(0<X<1) = 0,4987 + 0,3413 = 0,84
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(-3, 0),c(0,1)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
# Pr(-2<X<0) = P(0<X<2) = 0,4772
#Pr(0 < X <1,34) = 0,40988
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(0,1.34)),
col=c('#BEBEBE', '#BEBEBE'), legend=FALSE)
#Pr( 0< X< 0,87) = 0,30785
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(0,0.87)),
col=c('#BEBEBE', '#BEBEBE'), legend=FALSE)
pnorm(0.87) - pnorm(0)
## [1] 0.3078498
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(3,10)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(-10,3)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
1 - pnorm(3)
## [1] 0.001349898
pnorm(3, lower.tail =F)
## [1] 0.001349898
#P(x>-2) = 0,9772 = 0,5 + P(0<X<2) = 0,5 + 0,4772
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(-2,10)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(-10,-2)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
#Pr(-0,87<X<2,97) = 0,8063
pnorm(2.97)-pnorm(-0.87)
## [1] 0.8063608
#Pr(0,13 <X<0,48) =
pnorm(0.48)-pnorm(0.13)
## [1] 0.1326695
#Pr(-2,77<X<-1,56) =
pnorm(-1.56)-pnorm(-2.77)
## [1] 0.05657713
pnorm(-1.46,lower.tail = F)
## [1] 0.927855
plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(-1.46,10)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
.x <- seq(500, 700, length.out=1000)
plotDistr(.x, dnorm(.x, mean=589, sd=400), cdf=FALSE, xlab="x",
ylab="Densidade",regions=list(c(550,600)),
col=c('skyblue', '#BEBEBE'), legend=FALSE)
X ~ N(589, 400) Pr(550<X<600) Z = (X - media)/sigma Z ~ N(0,1)
Pr(550<X<600) = Pr(550-589 <X-media<600-589) = Pr(-39<X - media<11) = Pr(-39/400<(X - media)/sigma<11/400) =
Pr(-0,0975< Z<0,0275) = pnorm(0.0275)-pnorm(-0.0975) = 0.04980486 Pr(550<X<600) = 0.04980486
Y ~ N(10, 5) Pr(8<Y<9) = Pr(8-10<Y-media<9-10) = Pr(-2<Y-media<-1) = Pr(-2/5<(Y-media)/sigma<-1/5) = Pr(-0,4<Z<-0,2) pnorm(-0.2)-pnorm(-0.4) = 0.07616203 Pr(8<Y<9) = 0,0761
W ~ N(47, 30) Pr(50<W<55) = Pr(50-47 <W-media<55-47) = Pr(3 <W-media<8) = Pr(3/30 <Z<8/30) = Pr(0,1 <Z<0,2667) =
pnorm(0.2667)-pnorm(0.1) =0.06532209 Pr(50<W<55) = 0,065322
X ~ N(13, 40) Pr(9<X<14) 0.04980036 Pr(9-13<X-media<14-13) Pr(-4<X-media<1) Pr(-4/40<(X-media)/sigma<1/40) Pr(-0,1<Z<0,025)
.x <- seq(-3.291, 3.291, length.out=1000)
plotDistr(.x, dnorm(.x, mean=0, sd=1),
cdf=FALSE, xlab="x",
ylab="Densidade",
regions=list(c(-0.1, 0.025)), col=c('#0080C0', '#BEBEBE'), legend=FALSE)
pnorm(0.025)-pnorm(-0.1)
## [1] 0.04980036
Y ~ N(5000,4000) Pr(4800<Y<4900) = Pr(4800-5000<Y-media<4900-5000) = Pr(-200<Y-media<-100) = Pr(-200/4000<Z<-100/4000) =
Pr(-0,05<Z<-0,025) =
plotDistr(.x, dnorm(.x, mean=0, sd=1),
cdf=FALSE, xlab="x",
ylab="Densidade",
regions=list(c(-0.05, -0.025)), col=c('#0080C0', '#BEBEBE'), legend=FALSE)
pnorm(-0.025)-pnorm(-0.05)
## [1] 0.009966288
W ~ N(70, 50) Pr(70<W< 80) Pr(70-70<W-media< 80-70) Pr(0<Z< 0.2)
plotDistr(.x, dnorm(.x, mean=0, sd=1),
cdf=FALSE, xlab="x",
ylab="Densidade",
regions=list(c(0, 0.2)), col=c('#0080C0', '#BEBEBE'), legend=FALSE)
pnorm(0.2) - pnorm(0) pnorm(0.2)-0.5 0.07925971
amostra_normal<-rnorm(100)
qqnorm(amostra_normal,col="red")
abline(a=0,b=1)
u=seq(0,3.09,by=0.01)
p=pnorm(u)
p=p-0.5
m=matrix(p,ncol=10,byrow=TRUE)
m=round(m,4)
DT::datatable(m)