This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
#Objetivo
#Realizar al algunos cálculos de probabilidad haciendo uso de la Distribución Normal Estándard y mediante la función dnorm()
#Propiedades
#*Una variable aleatoria que tiene una distribución normal con una media cero y desviación estándar de uno tiene una distribución normal estándar.
#*Esta distribución tiene el mismo aspecto general que cualquier otra distribución normal, pero tiene las propiedades especiales, μ=0 y σ=1.
#*La fórmula de densidad está dada por
#*Por costumbre, se utiliza z para representr la función de densidad en lugar de x en el caso de la distribución normal estándard, para la distribción normal se regresa a F(x) o p(x)
#F(z)=12pi−−−√e−z2/2
#Las librerias
library(mosaic)
## Loading required package: dplyr
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## Loading required package: lattice
## Loading required package: ggformula
## Loading required package: ggplot2
## Loading required package: ggstance
##
## Attaching package: 'ggstance'
## The following objects are masked from 'package:ggplot2':
##
## geom_errorbarh, GeomErrorbarh
##
## New to ggformula? Try the tutorials:
## learnr::run_tutorial("introduction", package = "ggformula")
## learnr::run_tutorial("refining", package = "ggformula")
## Loading required package: mosaicData
## Loading required package: Matrix
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Note: If you use the Matrix package, be sure to load it BEFORE loading mosaic.
##
## Have you tried the ggformula package for your plots?
##
## Attaching package: 'mosaic'
## The following object is masked from 'package:Matrix':
##
## mean
## The following object is masked from 'package:ggplot2':
##
## stat
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
#1. Encontar la probabildiad para cuando p(z≤1) con μ=0 y σ=1. Se usa pnorm() para encontrar probabilidad acumulada
pnorm(1, mean = 0, sd= 1)
## [1] 0.8413447
#Visualizar la distribución de probabilidad normal estándard para cuando μ=0 y σ=1
plotDist("norm", mean = 0, sd = 1, groups = x < 1, type = "h")
#2. Encontar la probabilidad para cuando p(−0.50≤x≤1.25) con μ=0 y σ=1. Se usa pnorm() para encontrar probabilidad acumulada y restando p(1.25)−p(−0.50)
pnorm(1.25, mean = 0, sd= 1) -pnorm(-0.50, mean = 0, sd= 1)
## [1] 0.5858127
#Visualizar la distribución de probabilidad normal estándard para cuando μ=0 y σ=1
plotDist("norm", mean = 0, sd = 1, groups = x > -0.50 & x < 1.25, type = "h")
#cuando p(z≥1.58) con μ=0 y σ=1. Se usa pnorm() para encontrar probabilidad acumulada y restando p(x>1.58)=1−p(x≤1.58)
1 - pnorm(c(1.58), mean = 0, sd= 1)
## [1] 0.05705343
#pnorm(c(1.58), mean = 0, sd= 1, lower.tail= F)
#Visualizar la distribución de probabilidad normal estándard para cuando μ=0 y σ=1
plotDist("norm", mean = 0, sd = 1, groups = x > 1.58, type ="h")
#Distribución de Probabilidad Normal
#*Para cuando cuando media es diferente de cero y
#*Desviación estándard es diferente de 1
#*Realizar estos ejemplos: …
#Visualizar la distribución de probabilidad normal estándard para cuando μ=0 y σ=1
#*Media = 10
#*Desviación = 2
plotDist("norm", mean = 10, sd = 2, groups = x > 10 & x < 14, type ="h")#Media = 10 * Desviación = 2 p(x≤14)−p(x≤10)
pnorm(14, mean = 10, sd = 2) - pnorm(10, mean = 10, sd = 2)
## [1] 0.4772499
#¿Cual es la probabilidad de que sea mayor que 12?
#p(x≥12) 1−p(x≤12) p(x≥12)
#por la derecha
#Visualizando
plotDist("norm", mean = 10, sd = 2, groups = x > 12, type ="h")
#Opción 1
1 - pnorm(q=12, mean = 10, sd = 2)
## [1] 0.1586553
#Opción 2
pnorm(q=12, mean = 10, sd = 2, lower.tail = FALSE)
## [1] 0.1586553
You can also embed plots, for example:
Note that the echo = FALSE
parameter was added to the code chunk to prevent printing of the R code that generated the plot.