110 likes | 269 Views
Chapter 8: Using Basic Statistical Procedures. “33⅓% of the mice used in the experiment were cured by the test drug; 33⅓% of the test population were unaffected by the drug and remained in a moribund condition; the third mouse got away.” -- Erwin Neter.
E N D
Chapter 8: Using Basic Statistical Procedures “33⅓% of the mice used in the experiment were cured by the test drug; 33⅓% of the test population were unaffected by the drug and remained in a moribund condition; the third mouse got away.” -- Erwin Neter
8.1 Examining the Distribution of Data with PROC UNIVARIATE • After the PROC statement, specify one or more numeric variables in a VAR statement: • PROC UNIVARIATE; • VAR variable-list; • Specify other options in the PROC statement: • PROC UNIVARIATE PLOT NORMAL; • Use BY statement to obtain separate analyses BY groups. Remember to use PROC SORT first if your data are not already sorted by your BY variable.
8.2 Producing Statistics with PROC MEANS • The MEANS procedure requires only one statement: • PROC MEANS statistic-keywords; • Confidence Limits: • PROC MEANS ALPHA=.10 CLM; • Restrict analysis to selected variables with the VAR statement: • PROC MEANS options; • VAR variable-list;
8.3 Testing Categorical Data with PROC FREQ • PROC FREQ produces many statistics for categorical data: • PROC FREQ; • TABLES variable-combinations / options; • The best-known statistic is chi-square: • PROC FREQ DATA = bus; • TABLES BusType * OnTimeOrLate / CHISQ;
8.2 Producing Statistics with PROC MEANS • The MEANS procedure requires only one statement: • PROC MEANS statistic-keywords; • Confidence Limits: • PROC MEANS ALPHA=.10 CLM; • Restrict analysis to selected variables with the VAR statement: • PROC MEANS options; • VAR variable-list;
8.4 Examining Correlations with PROC CORR • Example: • PROC CORR; • VAR variable-list; • WITH variable-list; • VAR variables appear across the top of the correlation table; WITH variables appear down the side of the table. • Pearson product moment correlation is done by default, but you can obtain other types, e.g: • PROC CORR SPEARMAN;
8.5 Using PROC REG for Simple Regression Analysis • Two required statements: • PROC REG; • MODEL dependent = independent; • To produce a simple scatter plot, use the following PLOT statement (if you have SAS/GRAPH software): • PLOT dependent * independent; • Use LINEPRINTER option if you don't have SAS/GRAPH software. Making a simple scatter plot along with predicted values: • PROC REG LINEPRINTER; • MODEL dependent = independent; • PLOT dependent * independent = 'symbol' • P. * independent = 'symbol'/ OVERLAY;
8.6 Reading the Output of PROC REG • The first section is the ANOVA section. Gives information about how well the model fits the data. • Parameter estimates follow the ANOVA section. • Our copy of SAS comes with SAS/GRAPH, so a nice plot is made.
8.7 Using PROC ANOVA for One-Way Analysis of Variance • PROC ANOVA is specifically for balanced data. If data is unbalanced, use PROC GLM instead. Three required statements: • PROC ANOVA; • CLASS variable-list; • MODEL dependent = effects; • CLASS must come before MODEL and defines classification variables. For 1-way ANOVA, only 1 variable is listed. • MODEL defines dependent variable and the effects. For 1-way ANOVA, the effect is the classification variable. • One of the most useful options is the MEANS option: • MEANS effects / options;
8.8 Reading the Output of PROC ANOVA • First page of output gives information about the classification variable. • Second part is the ANOVA table. • The SCHEFFE option in the MEANS statement compares heights between teams. Letters are used to group teams, and means with the same letters are not significantly different from each other (at the 0.05 level).
8.9 Graphical Interfaces for Statistical Analysis • SAS Enterprise Guide provides a graphical user interface (GUI) that allows transparent access to the power of SAS. When you request statistics, SAS Enterprise Guide opens a window which steps you through setting up the analysis. • Analyst is a GUI that provides easy access to basic statistical analyses. Intended for students and novice SAS users as well as SAS experts who would still like to use a GUI. The code that Analyst generates can be copied into the Program Editor and saved as a SAS program. • SAS/LAB provides guided data analysis for the day-to-day analytical and data presentation needs of engineers and scientists. SAS/INSIGHT is a dynamic tool for exploring and analyzing data.