Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROC IMPORT OUT= A
- DATAFILE= "C:\ex15-6\rest.xlsx"
- DBMS=EXCEL REPLACE;
- RANGE="Plan1$";
- GETNAMES=YES;
- MIXED=NO;
- SCANTEXT=YES;
- USEDATE=YES;
- SCANTIME=YES;
- RUN;
- PROC PRINT DATA=A; RUN;
- DATA A0;
- SET A;
- DROP aval1 rest1 nota1 aval2 rest2 nota2 ; OUTPUT;
- RUN;
- PROC PRINT DATA=A0; RUN;
- DATA A1;
- SET A;
- DROP aval rest nota aval2 rest2 nota2 ; OUTPUT;
- RENAME aval1 = aval rest1 = rest nota1 = nota;
- RUN;
- PROC PRINT DATA=A1; RUN;
- DATA A2;
- SET A;
- DROP aval rest nota aval1 rest1 nota1 ; OUTPUT;
- RENAME aval2 = aval;
- RENAME rest2 = rest;
- RENAME nota2 = nota;
- RUN;
- PROC PRINT DATA=A2; RUN;
- Data B;
- set A0 A1 A2;
- run;
- PROC PRINT DATA=B; RUN;
- TITLE3'*** Teste de normalidade de Shapiro-Wilk ***';
- PROC UNIVARIATE DATA= B NORMAL;
- VAR nota;
- RUN;
- /*Nao dio normalidad Pr < W 0.0002 */
- PROC TRANSREG DATA=B PLOTS=NONE;
- MODEL BOXCOX(nota)=CLASS(rest);
- RUN;
- /*Box cox sugere transformar nota**2 */
- /*Criar a variavel transformada*/
- DATA B;
- SET B;
- T_NOTA= NOTA**2;
- RUN;
- PROC PRINT DATA=B; RUN;
- /*Testar novamente homocedasticidade */
- PROC TRANSREG DATA=B PLOTS=NONE;
- MODEL BOXCOX(T_nota)=CLASS(rest);
- RUN;
- /*Nao melhoro a falta de heterocedasticidade */
- /*Testar novamente normalidade*/
- PROC UNIVARIATE DATA = B NORMAL;
- VAR T_nota;
- RUN;
- /*Nao melhoro a falta de normalidade Pr < W 0.0013 */
- PROC SORT DATA = B;
- BY aval;
- PROC RANK DATA = B OUT=B1;
- BY AVAL;
- VAR NOTA;
- RANKS RNOTA;
- PROC PRINT DATA=B; RUN;
- PROC GLM DATA=B1;
- CLASS AVAL REST;
- MODEL RNOTA = AVAL REST;
- MEANS REST/ DUNCAN LINES ALPHA=0.1;
- RUN;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement