Presentation is loading. Please wait.

Presentation is loading. Please wait.

Be humble in our attribute, be loving and varying in our attitude, that is the way to live in heaven.

Similar presentations


Presentation on theme: "Be humble in our attribute, be loving and varying in our attitude, that is the way to live in heaven."— Presentation transcript:

1 Be humble in our attribute, be loving and varying in our attitude, that is the way to live in heaven.

2 Statistical Package Usage Topic: One Way ANOVA By Dr. Kelly Fan, Cal State Univ, East Bay

3 Statistical Tools vs. Variable Types Response (output) Predictor (input) NumericalCategorical/Mixed Numerical Simple and Multiple Regression Analysis of Variance (ANOVA) Analysis of Covariance (ANCOVA) CategoricalCategorical data analysis

4 Example: Broker Study A financial firm would like to determine if brokers they use to execute trades differ with respect to their ability to provide a stock purchase for the firm at a low buying price per share. To measure cost, an index, Y, is used. Y=1000(A-P)/A where P=per share price paid for the stock; A=average of high price and low price per share, for the day. “The higher Y is the better the trade is.”

5 } 1 12 3 5 12 5 6 2 7 17 13 11 7 17 12 3 8 1 7 4 3 7 5 24 13 14 18 14 19 17 R=6 CoL: broker 4 21 10 15 12 20 6 14 Five brokers were in the study and six trades were randomly assigned to each broker.

6 Statistical Model “LEVEL” OF BROKER (Broker is, of course, represented as “categorical”) Y 11 Y 12 Y 1c Y ij Y 21 Y nI 1 2 n 1 2 C Y ij =  j +  ij i = 1,....., n j = 1,....., C Y nc

7 One-Way Anova F-Test: H O : Level of X has no impact on Y H I : Level of X does have impact on Y H O :  1 =  2 =  8 H I : not all  j are EQUAL

8 ONE WAY ANOVA Estimate of the common standard deviation  The GLM Procedure Dependent Variable: TRADE Sum of Source DF Squares Mean Square F Value Pr > F Model 4 640.800000 160.200000 7.56 0.0004 Error 25 530.000000 21.200000 Corrected Total 29 1170.800000 R-Square Coeff Var Root MSE TRADE Mean 0.547318 42.63283 4.604346 10.80000

9 Diagnosis: Normality Don’t do the normality checking for all groups but only for the residuals The points on the normality plot must more or less follow a line to claim “normal distributed”. There are statistic tests to verify it scientifically. The ANOVA method we learn here is not sensitive to the normality assumption. That is, a mild departure from the normal distribution will not change our conclusions much. Normality plot: normal scores vs. residuals

10 From the Broker data:

11 Diagnosis: Equal Variances The points on the residual plot must be more or less within a horizontal band to claim “constant variances”. There are statistic tests to verify it scientifically. The ANOVA method we learn here is not sensitive to the constant variances assumption. That is, slightly different variances within groups will not change our conclusions much. Residual plot: predicted values vs. residuals

12 From the Broker data:

13 Multiple Comparison Procedures Once we reject H 0 :   =   =...  c in favor of H 1 : NOT all  ’s are equal, we don’t yet know the way in which they’re not all equal, but simply that they’re not all the same. If there are 4 columns, are all 4  ’s different? Are 3 the same and one different? If so, which one? etc.

14 Pairwise Comparison Goal: grouping levels Method: Compare each pair of levels SNK procedure is a popular procedure and introduced here

15 SAS Output for SNK Procedure

16 Conclusion : 5 4 21 3

17 Brokers 1 and 3 are not significantly different each other but they are significantly different to the other 3 brokers. Broker 2 and 4 are not significantly different, and broker 4 and 5 are not significantly different, but broker 2 is different to (smaller than) broker 5 significantly. Conclusion : 5 4 21 3

18 Comparisons to Control Dunnett Procedure Designed specifically for comparing several “treatments” to a “control.” Example: 1 2 3 4 5 6 12 5 14 17 Col } R=6 CONTROL

19 - Cols 4 and 5 differ from the control [ 1 ]. - Cols 2 and 3 are not significantly different from control. In our example: 1 2 3 4 5 6 12 5 14 17 CONTROL

20 Contrast Question 1: Broker 1 vs. the others Question 2: Brokers 1, 2 are more experienced than the others. Experienced vs. less experienced brokers

21 SAS Output for Question 1

22 KRUSKAL - WALLIS TEST (Non - Parametric Alternative) H O : The probability distributions are identical for each level of the factor H I : Not all the distributions are the same

23 Example: Life Insurance Amount State 1: CA2: KA3: CO 9080165 200140160 225150140 100140160 170150175 300 155 250280180

24

25 KRUSKAL - WALLIS TEST

26 SAS Code DATA INSURANCE; INPUT STATE $ AMOUNT@@; DATALINES; CA 90 CA 200 CA 225 CA 100 CA 170 CA 300 CA 250 KA 80 KA 140 KA 150 KA 140 KA 150 KA 300 KA 280 CO 165 CO 160 CO 140 CO 160 CO 175 CO 155 CO 180 ; ** NON-PARAMETRIC TEST; PROC NPAR1WAY DATA=INSURANCE WILCOXON; TITLE "NONPARAMETRIC TEST TO COMPARE STATES"; CLASS STATE; VAR AMOUNT; RUN;


Download ppt "Be humble in our attribute, be loving and varying in our attitude, that is the way to live in heaven."

Similar presentations


Ads by Google