100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Presentation

3. Introduction to R - Probability functions and Tables

Rating
5.0
(1)
Sold
-
Pages
65
Uploaded on
08-07-2018
Written in
2017/2018

Step by step walkthrough covering the use of the following functions rnorm() pnorm() rexp() pexp() pbinom() dbinom() ppois() table() tapply() sd() prop.table() Examples are provided along with questions and answers. link to sample data is provided in the presentation

Show more Read less
Institution
Course

















Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Course

Document information

Uploaded on
July 8, 2018
Number of pages
65
Written in
2017/2018
Type
Presentation
Person
Unknown

Subjects

Content preview

Introduction to R –
Probabilities and tables
Link to the data used is provided

,Let’s start at the beginning
• Open RStudio; create a new script
• Clear R’s memory
• Set your working directory to the same folder you used for the oth
sessions

,Let’s start at the beginning
• Open RStudio; create a new script
• Clear R’s memory
rm(list=ls())

• Set your working directory to the same folder you used for the oth
sessions
setwd(“C:/Users/dtros/Documents/Using R/Session 1”)

,
,Probability Distributions
R has functions for a variety of probability distributions

,Function rnorm()
• To begin let’s find out what rnorm() is
• Bring up this functions help file

,
,Function rnorm()
• To begin let’s find out what rnorm() is
• Bring up this functions help file
• Were you able to do it? Remember that you can bring up a functio
help file using
?rnorm
• This is the last function in the list for ‘Normal Distribution’
• The description of rnorm() is as follows – rnorm() generates
random numbers that are from a normal distribution
• Run the following
x <- rnorm(100000, mean = 0, sd = 1)

,
, Function rnorm()
• Run the following
x <- rnorm(100000, mean = 0, sd = 1)

• As you can see, including spaces does not make a difference at this
point, as long as you have used the correct arguments and have
placed them in the correct order
• This line of code has produced 100 000 values from a standard
normal distribution; with a mean of 0 and a standard deviation of 1
$3.08
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
dominique13
4.3
(3)

Also available in package deal

Reviews from verified buyers

Showing all reviews
6 year ago

5.0

1 reviews

5
1
4
0
3
0
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
dominique13 University of Cape Town
Follow You need to be logged in order to follow users or courses
Sold
7
Member since
7 year
Number of followers
5
Documents
21
Last sold
3 year ago

4.3

3 reviews

5
1
4
2
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions