Background

What is the purpose of this worksheet?

  1. Learn using basic R, practice using Markdown;
  2. Create simulations for order statistics.

For more info, formatting, and technical background, see previous handout (on sampling distributions).

Installing and loading packages

Just like every other programming language you may be familiar with, R’s capabilities can be greatly extended by installing additional “packages” and “libraries”.

To install a package, use the install.packages() command. You’ll want to run the following commands to get the necessary packages for today’s lab:

install.packages("ggplot2")

You only need to install packages once. Once they’re installed, you may use them by loading the libraries using the library() command. For today’s lab, you’ll want to run the following code

library(ggplot2) # graphics library

Problem 1: \(N(0,1)\)

# your  code here

Discuss. What do you see?

Problem 2: \(Gamma(1.5,5)\)

# your  code here

Discuss. What do you see?

License

This document is created for Math 563, Spring 2021, at Illinois Tech, taught by Sonja Petrovic1

While the course materials are generally not to be distributed outside the course without permission of the instructor, this particular set of notes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License


  1. Sonja Petrović, Associate Professor of Applied Mathematics, College of Computing, Illinios Tech. Homepage, Email.↩︎