diff --git a/1.3-distributions.Rmd b/1.3-distributions.Rmd index de99613..c1a57bd 100644 --- a/1.3-distributions.Rmd +++ b/1.3-distributions.Rmd @@ -32,7 +32,7 @@ The expected value is $E(x) = np$ and the variance is $Var(x) = np(1-p)$. ```{r, echo=FALSE, fig.cap="Two examples of a binomial distribution. size: number of trials (the argument in the corresponding R function, for example in rbinom, is called size). p: success probability."} randombinom <- rbinom(100000, size=10, prob=0.3) -histrandombin <- hist(randombinom, breaks=seq(-0.5, 10.5,by=1), plot=FALSE) +histrandombin <- hist(randombinom, breaks=seq(-0.5, 10.5, by=1), plot=FALSE) par(mfrow=c(1,2), oma=c(0, 2, 0,0)) plot(histrandombin$mids, histrandombin$density, type="h", lwd=5,col="blue", las=1, xlim=c(0, 10), cex.lab=1.2, cex.axis=1, xlab="size=10, p=0.3", lend="butt", ylab="")