SlideShare ist ein Scribd-Unternehmen logo
1 von 15
SAS Samples Assurant Health SAS Users 11/18/2008 Irvin Snider
Systematic Sample From Known Number of Observations
data  work.subset; do pickit=1 to 395 by 15; set sashelp.shoes point=pickit; output; end; stop; run ;
$1,468 $181,739 $54,791 4 Madrid Men's Dress Western Europe 16 $9,845 $595,118 $175,694 12 Heidelberg Men's Casual Western Europe 15 $3,039 $226,678 $70,790 15 Seattle Boot United States 14 $10,194 $754,157 $293,313 37 Chicago Women's Dress United States 13 $361 $39,256 $8,365 22 Montevideo Sport Shoe South America 12 $939 $23,822 $11,759 8 Buenos Aires Slipper South America 11 $1,449 $110,179 $31,503 21 Manila Boot Pacific 10 $1,278 $158,688 $42,760 6 Auckland Women's Dress Pacific 9 $43 $1,836 $449 2 Al-Khobar Sport Shoe Middle East 8 $3,983 $520,271 $127,033 11 Moscow Slipper Eastern Europe 7 $1,012 $78,950 $30,157 3 Mexico City Men's Dress Central America/Caribbean 6 $20,470 $671,837 $353,361 25 Vancouver Men's Casual Canada 5 $488 $54,677 $12,601 2 Calgary Women's Dress Canada 4 $844 $66,017 $16,282 25 Nairobi Boot Africa 3 $1,565 $130,025 $39,452 12 Johannesburg Slipper Africa 2 $769 $191,821 $29,761 12 Addis Ababa Boot Africa 1 Returns Inventory Sales Stores Subsidiary Product Region Obs
Systematic Sample From Unknown Number of Observations
data  work.subset; do pickit=1 to totobs by 25; set sashelp.shoes point=pickit nobs=totobs; output; end; stop; run ;
Random Sample with Replacement
data  work.rsubset (drop=i sampsize); sampsize = 10; do i=1 to sampsize; pickit=ceil(ranuni(0)*totobs); set sashelp.shoes point=pickit nobs=totobs; output; end; stop; run ;
Random Sample without Replacement
data  work.rsubset (drop=obsleft sampsize); sampsize=10; obsleft=totobs; do while (sampsize > 0); pickit + 1; if ranuni(0)<sampsize/obsleft then do; set sashelp.shoes point=pickit nobs=totobs; output; sampsize=sampsize- 1 ; end; obsleft=obsleft-1; end; stop; run ;
Permuted Blocks Randomization for Equal Allocation to Treatments A and B
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
End ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank You

Weitere ähnliche Inhalte

Andere mochten auch

Angelia Explorer Report
Angelia Explorer ReportAngelia Explorer Report
Angelia Explorer Report
Brooke Young
 
Olenka Explorer Report.
Olenka Explorer Report.Olenka Explorer Report.
Olenka Explorer Report.
Brooke Young
 
Omar Explorer Report
Omar Explorer ReportOmar Explorer Report
Omar Explorer Report
Brooke Young
 
Bloga Sortzen Ibai Uriz
Bloga Sortzen Ibai UrizBloga Sortzen Ibai Uriz
Bloga Sortzen Ibai Uriz
ibai1993
 

Andere mochten auch (20)

Understanding Malaysian Health Statistics
Understanding Malaysian Health StatisticsUnderstanding Malaysian Health Statistics
Understanding Malaysian Health Statistics
 
Data management & statistics in clinical trials
Data management & statistics in clinical trialsData management & statistics in clinical trials
Data management & statistics in clinical trials
 
8.Calculate samplesize for clinical trials (continuous outcome)
8.Calculate samplesize for clinical trials (continuous outcome)8.Calculate samplesize for clinical trials (continuous outcome)
8.Calculate samplesize for clinical trials (continuous outcome)
 
5. Calculate samplesize for case-control studies
5. Calculate samplesize for case-control studies5. Calculate samplesize for case-control studies
5. Calculate samplesize for case-control studies
 
Volgen of demarreren met sociale media
Volgen of demarreren met sociale mediaVolgen of demarreren met sociale media
Volgen of demarreren met sociale media
 
Angelia Explorer Report
Angelia Explorer ReportAngelia Explorer Report
Angelia Explorer Report
 
Moving from Repairing Homes to Rebuilding Neighborhoods in Haiti
Moving from Repairing Homes to Rebuilding Neighborhoods in HaitiMoving from Repairing Homes to Rebuilding Neighborhoods in Haiti
Moving from Repairing Homes to Rebuilding Neighborhoods in Haiti
 
Concept Maps
Concept MapsConcept Maps
Concept Maps
 
Olenka Explorer Report.
Olenka Explorer Report.Olenka Explorer Report.
Olenka Explorer Report.
 
Sociale media ICT brabant
Sociale media ICT brabantSociale media ICT brabant
Sociale media ICT brabant
 
Buying and selling a business seminar part 1 slides
Buying and selling a business seminar part 1 slidesBuying and selling a business seminar part 1 slides
Buying and selling a business seminar part 1 slides
 
Omar Explorer Report
Omar Explorer ReportOmar Explorer Report
Omar Explorer Report
 
Swaip pitch
Swaip pitchSwaip pitch
Swaip pitch
 
Mappe 2 Pp
Mappe 2 PpMappe 2 Pp
Mappe 2 Pp
 
Add and Subtract Decimals
Add and Subtract DecimalsAdd and Subtract Decimals
Add and Subtract Decimals
 
Tedx sociale media
Tedx sociale mediaTedx sociale media
Tedx sociale media
 
Bloga Sortzen Ibai Uriz
Bloga Sortzen Ibai UrizBloga Sortzen Ibai Uriz
Bloga Sortzen Ibai Uriz
 
Medicaid Presentation De Boer Baumann
Medicaid Presentation De Boer BaumannMedicaid Presentation De Boer Baumann
Medicaid Presentation De Boer Baumann
 
Swaip beta presentatie
Swaip beta presentatieSwaip beta presentatie
Swaip beta presentatie
 
Predatore3
Predatore3Predatore3
Predatore3
 

Kürzlich hochgeladen

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Kürzlich hochgeladen (20)

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 

Sas Samples

  • 1. SAS Samples Assurant Health SAS Users 11/18/2008 Irvin Snider
  • 2. Systematic Sample From Known Number of Observations
  • 3. data work.subset; do pickit=1 to 395 by 15; set sashelp.shoes point=pickit; output; end; stop; run ;
  • 4. $1,468 $181,739 $54,791 4 Madrid Men's Dress Western Europe 16 $9,845 $595,118 $175,694 12 Heidelberg Men's Casual Western Europe 15 $3,039 $226,678 $70,790 15 Seattle Boot United States 14 $10,194 $754,157 $293,313 37 Chicago Women's Dress United States 13 $361 $39,256 $8,365 22 Montevideo Sport Shoe South America 12 $939 $23,822 $11,759 8 Buenos Aires Slipper South America 11 $1,449 $110,179 $31,503 21 Manila Boot Pacific 10 $1,278 $158,688 $42,760 6 Auckland Women's Dress Pacific 9 $43 $1,836 $449 2 Al-Khobar Sport Shoe Middle East 8 $3,983 $520,271 $127,033 11 Moscow Slipper Eastern Europe 7 $1,012 $78,950 $30,157 3 Mexico City Men's Dress Central America/Caribbean 6 $20,470 $671,837 $353,361 25 Vancouver Men's Casual Canada 5 $488 $54,677 $12,601 2 Calgary Women's Dress Canada 4 $844 $66,017 $16,282 25 Nairobi Boot Africa 3 $1,565 $130,025 $39,452 12 Johannesburg Slipper Africa 2 $769 $191,821 $29,761 12 Addis Ababa Boot Africa 1 Returns Inventory Sales Stores Subsidiary Product Region Obs
  • 5. Systematic Sample From Unknown Number of Observations
  • 6. data work.subset; do pickit=1 to totobs by 25; set sashelp.shoes point=pickit nobs=totobs; output; end; stop; run ;
  • 7. Random Sample with Replacement
  • 8. data work.rsubset (drop=i sampsize); sampsize = 10; do i=1 to sampsize; pickit=ceil(ranuni(0)*totobs); set sashelp.shoes point=pickit nobs=totobs; output; end; stop; run ;
  • 9. Random Sample without Replacement
  • 10. data work.rsubset (drop=obsleft sampsize); sampsize=10; obsleft=totobs; do while (sampsize > 0); pickit + 1; if ranuni(0)<sampsize/obsleft then do; set sashelp.shoes point=pickit nobs=totobs; output; sampsize=sampsize- 1 ; end; obsleft=obsleft-1; end; stop; run ;
  • 11. Permuted Blocks Randomization for Equal Allocation to Treatments A and B
  • 12.
  • 13.
  • 14.

Hinweis der Redaktion

  1. SAS Sampling Presenting five sampling examples and five pieces of code: 1. Systematic sample from known number of observations 2. Systematic sample from unknown number of observations 3. Random sample with replacement 4. Random sample without replacement 5. Permuted blocks randomization Why am I presenting this? SAS by default reads observations on a data set sequentially 1. May make life easier to get a sample instead of going against the entire data set. Especially when you are concerned with the accuracy of the data. 2. There may be a need for sampling in your area.