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:
sortedSample = c(0.246, 0.327, 0.423, 0.425, 0.434, 0.530, 0.583, 0.613, 0.641, 1.054, 1.098, 1.158, 1.163, 1.439, 1.464, 2.063, 2.105, 2.106, 4.363, 7.517)
plot(ecdf(sortedSample), main = "ECDF of Samples",
xlab = "Values", ylab = "Empirical CDF")
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.
cat("2B.\n")
## 2B.
cat("The Mean is ")
## The Mean is
cat(mean(sortedSample))
## 1.4876
cat("\n")
cat("The Variance is ")
## The Variance is
cat(var(sortedSample))
## 2.934267
cat("\n")
cat("The Median is ")
## The Median is
cat(median(sortedSample))
## 1.076
cat("\n\n")
quantile(sortedSample)
## 0% 25% 50% 75% 100%
## 0.24600 0.50600 1.07600 1.61375 7.51700
cat("\n")
cat("The IQR Range is Q3 - Q1 = 1.61375 - 0.506 = 1.10775")
## The IQR Range is Q3 - Q1 = 1.61375 - 0.506 = 1.10775
cat("2c. \n")
## 2c.
cat("The Square Root of the Variance is ")
## The Square Root of the Variance is
cat(sqrt(var(sortedSample)))
## 1.71297
cat("\n")
cat("The IQR Range is Q3 - Q1 = 1.61375 - 0.506 = 1.10775")
## The IQR Range is Q3 - Q1 = 1.61375 - 0.506 = 1.10775
cat("The P(Xhat > 0.5) is ")
## The P(Xhat > 0.5) is
cat(round(1 - pnorm(0.5, 0, 0.4025),4))
## 0.1071