1 / 18

Lab 3 Tuesday, January 28, 2004

Lab 3 Tuesday, January 28, 2004. Proc GLM. Proc GLM. GLM= General Linear Model Can be used for models that contain categorical independent variables (ANOVA, t-test) Can be used for models that contain continuous IVs (Regression)

Download Presentation

Lab 3 Tuesday, January 28, 2004

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 3Tuesday, January 28, 2004 Proc GLM

  2. Proc GLM • GLM= General Linear Model • Can be used for models that contain categorical independent variables (ANOVA, t-test) • Can be used for models that contain continuous IVs (Regression) • Can be used for models that contain both continuous and categorical variables (ANCOVA).

  3. On-line SAS Guide • http://www.firstobs.com/NetResources/Proc/proc_boxplot.htm

  4. Proc GLM Format PROC GLMDATA = dataset name; CLASSname(s) of categorical variabe(s); MODELdependent var(s) = independent var(s); MEANSname(s) of categorical variable(s)/[Post Hoc Test Hovtest];

  5. Proc GLM Options • CLASS tells SAS which variables are categorical • MODEL tells SAS what your IV(s) and DV(s) are. DV=IV • MEANS tells SAS to compute means and SDs for each level of the specified categorical variable. • Can specify post-hoc tests such as Tukey (tukey) and Scheffe (scheffe) • Can test for Homogeneity of Variance (hovtest)

  6. Condition A 128 115 120 110 103 Condition B 123 115 130 135 113 Example (One-Way ANOVA) Is condition A significantly different from B?

  7. Data H3; input iv dv; cards; 1 128 1 115 1 120 1 110 1 103 2 123 2 115 2 130 2 135 2 113 ; procunivariate normal plot; by iv; procglm; class iv; model dv = iv; means iv/ hovtest; run; Program Editor

  8. Univariate Output for IV-1 Basic Statistical Measures Location Variability Mean 115.2000 Std Deviation 9.52365 Median 115.0000 Variance 90.70000 Mode . Range 25.00000 Interquartile Range 10.00000

  9. Univariate Output for IV-1 (cont.) Tests for Normality Test --Statistic--- --p Value--- Shapiro-Wilk W 0.998 Pr < W 0.9989 Kolmogorov-Smirnov D 0.110 Pr > D >0.1500 Cramer-von Mises W-Sq 0.017 Pr > W-Sq >0.2500 Anderson-Darling A-Sq 0.132 Pr > A-Sq >0.2500

  10. Univariate Output for IV-1 (cont.) Stem Leaf # Boxplot 12 8 1 | 12 0 1 +-----+ 11 5 1 *--+--* 11 0 1 +-----+ 10 | 10 3 1 | ----+----+----+----+ Multiply Stem.Leaf by 10**+1

  11. Univariate Output for IV-2 Basic Statistical Measures Location Variability Mean 123.2000 Std Deviation 9.44458 Median 123.0000 Variance 89.20000 Mode . Range 22.00000 Interquartile Range 15.00000

  12. Univariate Output for IV-2 Tests for Normality Test --Statistic--- -----p Value------ Shapiro-Wilk W 0.9327 Pr < W 0.6149 Kolmogorov-Smirnov D 0.207364 Pr > D >0.1500 Cramer-von Mises W-Sq 0.03403 Pr > W-Sq >0.2500 Anderson-Darling A-Sq 0.232984 Pr > A-Sq >0.2500

  13. Univariate Output for IV-2 • Stem Leaf # Boxplot • 13 5 1 | • 13 0 1 +-----+ • 12 | | • 12 3 1 *--+--* • 11 5 1 +-----+ • 11 3 1 | • ----+----+----+----+ • Multiply Stem.Leaf by 10**+1

  14. Univariate Output “by” function 140 + | | | | | 130 + +-----+ | | | | | | | | | | *--+--* 120 + +-----+ | | | | | | | | *--+--* +-----+ | | | | 110 + +-----+ | | | | | | 100 + ------------+-----------+----------- iv 1 2

  15. GLM output The GLM Procedure Class Level Information Class Levels Values iv 2 1 2 Number of observations 10

  16. GLM output (cont.) The GLM Procedure Dependent Variable: dv Sum of Source DF Squares Mean Square F Value Pr > F Model 1 160.000 160.0000 1.78 0.2190 Error 8 719.600 89.95000 Corrected Total 9 879.6000000 R-Square Coeff Var Root MSE dv Mean 0.181901 7.956541 9.484197 119.2000

  17. GLM output Test for Homogeneity The GLM Procedure Levene's Test for Homogeneity of dv Variance ANOVA of Squared Deviations from Group Means Sum of Mean Source DF Squares Square F Value Pr > F iv 1 3.6000 3.6000 0.00 0.9779 Error 8 35344.3 4418.0

  18. GLM Output (cont.) The GLM Procedure Level of --------------dv------------- iv N Mean Std Dev 1 5 115.200000 9.52365476 2 5 123.200000 9.44457516

More Related