EXST7005 Fall2010 21b Appendix 07

EXST7005 Fall2010 21b Appendix 07 - Statistical Methods I...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Statistical Methods I (EXST 7005) Appendix 7 Page 216 1 TITLE1 'Example of Randomized Complete Block Design (RBD)'; 2 dm'log;clear;output;clear'; 3 4 ODS HTML style=minimal body='C:\EXST 7005\SAS\Example07.html' ; NOTE: Writing HTML Body file: C:\EXST 7005\SAS\Example07.html 5 ODS RTF style=minimal body='C:\EXST 7005\SAS\Example07.rtf'; NOTE: Writing RTF Body file: C:\EXST 7005\SAS\Example07.rtf 6 ODS PDF style=minimal body='C:\EXST 7005\SAS\Example07.PDF'=; NOTE: Writing ODS PDF output to DISK destination "C:\EXST 7005\SAS\Example07.PDF", printer "PDF". 7 8 9 10 11 12 13 14 *******************************************************************; *** Neter, Kutner, Nachtsheim, Wasserman (1996) [Ch24pr17.sas] ***; *** Artificial pearl quality depends on the number of coats ***; *** of lacquer applied. The experiment evaluates the market ***; *** value of the pearls and The number of coats applied. The ***; *** experiment was reproduced on 4 different batches of pearls ***; *******************************************************************; 15 options ps=256 ls=99 nocenter nodate nonumber nolabel; 16 17 data pearls; infile cards missover; 18 TITLE2 'Artificial pearl market value with coats of lacquer'; 19 LABEL value = 'Market value of the pearl'; 20 LABEL coats = 'coats of lacquer'; 21 LABEL batch = 'Batch of pearls produced'; 22 LABEL rep = 'A pearl within a batch'; 23 input value c batch rep; 24 coats = (c-2)*2+8; 25 cards; NOTE: The data set WORK.PEARLS has 48 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 25 ! run; 74 ; 75 PROC PRINT DATA=pearls; TITLE3 'LISTING OF DATA'; RUN; NOTE: There were 48 observations read from the data set WORK.PEARLS. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used (Total process time): real time 0.12 seconds cpu time 0.03 seconds Example of Randomized Complete Block Design (RBD) Artificial pearl market value with coats of lacquer LISTING OF DATA Obs 1 2 3 4 5 6 7 8 9 10 11 12 value 72.0 74.6 67.4 72.8 72.1 76.9 74.8 73.3 75.2 73.8 75.7 77.8 13 14 15 16 70.4 68.1 72.4 72.4 coats 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 batch 1 1 1 1 2 2 2 2 3 3 3 3 rep 1 2 3 4 1 2 3 4 1 2 3 4 c 1 1 1 1 1 1 1 1 1 1 1 1 4 4 4 4 1 2 3 4 1 1 1 1 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 76.9 78.1 72.9 74.2 80.3 79.3 76.6 77.2 80.2 76.6 77.3 79.9 74.3 77.6 74.4 72.9 76.3 74.1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 10 10 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 1 1 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) 35 36 37 38 39 40 41 76 77 78 79 80 81 82 83 84 85 86 87 NOTE: NOTE: NOTE: NOTE: NOTE: NOTE: 77.1 75.0 80.9 73.7 78.6 80.2 79.2 10 10 10 10 10 10 10 1 1 2 2 2 2 3 Appendix 7 3 4 1 2 3 4 1 Page 217 42 43 44 45 46 47 48 3 3 3 3 3 3 3 78.0 77.6 81.2 71.6 77.7 75.2 74.4 10 10 10 10 10 10 10 3 3 3 4 4 4 4 2 3 4 1 2 3 4 3 3 3 3 3 3 3 PROC MIXED DATA=PEARLS ORDER=DATA; CLASSES BATCH COATS; TITLE3 'Randomized block design with PROC MIXED'; MODEL VALUE = COATS; RANDOM BATCH BATCH*COATS; lsmeans coats / adjust=tukey pdiff; ** treatments in order=data ====> 6 8 10; contrast 'linear trend' coats -1 0 1; contrast 'curved trend' coats -1 2 -1; ods output diffs=ppp lsmeans=mmm; *ods listing exclude diffs lsmeans; *this line is inactive; RUN; Convergence criteria met. Estimated G matrix is not positive definite. The data set WORK.MMM has 3 observations and 7 variables. The data set WORK.PPP has 3 observations and 10 variables. The PROCEDURE MIXED printed page 2. PROCEDURE MIXED used (Total process time): real time 0.12 seconds cpu time 0.04 seconds Example of Randomized Complete Block Design (RBD) Artificial pearl market value with coats of lacquer Randomized block design with PROC MIXED The Mixed Procedure Model Information Data Set Dependent Variable Covariance Structure Estimation Method Residual Variance Method Fixed Effects SE Method Degrees of Freedom Method WORK.PEARLS value Variance Components REML Profile Model-Based Containment Class Level Information Class Levels Values batch 4 1 2 3 4 coats 3 6 8 10 Dimensions Covariance Parameters Columns in X Columns in Z Subjects Max Obs Per Subject Number Number Number Number of of of of Observations Observations Read Observations Used Observations Not Used 3 4 16 1 48 48 48 0 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Iteration History Iteration Evaluations 0 1 2 Appendix 7 Page 218 -2 Res Log Like 1 2 1 Convergence Criterion 225.45311480 207.86808217 207.86803230 criteria met. 0.00000079 0.00000000 Covariance Parameter Estimates Cov Parm Estimate batch 3.8974 batch*coats 0 Residual 4.1780 Fit Statistics -2 Res Log Likelihood AIC (smaller is better) AICC (smaller is better) BIC (smaller is better) 207.9 211.9 212.2 210.6 Type 3 Tests of Fixed Effects Num Den Effect DF DF F Value coats 2 6 18.00 Pr > F 0.0029 Contrasts Label linear trend curved trend Num DF 1 1 Den DF 6 6 F Value 27.92 8.07 Pr > F 0.0019 0.0295 Standard Error 1.1115 1.1115 1.1115 DF 6 6 6 Least Squares Means Effect coats coats coats coats 6 8 10 Estimate 73.1062 76.7937 76.9250 t Value 65.77 69.09 69.21 Pr > |t| <.0001 <.0001 <.0001 Differences ofLeast Squares Means Effect coats coats coats coats 6 6 8 _coats 8 10 10 Estimate -3.6875 -3.8187 -0.1312 Standard Error 0.7227 0.7227 0.7227 DF 6 6 6 t Value -5.10 -5.28 -0.18 Pr > |t| 0.0022 0.0019 0.8619 Adjustment Tukey-Kramer Tukey-Kramer Tukey-Kramer Adj P 0.0053 0.0045 0.9820 Example of Randomized Complete Block Design (RBD) Artificial pearl market value with coats of lacquer Randomized block design with PROC MIXED Post hoc adjustment with macro by Arnold Saxton Effect=coats ADJUSTMENT=Tukey-Kramer(P<0.05) BYGROUP=1 Obs coats Estimate StdErr MSGROUP 1 10 76.9250 1.1115 A 2 8 76.7937 1.1115 A 3 6 73.1062 1.1115 B James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 7 Page 219 89 TITLE4 'Post hoc adjustment with macro by Arnold Saxton'; 90 * SAS Macro by Arnold Saxton: Saxton, A.M. 1998. A macro for ; 91 * converting mean separation output to letter groupings in Proc Mixed. ; 92 * In Proc. 23rd SAS Users Group Intl., SAS Institute, Cary, NC, pp1243-1246.; 93 %include 'C:\Geaghan\EXST\EXST7005New\Fall2003\SaS\pdmix800.sas'; 721 %pdmix800(ppp,mmm,alpha=0.05,sort=yes); PDMIX800 03.26.2002 processing 4.3390183727 Tukey-Kramer values for coats are 2.21727 (avg) 2.21727 (min) 2.21727 (max). 722 723 724 725 726 727 728 729 730 731 732 NOTE: 733 734 735 736 NOTE: 737 738 739 NOTE: NOTE: run; PROC GLM DATA=PEARLS ORDER=DATA; CLASSES BATCH COATS; TITLE3 'Randomized block design with PROC GLM'; MODEL VALUE = BATCH COATS BATCH*COATS; RANDOM BATCH BATCH*COATS / TEST; TEST H=BATCH COATS E=BATCH*COATS; lsmeans coats / adjust=tukey pdiff stderr; contrast 'linear trend' coats -1 0 1; contrast 'curved trend' coats -1 2 -1; RUN; TYPE I EMS not available without the E1 option. ods html close; ods rtf close; ods PDF close; ODS PDF printed 11 pages to C:\EXST 7005\SAS\Example07.PDF. run; quit; The PROCEDURE GLM printed pages 4-9. PROCEDURE GLM used (Total process time): real time 0.53 seconds cpu time 0.09 seconds Example of Randomized Complete Block Design (RBD) Artificial pearl market value with coats of lacquer Randomized block design with PROC GLM The GLM Procedure Class Level Information Class Levels Values batch 4 1 2 3 4 coats 3 6 8 10 Number of Observations Read Number of Observations Used 48 48 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 7 Page 220 Example of Randomized Complete Block Design (RBD) Artificial pearl market value with coats of lacquer Randomized block design with PROC GLM The GLM Procedure Dependent Variable: value Sum of Squares 305.0916667 173.6250000 478.7166667 Source Model Error Corrected Total DF 11 36 47 R-Square 0.637312 Root MSE 2.196114 Coeff Var 2.904593 Mean Square 27.7356061 4.8229167 F Value 5.75 Pr > F <.0001 value Mean 75.60833 Source batch coats batch*coats DF 3 2 6 Type I SS 152.8516667 150.3879167 1.8520833 Mean Square 50.9505556 75.1939583 0.3086806 F Value 10.56 15.59 0.06 Pr > F <.0001 <.0001 0.9988 Source batch coats batch*coats DF 3 2 6 Type III SS 152.8516667 150.3879167 1.8520833 Mean Square 50.9505556 75.1939583 0.3086806 F Value 10.56 15.59 0.06 Pr > F <.0001 <.0001 0.9988 Example of Randomized Complete Block Design (RBD) Artificial pearl market value with coats of lacquer Randomized block design with PROC GLM The GLM Procedure Source batch coats batch*coats Type III Expected Mean Square Var(Error) + 4 Var(batch*coats) + 12 Var(batch) Var(Error) + 4 Var(batch*coats) + Q(coats) Var(Error) + 4 Var(batch*coats) Example of Randomized Complete Block Design (RBD) Artificial pearl market value with coats of lacquer Randomized block design with PROC GLM The GLM Procedure Tests of Hypotheses for Mixed Model Analysis of Variance Dependent Variable: value Source batch coats Error Error: MS(batch*coats) DF 3 2 6 Type III SS 152.851667 150.387917 1.852083 Mean Square 50.950556 75.193958 0.308681 F Value 165.06 243.60 Pr > F <.0001 <.0001 Source batch*coats Error: MS(Error) DF 6 36 Type III SS 1.852083 173.625000 Mean Square 0.308681 4.822917 F Value 0.06 Pr > F 0.9988 James P. Geaghan Copyright 2010 Statistical Methods I (EXST 7005) Appendix 7 Page 221 Example of Randomized Complete Block Design (RBD) Artificial pearl market value with coats of lacquer Randomized block design with PROC GLM Least Squares Means Adjustment for Multiple Comparisons: Tukey value LSMEAN Standard Error Pr > |t| LSMEAN Number 73.1062500 76.7937500 76.9250000 coats 0.5490285 0.5490285 0.5490285 <.0001 <.0001 <.0001 1 2 3 6 8 10 Least Squares Means for effect coats Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: value i/j 1 1 2 3 3 <.0001 <.0001 <.0001 2 <.0001 0.9844 0.9844 Dependent Variable: value Contrast linear trend curved trend DF 1 1 Contrast SS 116.6628125 33.7251042 Mean Square 116.6628125 33.7251042 F Value 24.19 6.99 Pr > F <.0001 0.0120 Tests of Hypotheses Using the Type III MS for batch*coats as an Error Term Source batch coats DF 3 2 Type III SS 152.8516667 150.3879167 Mean Square 50.9505556 75.1939583 F Value 165.06 243.60 Pr > F <.0001 <.0001 James P. Geaghan Copyright 2010 ...
View Full Document

Ask a homework question - tutors are online