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:
# Distribución Chi-cuadrado
gl=12
n=10000
x=rchisq(n,gl)
hist(x,freq=FALSE,breaks=50,ylim=c(0,0.15),main="Distribución Chi-cuadrado")
xx=seq(0,35,0.1)
lines(xx,dchisq(xx,gl))
alfa=0.05
d=qchisq(1-alfa,gl)
cat("d=",d,"\n")
## d= 21.02607
abline(v=d)
p=pchisq(d,gl)
cat("p=",p)
## p= 0.95