DOC PREVIEW
UF STA 6166 - Generating Random Samples

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Generating Random SamplesPopulation of Data  SampleAll ATL/HNL 10/2004 Delta Flights (N=31)SAS Code to Generate Random Sample (n=10)Generating Random Samples in EXCELEXCEL Random Sample (n=10)Random Samples in JMPRandom Samples in SPSSGenerating Random SamplesSAS, EXCEL, JMP, SPSSPopulation of Data → Sample• Data should be in a dataset where each row represents an individual unit, and column fields represent variables measured on the individual• A new column field will be created that contains a pseudo-random number generated by statistical software package (usually Uniform(0,1) r.v.)• Data are sorted by the random number, or simply selected for analysis (depending on software)All ATL/HNL 10/2004 Delta Flights (N=31)Day Fl ightNum Tai lNum DestCity Taxi Time Sched Actual Di stance1 317 N834MH HNL 29 580 567 44962 317 N836MH HNL 21 580 582 44963 317 N844MH HNL 24 580 592 44964 317 N838MH HNL 19 580 601 44965 317 N827MH HNL 13 580 567 44966 317 N830MH HNL 16 580 585 44967 317 N833MH HNL 17 580 569 44968 317 N828MH HNL 14 580 568 44969 317 N844MH HNL 22 580 569 449610 317 N843MH HNL 14 580 553 449611 317 N830MH HNL 12 580 531 449612 317 N834MH HNL 21 580 538 449613 317 N828MH HNL 28 580 545 449614 317 N826MH HNL 22 580 542 449615 317 N843MH HNL 23 580 558 449616 317 N825MH HNL 16 580 558 449617 317 N837MH HNL 20 580 579 449618 317 N838MH HNL 26 580 584 449619 317 N844MH HNL 17 580 583 449620 317 N826MH HNL 28 580 582 449621 317 N831MH HNL 17 580 577 449622 317 N845MH HNL 20 580 582 449623 317 N843MH HNL 17 580 583 449624 317 N829MH HNL 22 580 596 449625 317 N839MH HNL 19 580 589 449626 317 N830MH HNL 16 580 586 449627 317 N844MH HNL 18 580 567 449628 317 N834MH HNL 27 580 582 449629 317 N835MH HNL 61 580 627 449630 317 N830MH HNL 14 580 580 449631 317 N840MH HNL 16 580 576 4496SAS Code to Generate Random Sample (n=10)Data Pop;Input Day FlightNum TailNum $ DestCity $ TaxiTime SchedActual Distance;Ranx=Ranuni(seed); /* Put in a number where “seed” is */Cards;1 317 N834MH HNL 29 580 567 4496…31 317 N840MH HNL 16 580 576 4496;Proc Sort; By Ranx;Data Sample;Set Pop;If _N_ <= 10;Run;/* You can run any procedures now on the Sample */Generating Random Samples in EXCEL• In a new column past the data, type in the first row containing data on a unit: =RAND()• COPY and PASTE that cell until all N units have a random number• While that range of N cells is still highlighted, click on COPY ⇒ EDIT ⇒ PASTE SPECIAL ⇒ Click on VALUES (This changes them from Dynamic to Static)• Place Cursor in Data Field, Click on: DATA ⇒ SORT ⇒ Choose Column with Random Values and Choose appropriate Header Row Status• After data are sorted, COPY and PASTE (SPECIAL VALUES) the first n units to a new worksheetDayFl ightNum Tail Num DestCity TaxiTime Sched Actual Distance RANX1 317 N834MH HNL 29 580 567 4496 0.3508122 317 N836MH HNL 21 580 582 4496 0.7521613 317 N844MH HNL 24 580 592 4496 0.1874534 317 N838MH HNL 19 580 601 4496 0.1887035 317 N827MH HNL 13 580 567 4496 0.4600546 317 N830MH HNL 16 580 585 4496 0.4005677 317 N833MH HNL 17 580 569 4496 0.1828548 317 N828MH HNL 14 580 568 4496 0.0212219 317 N844MH HNL 22 580 569 4496 0.62688210 317 N843MH HNL 14 580 553 4496 0.81640211 317 N830MH HNL 12 580 531 4496 0.09895612 317 N834MH HNL 21 580 538 4496 0.05544713 317 N828MH HNL 28 580 545 4496 0.75803114 317 N826MH HNL 22 580 542 4496 0.83290115 317 N843MH HNL 23 580 558 4496 0.12899216 317 N825MH HNL 16 580 558 4496 0.03867917 317 N837MH HNL 20 580 579 4496 0.07999118 317 N838MH HNL 26 580 584 4496 0.79924819 317 N844MH HNL 17 580 583 4496 0.62270120 317 N826MH HNL 28 580 582 4496 0.75953821 317 N831MH HNL 17 580 577 4496 0.63007722 317 N845MH HNL 20 580 582 4496 0.19702323 317 N843MH HNL 17 580 583 4496 0.17576724 317 N829MH HNL 22 580 596 4496 0.4225 317 N839MH HNL 19 580 589 4496 0.0348226 317 N830MH HNL 16 580 586 4496 0.18341427 317 N844MH HNL 18 580 567 4496 0.51878428 317 N834MH HNL 27 580 582 4496 0.18511429 317 N835MH HNL 61 580 627 4496 0.22069430 317 N830MH HNL 14 580 580 4496 0.64334731 317 N840MH HNL 16 580 576 4496 0.522772Random Numbers (Not Sorted Yet)DayFlightNum TailNum DestCity TaxiTime S ched Actual Distance RANX8 317 N828MH HNL 14 580 568 4496 0.02122125 317 N 839MH H N L 19 580 589 4496 0.0348216 317 N 825MH H N L 16 580 558 4496 0.03867912 317 N 834MH H N L 21 580 538 4496 0.05544717 317 N 837MH H N L 20 580 579 4496 0.07999111 317 N 830MH H N L 12 580 531 4496 0.09895615 317 N 843MH H N L 23 580 558 4496 0.12899223 317 N 843MH H N L 17 580 583 4496 0.1757677 317 N833MH HNL 17 580 569 4496 0.18285426 317 N 830MH H N L 16 580 586 4496 0.18341428 317 N 834MH H N L 27 580 582 4496 0.1851143 317 N844MH HNL 24 580 592 4496 0.1874534 317 N838MH HNL 19 580 601 4496 0.18870322 317 N 845MH H N L 20 580 582 4496 0.19702329 317 N 835MH H N L 61 580 627 4496 0.2206941 317 N834MH HNL 29 580 567 4496 0.3508126 317 N830MH HNL 16 580 585 4496 0.40056724 317 N 829MH H N L 22 580 596 4496 0.425 317 N827MH HNL 13 580 567 4496 0.46005427 317 N 844MH H N L 18 580 567 4496 0.51878431 317 N 840MH H N L 16 580 576 4496 0.52277219 317 N 844MH H N L 17 580 583 4496 0.6227019 317 N844MH HNL 22 580 569 4496 0.62688221 317 N 831MH H N L 17 580 577 4496 0.63007730 317 N 830MH H N L 14 580 580 4496 0.6433472 317 N836MH HNL 21 580 582 4496 0.75216113 317 N 828MH H N L 28 580 545 4496 0.75803120 317 N 826MH H N L 28 580 582 4496 0.75953818 317 N 838MH H N L 26 580 584 4496 0.79924810 317 N 843MH H N L 14 580 553 4496 0.81640214 317 N 826MH H N L 22 580 542 4496 0.832901Data Sorted By Random NumberEXCEL Random Sample (n=10)DayFlightNum TailNum DestCity TaxiTime Sched Actual Distance RANX8 317 N 828MH HN L 14 580 568 4496 0.02122125 317 N 839MH HN L 19 580 589 4496 0.0348216 317 N 825MH HN L 16 580 558 4496 0.03867912 317 N 834MH HN L 21 580 538 4496 0.05544717 317 N 837MH HN L 20 580 579 4496 0.07999111 317 N 830MH HN L 12 580 531 4496 0.09895615 317 N 843MH HN L 23 580 558 4496 0.12899223 317 N 843MH HN L 17 580 583 4496 0.1757677 317 N 833MH HN L 17 580 569 4496 0.18285426 317 N 830MH HN L 16 580 586 4496 0.183414Random Samples in JMP• Import Data into JMP• Click on TABLES ⇒ SUBSET ⇒ RANDOM …


View Full Document

UF STA 6166 - Generating Random Samples

Documents in this Course
Exam 1

Exam 1

4 pages

Exam 1

Exam 1

4 pages

Exam 1

Exam 1

4 pages

VARIABLES

VARIABLES

23 pages

Exam #2

Exam #2

4 pages

Exam2

Exam2

6 pages

Sampling

Sampling

21 pages

Exam 1

Exam 1

4 pages

Exam 1

Exam 1

5 pages

Load more
Download Generating Random Samples
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Generating Random Samples and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Generating Random Samples 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?