Some (Pseudo-) Random Number Stuff in R

Some (Pseudo-) Random Number Stuff in R

Some (Pseudo-) Random Number Stuff in R Use runif to make a vector of

Random numbers with a uniform distribution Uniform means the number is as likely to fall between 0.1 and 0.2 as between 0.5 and 0.6, and so on.

As opposed to a normal distribution around of mean of 0.5, then it is more likely to be close to the mean. Result a vector with 100 elements or components

Apply some of the statistical methods to the vector. Using the ifelse() method to turn the

uniform numbers into a coin-toss simulation Another way of simulating a coin toss in R using sample

The table method gets us the frequencies The replace=TRUE part puts a value

back into the set after it is picked. It allows duplications The replace=FALSE part does not put a value back into the set after it

is picked. It prevents duplications If the range is 1 to 6 and replace=TRUE we have simulated 100 die rolls. Then the table

method yields the frequencies You can make a fast histogram of the die roll simulation by entering hist(dice)

Adding a breaks argument a sequence from 0.5 to 6.5 made the histogram a little nicer

Recently Viewed Presentations

  • A Very Brief History of Western Art - Ms. Liew's Class

    A Very Brief History of Western Art - Ms. Liew's Class

    A Very Brief History of Western Art. Prehistory to the Modern Day. Prehistory. Where and When: Europe (mostly modern day France, _____ and Germany) from about 30 000 BCE-2500 BCE. Important Characteristics: Cave paintings and _____ ...
  • Waters of the Ocean - Diamond Bar High School

    Waters of the Ocean - Diamond Bar High School

    Wave Shoaling. Tides. Rising and falling of water in rhythmic patterns. Dominant influence on the seashore. It is caused by the gravitational pull of the moon and sun and by the rotation of the earth around the sun.
  • Lesson 6.9: Scientific Notation - Kamehameha Schools

    Lesson 6.9: Scientific Notation - Kamehameha Schools

    5 jumps 9 jumps Objective - To use scientific notation to write very large or very small numbers. Scientific Notation Examples: 6,320,000,000 0.000027 = = 11 jumps 4 jumps 7 jumps Large Numbers (positive exponent) Small Numbers (negative exponent) 59,000,000...
  • Imperial College London

    Imperial College London

    How do you build a good Hamiltonian for CEID? Andrew Horsfield, Lorenzo Stella, Andrew Fisher
  • DegreeWorks Presentation April 26, 2010 1 The Office

    DegreeWorks Presentation April 26, 2010 1 The Office

    Takes students to the CUNY Portal Login page. Frequently Asked Questions and Answers. Provides helpful links for students: Lehman's College Website, Registrar's Homepage, Academic Advisement Appointments, etc. Print the Degree Audit. Log out from the DegreeWorks system.
  • The Water Cycle - Daslos Studios LLC

    The Water Cycle - Daslos Studios LLC

    For unit objectives see: Scope & Sequence Water Cycle Song Directions: Click the link below for music to go along with the song. Click back to the lyrics and have fun. To stop music just click on the link again...
  • 獻上感恩 Give Thanks

    獻上感恩 Give Thanks

    歡欣 心裡感謝神 歌唱 歸於聖父 讚頌祢賜下慈愛獨生的愛子 Give thanks with a grateful heart Give thanks to the Holy One Give thanks because He's given Jesus Christ His Son 歡欣 心裡感謝神 歌唱 歸於聖父 讚頌祢賜下慈愛獨生的愛子 Give thanks with a grateful heart Give thanks to...
  • Factorial ANOVA - Stanford University

    Factorial ANOVA - Stanford University

    The factorial design is used to study the relationship of two or more independent variables (called factors) to a dependent variable, where each factor has two or more levels. In this design, you can evaluate the main effects of each...