dnorm(0)
## [1] 0.3989423
dnorm(1)
## [1] 0.2419707
dnorm(-1)
## [1] 0.2419707
dnorm(3)
## [1] 0.004431848
x <- seq(-3, 3, by = .01)
#x
#dnorm(x)
plot(x, dnorm(x), type = "line")
## Warning in plot.xy(xy, type, ...): plot type 'line' will be truncated to first
## character
pnorm(0)
## [1] 0.5
pnorm(-1)
## [1] 0.1586553
pnorm(2)
## [1] 0.9772499
plot(x, pnorm(x), type = "line")
## Warning in plot.xy(xy, type, ...): plot type 'line' will be truncated to first
## character
__q*__ – quantile function
__r*__ – random numbers
set.seed(42)
rnorm(1)
## [1] 1.370958
rnorm(10)
## [1] -0.56469817 0.36312841 0.63286260 0.40426832 -0.10612452 1.51152200
## [7] -0.09465904 2.01842371 -0.06271410 1.30486965
iq <- rnorm(10, mean = 100, sd = 15)
hist(iq)
many_means <- replicate(100000, mean(rnorm(100, mean = 100, sd = 15)))
hist(many_means)
hist(rlnorm(100))
many_log_means <- replicate(100000, mean(rlnorm(100)))
hist(many_log_means)