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

Summary Random sampling

Rating
-
Sold
-
Pages
8
Uploaded on
20-09-2025
Written in
2025/2026

Statistics 244 Random Sampling summary and R code descriptions.










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

Document information

Uploaded on
September 20, 2025
Number of pages
8
Written in
2025/2026
Type
Summary

Subjects

Content preview

CHAPTER I RANDOM SAMPLING
In statistics we obtain a sample of values from a population
For the results to be valid the observations in the sample
must be chosen randomly so that they're independent of
each other
If sampling is not random any inferences drawn from the
sample may be unreliable or incorrect
1 Random number generators
Generated by a computer pseudo random numbers
Not absolutely random
They repeat
Purpose To select random samples from a population
to create hypothetical datasets with specific
characteristics when actual datasets are
hard to obtain

In Excel
1 RANDBETWEEN function
This generates random numbers but they recalculate
each time the sheet changes
In order keep them fixed we need to copy paste
to
them as values
2 Another method to generate the same random number
sequence each time is to use a random seed
steps Data Data analysis toolpack random number
generation enter data seed ok
3 When it comes to generating random
integers we run into
a problem
Most random number generators in Excel generate real
nummboers between o 1
Lets say we want to generate random integers between
20 we need to take the
1
following steps
1 Generate real numbers between o 1

tseeiebdeEInffinctidnetoi.fiEGup to get integers

, 9




4 The last method is simple Random sampling SRS It's a
method of selecting a sample from a population so that
every member has an equal chance of being chosen
Unbiased
Eg Draw a SRS of size n 30 from a finite set of N 76
1 Number the population 1 76
2 Use the random number generator with a seed
NOTE generate more than 30 random numbers so
that duplicates can be deleted
3 Convert these random numbers to integers
4 Remove duplicates generate more random numbers
if needed to get to 30
5 The final random 30 numbers is your SRS

In R
1 Random numbers can begeneratedfrom a uniform distribution
all values between o I are equally likely to be generated
using the runif n min max function
n how many random numbers you want
min the smallest possible value
max the largest possible value
R doesn't recalculate random numbers automatically like Excel
does but if you close R and come back to your code later you'l
get different numbers
To solve this we use the set seed function
2 By default runif produces random numbers between 0 1
but if we'd like to generate for example 30 random integers
the following steps need to be taken
1 Generate random numbers
integer vs number
between 0 1
2 Multiply them by 30
3 Use ceiling function to round
them up into whole numbers
R100,00
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
yatesmegan29

Get to know the seller

Seller avatar
yatesmegan29
View profile
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
2 year
Number of followers
0
Documents
19
Last sold
10 months ago

0,0

0 reviews

5
0
4
0
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 exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT 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