Advertisement
epiphytools

SAS ULTIMO

Jun 15th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. PROC IMPORT OUT= A
  2. DATAFILE= "C:\ex15-6\rest.xlsx"
  3. DBMS=EXCEL REPLACE;
  4. RANGE="Plan1$";
  5. GETNAMES=YES;
  6. MIXED=NO;
  7. SCANTEXT=YES;
  8. USEDATE=YES;
  9. SCANTIME=YES;
  10. RUN;
  11. PROC PRINT DATA=A; RUN;
  12.  
  13. DATA A0;
  14. SET A;
  15. DROP aval1 rest1 nota1 aval2 rest2 nota2 ; OUTPUT;
  16. RUN;
  17. PROC PRINT DATA=A0; RUN;
  18.  
  19.  
  20. DATA A1;
  21. SET A;
  22. DROP aval rest nota aval2 rest2 nota2 ; OUTPUT;
  23. RENAME aval1 = aval rest1 = rest nota1 = nota;
  24. RUN;
  25. PROC PRINT DATA=A1; RUN;
  26.  
  27.  
  28. DATA A2;
  29. SET A;
  30. DROP aval rest nota aval1 rest1 nota1 ; OUTPUT;
  31. RENAME aval2 = aval;
  32. RENAME rest2 = rest;
  33. RENAME nota2 = nota;
  34. RUN;
  35. PROC PRINT DATA=A2; RUN;
  36.  
  37. Data B;
  38. set A0 A1 A2;
  39. run;
  40. PROC PRINT DATA=B; RUN;
  41.  
  42. TITLE3'*** Teste de normalidade de Shapiro-Wilk ***';
  43. PROC UNIVARIATE DATA= B NORMAL;
  44. VAR nota;
  45. RUN;
  46. /*Nao dio normalidad Pr < W 0.0002 */
  47.  
  48.  
  49. PROC TRANSREG DATA=B PLOTS=NONE;
  50. MODEL BOXCOX(nota)=CLASS(rest);
  51. RUN;
  52. /*Box cox sugere transformar nota**2 */
  53.  
  54. /*Criar a variavel transformada*/
  55. DATA B;
  56. SET B;
  57. T_NOTA= NOTA**2;
  58. RUN;
  59. PROC PRINT DATA=B; RUN;
  60.  
  61. /*Testar novamente homocedasticidade */
  62. PROC TRANSREG DATA=B PLOTS=NONE;
  63. MODEL BOXCOX(T_nota)=CLASS(rest);
  64. RUN;
  65. /*Nao melhoro a falta de heterocedasticidade */
  66.  
  67. /*Testar novamente normalidade*/
  68. PROC UNIVARIATE DATA = B NORMAL;
  69. VAR T_nota;
  70. RUN;
  71. /*Nao melhoro a falta de normalidade Pr < W 0.0013 */
  72.  
  73. PROC SORT DATA = B;
  74. BY aval;
  75.  
  76. PROC RANK DATA = B OUT=B1;
  77. BY AVAL;
  78. VAR NOTA;
  79. RANKS RNOTA;
  80. PROC PRINT DATA=B; RUN;
  81.  
  82. PROC GLM DATA=B1;
  83. CLASS AVAL REST;
  84. MODEL RNOTA = AVAL REST;
  85. MEANS REST/ DUNCAN LINES ALPHA=0.1;
  86. RUN;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement