Advertisement
epiphytools

sas_sampling

May 13th, 2015
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. "http://cmq.esalq.usp.br/wiki/lib/exe/fetch.php?media=publico:syllabvs:lcf5759:dados_grupo01_amazonia.xls"
  2.  
  3. FILENAME website url "http://www2.census.gov/acs2005/Tables_Profiles_Subject_Tables/010Nation/United%20States.xls"
  4. debug;
  5. website DBMS=xls REPLACE;
  6. SHEET="Base Tables";
  7. GETNAMES=YES;
  8. RUN;
  9.  
  10. PROC IMPORT OUT= Readin DATAFILE=
  11. ods rtf file='ex3edwards.rtf';
  12. options center nodate nonumber;
  13.  
  14. /*Importação dos dados */
  15.  
  16. PROC IMPORT OUT= WORK.A1
  17. DATAFILE= "T:\dados_grupo01_amazonia.xls"
  18. DBMS=EXCEL REPLACE;
  19. SHEET="DADOS$";
  20. GETNAMES=YES;
  21. MIXED=NO;
  22. SCANTEXT=YES;
  23. USADATE=YES;
  24. SCANTIME=YES;
  25. RUN;
  26.  
  27. PROC PRINT DATA=A1;RUN;
  28.  
  29. /*Testar Normalidade para todas as plantas*/
  30.  
  31. PROC UNIVARIATE DATA=A1 NORMAL;
  32. VAR ALTURA_M DAP_CM;
  33. histogram / normal(color=red fill mu=est sigma=est);
  34. inset n = 'Sample Size'
  35. normal / pos=ne cfill=blank;
  36. RUN;
  37.  
  38. /*Amostragem ao acaso*/
  39.  
  40. PROC SURVEYSELECT DATA=A1 METHOD=SRS N=5 OUT=A5;
  41. PROC PRINT DATA=A5;
  42. RUN;
  43.  
  44. PROC SURVEYSELECT DATA=A1 METHOD=SRS N=10 OUT=A10;
  45. PROC PRINT DATA=A10;
  46. RUN;
  47.  
  48. PROC SURVEYSELECT DATA=A1 METHOD=SRS N=15 OUT=A15;
  49. PROC PRINT DATA=A15;
  50. RUN;
  51.  
  52. title 'Enhancing a Histogram';
  53. PROC UNIVARIATE DATA=A5 NORMAL;
  54. VAR ALTURA_M DAP_CM;
  55. histogram / normal(color=red fill mu=est sigma=est);
  56. inset n = 'Sample Size'
  57. title="Amostragem aleatorio"
  58. title2="Midpoints"
  59. normal / pos=ne cfill=blank;
  60. RUN;
  61.  
  62. PROC UNIVARIATE DATA=A10 NORMAL;
  63. VAR ALTURA_M DAP_CM;
  64. histogram / normal(color=red fill mu=est sigma=est);
  65. inset n = 'Sample Size'
  66. normal / pos=ne cfill=blank; /*normal (ksdpval)*/
  67. RUN;
  68.  
  69. PROC UNIVARIATE DATA=A15 NORMAL;
  70. VAR ALTURA_M DAP_CM;
  71. histogram / normal(color=red fill mu=est sigma=est);
  72. inset n = 'Sample Size'
  73. normal / pos=ne cfill=blank;
  74. RUN;
  75.  
  76. /*Amostragem sistemática*/
  77.  
  78. PROC SURVEYSELECT DATA=A1 METHOD=SYS N=5 OUT=S5;
  79. PROC PRINT DATA=S5;
  80. RUN;
  81.  
  82. PROC SURVEYSELECT DATA=A1 METHOD=SYS N=10 OUT=S10;
  83. PROC PRINT DATA=S10;
  84. RUN;
  85.  
  86. PROC SURVEYSELECT DATA=A1 METHOD=SYS N=15 OUT=S15;
  87. PROC PRINT DATA=S15;
  88. RUN;
  89.  
  90. PROC UNIVARIATE DATA=S5 NORMAL;
  91. VAR ALTURA_M DAP_CM;
  92. histogram / normal(color=red fill mu=est sigma=est);
  93. inset n = 'Sample Size'
  94. normal / pos=ne cfill=blank;
  95. RUN;
  96.  
  97. PROC UNIVARIATE DATA=S10 NORMAL;
  98. VAR ALTURA_M DAP_CM;
  99. histogram / normal(color=red fill mu=est sigma=est);
  100. inset n = 'Sample Size'
  101. normal / pos=ne cfill=blank;
  102. RUN;
  103.  
  104. PROC UNIVARIATE DATA=S15 NORMAL;
  105. VAR ALTURA_M DAP_CM;
  106. histogram / normal(color=red fill mu=est sigma=est);
  107. inset n = 'Sample Size'
  108. normal / pos=ne cfill=blank;
  109. RUN;
  110.  
  111. ODS rtf CLOSE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement