I OWA S TATE U NIVERSITY Department of Animal Science Using Basic Graphical and Statistical Procedures (Chapter in the 8 Little SAS Book) Animal Science.

Slides:



Advertisements
Similar presentations
Statistical Techniques I EXST7005 Start here Measures of Dispersion.
Advertisements

Class Session #2 Numerically Summarizing Data
Introduction to Summary Statistics
Descriptive Statistics
Measures of Dispersion
BHS Methods in Behavioral Sciences I April 18, 2003 Chapter 4 (Ray) – Descriptive Statistics.
Chap 3-1 EF 507 QUANTITATIVE METHODS FOR ECONOMICS AND FINANCE FALL 2008 Chapter 3 Describing Data: Numerical.
DESCRIBING DATA: 2. Numerical summaries of data using measures of central tendency and dispersion.
B a c kn e x t h o m e Parameters and Statistics statistic A statistic is a descriptive measure computed from a sample of data. parameter A parameter is.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 2-1 Statistics for Business and Economics 7 th Edition Chapter 2 Describing Data:
Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc. Chap 3-1 Business Statistics: A Decision-Making Approach 7 th Edition Chapter.
Slides by JOHN LOUCKS St. Edward’s University.
B a c kn e x t h o m e Classification of Variables Discrete Numerical Variable A variable that produces a response that comes from a counting process.
CHAPTER 3: Statistical Description of Data
Business Statistics: A Decision-Making Approach, 6e © 2005 Prentice-Hall, Inc. Chap 3-1 Introduction to Statistics Chapter 3 Using Statistics to summarize.
Measures of Dispersion
Statistics 800: Quantitative Business Analysis for Decision Making Measures of Locations and Variability.
Chap 3-1 Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc. Chapter 3 Describing Data: Numerical Statistics for Business and Economics.
Descriptive Statistics  Summarizing, Simplifying  Useful for comprehending data, and thus making meaningful interpretations, particularly in medium to.
Measures of Central Tendency
Lecture 4 Dustin Lueker.  The population distribution for a continuous variable is usually represented by a smooth curve ◦ Like a histogram that gets.
Describing Data: Numerical
@ 2012 Wadsworth, Cengage Learning Chapter 5 Description of Behavior Through Numerical 2012 Wadsworth, Cengage Learning.
Descriptive Statistics Used to describe the basic features of the data in any quantitative study. Both graphical displays and descriptive summary statistics.
1 1 Slide © 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
Numerical Descriptive Techniques
Chapter 3 – Descriptive Statistics
6.1 What is Statistics? Definition: Statistics – science of collecting, analyzing, and interpreting data in such a way that the conclusions can be objectively.
Methods for Describing Sets of Data
© Copyright McGraw-Hill CHAPTER 3 Data Description.
HLTH 653 Lecture 2 Raul Cruz-Cano Spring Statistical analysis procedures Proc univariate Proc t test Proc corr Proc reg.
Measures of Central Tendency and Dispersion Preferred measures of central location & dispersion DispersionCentral locationType of Distribution SDMeanNormal.
1 1 Slide Descriptive Statistics: Numerical Measures Location and Variability Chapter 3 BA 201.
Descriptive Statistics: Numerical Methods
M07-Numerical Summaries 1 1  Department of ISM, University of Alabama, Lesson Objectives  Learn when each measure of a “typical value” is appropriate.
STAT 280: Elementary Applied Statistics Describing Data Using Numerical Measures.
Business Statistics: A Decision-Making Approach, 6e © 2005 Prentice-Hall, Inc. Chap 3-1 Business Statistics: A Decision-Making Approach 6 th Edition Chapter.
Table of Contents 1. Standard Deviation
1 PUAF 610 TA Session 2. 2 Today Class Review- summary statistics STATA Introduction Reminder: HW this week.
Chapter 2 Describing Data.
1 1 Slide © 2007 Thomson South-Western. All Rights Reserved.
Lecture 3 Describing Data Using Numerical Measures.
Skewness & Kurtosis: Reference
Lecture 5 Dustin Lueker. 2 Mode - Most frequent value. Notation: Subscripted variables n = # of units in the sample N = # of units in the population x.
INVESTIGATION 1.
Chap 3-1 A Course In Business Statistics, 4th © 2006 Prentice-Hall, Inc. A Course In Business Statistics 4 th Edition Chapter 3 Describing Data Using Numerical.
Basic Measurement and Statistics in Testing. Outline Central Tendency and Dispersion Standardized Scores Error and Standard Error of Measurement (Sm)
Chapter 3, Part A Descriptive Statistics: Numerical Measures n Measures of Location n Measures of Variability.
Chapter SixteenChapter Sixteen. Figure 16.1 Relationship of Frequency Distribution, Hypothesis Testing and Cross-Tabulation to the Previous Chapters and.
Lecture 4 Dustin Lueker.  The population distribution for a continuous variable is usually represented by a smooth curve ◦ Like a histogram that gets.
Business Statistics, 4e, by Ken Black. © 2003 John Wiley & Sons. 3-1 Business Statistics, 4e by Ken Black Chapter 3 Descriptive Statistics.
LIS 570 Summarising and presenting data - Univariate analysis.
1 STAT 500 – Statistics for Managers STAT 500 Statistics for Managers.
Descriptive Statistics(Summary and Variability measures)
Chapter 6: Descriptive Statistics. Learning Objectives Describe statistical measures used in descriptive statistics Compute measures of central tendency.
Describing Data: Summary Measures. Identifying the Scale of Measurement Before you analyze the data, identify the measurement scale for each variable.
Analysis and Empirical Results
Chapter 3 Describing Data Using Numerical Measures
CHAPTER 3 Data Description 9/17/2018 Kasturiarachi.
Descriptive Statistics
Description of Data (Summary and Variability measures)
Chapter 3 Describing Data Using Numerical Measures
Basic Statistical Terms
STA 291 Spring 2008 Lecture 5 Dustin Lueker.
STA 291 Spring 2008 Lecture 5 Dustin Lueker.
Displaying and Summarizing Quantitative Data
Numerical Descriptive Measures
MBA 510 Lecture 2 Spring 2013 Dr. Tonya Balan 4/20/2019.
Business and Economics 7th Edition
Presentation transcript:

I OWA S TATE U NIVERSITY Department of Animal Science Using Basic Graphical and Statistical Procedures (Chapter in the 8 Little SAS Book) Animal Science 500 Lecture No. 7 September 21, 2010

I OWA S TATE U NIVERSITY Department of Animal Science SAS Graphical Capabilities u SAS has an extensive graphical ability u Can graph your distribution with a normal distribution overlay u Can graph various bar graphs u However it may not be as intuitive to use u Various styles of graphs can be used

I OWA S TATE U NIVERSITY Department of Animal Science SAS Graphical Capabilities u Many other programs that are available that are easier to use and more intuitive u Other programs with graphical capabilities more easily interface with word processing and other software

I OWA S TATE U NIVERSITY Department of Animal Science Assumptions of the Analysis of Variance u The analysis of variance has basic assumptions 1. Treatments randomly applied experimental units 2. Independence of residuals (,ij) within groups 3. Homogeneity of residual variances among groups 4. Treatment observations normally distributed

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate u Proc Univariate can be used to request a variety of statistics to summarize the data distribution of each analysis variable: 1. Sample moments 2. Basic measures of location and variability 3. Confidence intervals for the mean, standard deviation, and variance 4. Tests for location 5. Tests for normality 6. Trimmed and Winsorized means 7. Robust estimates of scale 8. Quantiles and related confidence intervals 9. Extreme observations and extreme values 10. Fequency counts for observations 11. Missing values

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate u Using various options in the PROC UNIVARIATE statement user can do the following: 1. Specify the input data set to be analyzed 2. Secify a graphics catalog for saving traditional graphics output 3. Specify rounding units for variable values 4. Specify the definition used to calculate percentiles 5. Specify the divisor used to calculate variances and standard deviations 6. Request that plots be produced on line printers and define special printing characters used for features 7. Suppress tables 8. Save statistics in an output data set

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output The UNIVARIATE Procedure Variable: write (writing score) Moments N 200 Sum Weights 200 Mean Sum Observations Std Deviation Variance Skewness Kurtosis Uncorrected SS Corrected SS Coeff Variation Std Error Mean Basic Statistical Measures Location Variability Mean Std Deviation Median Variance Mode Range Interquartile Range

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output meaning a. Moments - Moments are a statistical summaries of a distribution. b. N - This is the number of valid observations for the variable. The total number of observations is the sum of N and the number of missing values. If there are missing values for the variable, proc univariate will output the statistics about the missing values, such as the number and the percentage of missing values. c. Mean - This is the arithmetic mean across the observations. It is the most widely used measure of central tendency. It is commonly called the average. The mean is sensitive to extremely large or small values. d. Std Deviation - Standard deviation is the square root of the variance. It measures the spread of a set of observations. The larger the standard deviation is, the more spread out the observations are. e. Skewness - Skewness measures the degree and direction of asymmetry. A symmetric distribution such as a normal distribution has a skewness of 0, and a distribution that is skewed to the left, e.g. when the mean is less than the median, has a negative skewness. f. Uncorrected SS - This is the sum of squared data values. The two summations: sum of observations and sum of squares are related to the calculation of variance in the following way: Variance= (sum of squares -(sum of observations) 2 /N)/(N-1) g. Coeff Variation - The coefficient of variation is another way of measuring variability. It is a unitless measure. It is defined as the ratio of the standard deviation to the mean and is generally expressed as a percentage. It is useful for comparing variation between different variables.

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output meaning h.Sum Weights - A numeric variable can be specified as a weight variable to weight the values of the analysis variable. The default weight variable is defined to be 1 for each observation. This field is the sum of observation values for the weight variable. In our case, since we didn't specify a weight variable, SAS uses the default weight variable. Therefore, the sum of weight is the same as the number of observations. i. Sum Observations - This is the sum of observation values. In case that a weight variable is specified, this field will be the weighted sum. The mean for the variable is the sum of observations divided by the sum of weights. j. Variance - The variance is a measure of variability. It is the sum of the squared distances of data value from the mean divided by the variance divisor. The variance divisor is defined to be either N-1 or N controlled by the option vardef. The default option is vardef=df, which is N-1. The Corrected SS is the sum of squared distances of data value from the mean. Therefore, the variance is the corrected SS divided by N-1. We don't generally use variance as an index of spread because it is in squared units. Instead, we use standard deviation. k. Kurtosis - Kurtosis is a measure of the heaviness of the tails of a distribution. In SAS, a normal distribution has kurtosis 0. Extremely nonnormal distributions may have high positive or negative kurtosis values, while nearly normal distributions will have kurtosis values close to 0. Kurtosis is positive if the tails are "heavier" than for a normal distribution and negative if the tails are "lighter" than for a normal distribution. Please see our FAQ on kurtosis What's with the different formulas for kurtosis?What's with the different formulas for kurtosis?

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output meaning l. Corrected SS - This is the sum of squared distance of data values from the mean. This number divided by the number of observations minus one gives the variance. m. Std Error Mean - This is the estimated standard deviation of the sample mean. If we drew repeated samples of size 200, we would expect the standard deviation of the sample means to be close to the standard error. The standard deviation of the distribution of sample mean is estimated as the standard deviation of the sample divided by the square root of sample size. This provides a measure of the variability of the sample mean. The Central Limit Theorem tells us that the sample means are approximately normally distributed when the sample size is 30 or greater

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output meaning Mean - This is the arithmetic mean across the observations. It is the most widely used measure of central tendency. It is commonly called the average. The mean is sensitive to extremely large or small values. Median - The median is a measure of central tendency. It is the middle number when the values are arranged in ascending (or descending) order. Sometimes, the median is a better measure of central tendency than the mean. It is less sensitive than the mean to extreme observations. Mode - The mode is another measure of central tendency. It is the value that occurs most frequently in the variable. It is used most commonly when the variable is a categorical variable. Std Deviation - Standard deviation is the square root of the variance. It measures the spread of a set of observations. The larger the standard deviation is, the more spread out the observations are Variance - The variance is a measure of variability. It is the sum of the squared distances of data value from the mean divided by the variance divisor. The variance divisor is defined to be either N-1 or N controlled by the option vardef. The default option is vardef=df, which is N-1. The Corrected SS is the sum of squared distances of data value from the mean. Therefore, the variance is the corrected SS divided by N-1. We don't generally use variance as an index of spread because it is in squared units. Instead, we use standard deviation. Range - The range is a measure of the spread of a variable. It is equal to the difference between the largest and the smallest observations. It is easy to compute and easy to understand. However, it is very insensitive to variability. Interquartile Range - The interquartile range is the difference between the upper and the lower quartiles. It measures the spread of a data set. It is robust to extreme observations.

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output The UNIVARIATE Procedure Variable: write (writing score) Moments N 200 Sum Weights 200 Mean Sum Observations Std Deviation Variance Skewness Kurtosis Uncorrected SS Corrected SS Coeff Variation Std Error Mean Basic Statistical Measures Location Variability Mean Std Deviation Median Variance Mode Range Interquartile Range

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output Tests for Location: Mu0=0 Test -Statistic p Value Student's t t Pr > |t| <.0001 Sign M 100 Pr >= |M| <.0001 Signed Rank S Pr >= |S| <.0001 Quantiles (Definition 5) Quantile Estimate 100% Max % % % % Q % Median % Q % % % % Min 31.0

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output meaning Test - This column lists the various tests that are provided. Statistic - This column lists the values of the test statistics. p Value - This column lists the p-values associated with the test statistics. Student's t - The Student t-test is used to test the null hypothesis that the population mean equals Mu0. The default value in SAS for Mu0 is 0. The t-statistic is defined to be the difference between the mean and the hypotheses mean divided by the standard error of the mean. The p-value is the two-tailed probability computed using a t distribution. If the p-value associated with the t- test is small (usually set at p 0.05), the null hypothesis is not rejected. In our example, our t- value is and the corresponding p-value is less than We conclude that there is a statistically significant difference between the mean of the variable write and zero.

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output meaning Sign - The sign test is a simple nonparametric procedure to test the null hypothesis regarding the population median. It does not require that the sample is drawn from a normal distribution. It is used when we have a small sample from a nonnormal distribution. The statistic M is defined to be M=(N + -N - )/2 where N + is the number of values that are greater than Mu0 and N - is the number of values that are less than Mu0. Values equal to Mu0 are discarded. Under the hypothesis that the population median is equal to Mu0, the sign test calculates the p-value for M using a binomial distribution. The interpretation of the p-value is the same as for t-test. In our example the M-statistic is 100 and the p-value is less than We conclude that the median of variable write is significantly different from zero. Signed Rank - The signed rank test is also known as the Wilcoxon test. It is used to test the null hypothesis that the population median equals Mu0. It assumes that the distribution of the population is symmetric. The Wilcoxon signed rank test statistic is computed based on the rank sum and the numbers of observations that are either above or below the median. The interpretation of the p-value is the same as for the t- test. In our example, the S-statistic is and the p-value is less than We therefore conclude that the median of the variable write is significantly different from zero.

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output meaning Qualntile Meanings 100% Max - This is the maximum value of the variable. One hundred percent of all values are equal to or less than this value. 95% - Ninety-five percent of all values of the variable are equal to or less than this value. 75% Q3 - This is the third quantile. Seventy-five percent of all values are equal to or less than this value. 50% Median - This is the median. The median splits the distribution such that half of all values are above this value, and half are below. 25% Q1 - This is the first quantile. Twenty-five percent of all values of the variable are equal to or less than this value. 0% Min - This is the minimum value. Zero percent of values are less than this value.

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output Extreme Observationsee ----Lowest Highest--- Value Obs

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output Stem Leafff # Boxplotgg | | | z | | | | *-----*aa | + |c | | | | | | bb | | | | | | |

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Meaning Extreme Observations - This is a list of the five lowest and five highest values of the variable. Stem Leaf - The stem-leaf plot is used to visualize the overall distribution of a variable. In this display, the stem is the portion of the value to the left and the leaf is the part to the right. The number on the right is the number of leaves on each stem. For example, one the first line, the stem is 66, and there are seven 0's to the right of this stem, indicating that there are seven cases with a value of 66 or 67 for this variable. Boxplot - The box plot is a graphical representation of the 5-number summary for a variable. It is based on the quartiles of a variable. The rectangular box corresponds to the lower quartile and the upper quartile. The line in the middle is the median. The plus sign in the middle is the mean. We can visually compare the lengths of the whiskers. If one is clearly longer than the other one, the distribution may be skewed.

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output Meaning 75% Q3 - This is the third quantile. Seventy-five percent of all values are equal to or less than this value. 50% Median - This is the median. The median splits the distribution such that half of all values are above this value, and half are below. Mean - This is the arithmetic mean across the observations. It is the most widely used measure of central tendency. It is commonly called the average. The mean is sensitive to extremely large or small values. 25% Q1 - This is the first quantile. Twenty-five percent of all values of the variable are equal to or less than this value.

I OWA S TATE U NIVERSITY Department of Animal Science Normal Probability Plotcc ***** ** | ******* | ***** | **++ | ****+ | ***++ | ** **+ | *** | ++* | +*** | +** | ++* | +*** 31+**+**

I OWA S TATE U NIVERSITY Department of Animal Science Proc Univariate Output Meaning Normal Probability Plot - The normal probability plot is used to investigate whether the variable is normally distributed. The plus signs in the plot are indicate a normal distribution and they form a straight line. The asterisks are show the data values. If our variable is close to normal distribution, then the asterisks will also be close to a straight line and thus cover most of the plus signs. There are different types of departure from normality.

I OWA S TATE U NIVERSITY Department of Animal Science

I OWA S TATE U NIVERSITY Department of Animal Science Proc Corr (Correlations) u Is part of the base SAS software and computes correlations u Measures the strength of relationship between two variables u Values can range from -1 to 1 u If two variables completely uncorrelated they would have a correlation of 0 u If two variables are perfectly correlated they would have values of either -1 or 1 depending on whether correlation was negative or positive

I OWA S TATE U NIVERSITY Department of Animal Science Proc Corr (Correlations) u SAS basic statement n PROC CORR; l Will compute correlations between all numeric variables. n Add the word Var (list); l Computes correlations between variables you have listed n Add the word With along with the Var list; l Computes correlations using the var list across the top and variables in the with list down the side n Default l Computes Pearson product-moment correlation coefficients n Add options to the PROC statement to request non- parametric correlations

I OWA S TATE U NIVERSITY Department of Animal Science Proc Corr (Correlations) u SAS basic statement n PROC CORR Spearman; n The Spearman option calculates the Spearman’s rank correlations instead of Pearson’s correlations n Other options l HOEFFDING for Hoeffding’s D-Statistic l KENDALL for Kendall’s tau-b coefficient

I OWA S TATE U NIVERSITY Department of Animal Science Proc Corr (Correlations) u By default, PROC CORR prints a report that includes descriptive statistics and correlation statistics for each variable. l Number of observations with nonmissing values, l Mean, l Standard Deviation, l Minimum, and l Maximum. u For each pair of variables, PROC CORR prints the correlation coefficients, the number of observations used to calculate the coefficient, and the p-value. u If you specify the ALPHA option, PROC CORR prints Cronbach’s coefficient alpha, the correlation between the variable and the total of the remaining variables, and Cronbach’s coefficient alpha by using the remaining variables for the raw variables and the standardized variables.

I OWA S TATE U NIVERSITY Department of Animal Science Proc Corr (Correlations) u What does the P-Value mean that is associated with each correlatio? Answer = A significant P-value with a correlation just means the correlation is different from zero u Remember that correlations do not imply cause and effect. The correlation really just says how two variables vary with each other.

I OWA S TATE U NIVERSITY Department of Animal Science Proc Corr Output Fish Measurement Data The CORR Procedure 4 Variables: Weight3 Length3 Height Width Simple Statistics Variable N Mean Std Dev Sum Minimum Maximum Weight Length Height Width

I OWA S TATE U NIVERSITY Department of Animal Science Proc Corr Output Pearson Correlation Coefficients, N=34 Prob > |r| under H0: Rho=0 Weight3Length3HeightWidth Weight < < < Length < < < Length < < < Width < < <

I OWA S TATE U NIVERSITY Department of Animal Science Proc Corr Options ALPHA calculates and prints Cronbach’s coefficient alpha. PROC CORR computes separate coefficients using raw and standardized values (scaling the variables to a unit variance of 1). For each VAR statement variable, PROC CORR computes the correlation between the variable and the total of the remaining variables. It also computes Cronbach’s coefficient alpha by using only the remaining variables. If a WITH statement is specified, the ALPHA option is invalid. When you specify the ALPHA option, the Pearson correlations will also be displayed. If you specify the OUTP= option, the output data set also contains observations with Cronbach’s coefficient alpha. If you use the PARTIAL statement, PROC CORR calculates Cronbach’s coefficient alpha for partialled variables. See the section Partial Correlation for details. BEST=n prints the highest correlation coefficients for each variable. Correlations are ordered from highest to lowest in absolute value. Otherwise, PROC CORR prints correlations in a rectangular table, using the variable names as row and column labels. If you specify the HOEFFDING option, PROC CORR displays the statistics in order from highest to lowest. COV displays the variance and covariance matrix. When you specify the COV option, the Pearson correlations will also be displayed. If you specify the OUTP= option, the output data set also contains the covariance matrix with the corresponding _TYPE_ variable value 'COV.' If you use the PARTIAL statement, PROC CORR computes a partial covariance matrix. Displayed 4 of many. Examine the option that you might need or view the options and see what can be done!

I OWA S TATE U NIVERSITY Department of Animal Science PROC Reg u Reg procedure fits linear regression models by least-squares and is on of many SAS procedures which performs regression analyses u Reg is part of the SAS / STAT software and is licensed separately from the Base SAS software u Show linear regression u Proc Reg can is capable of analyzing models with many regressor variables using a variety of model –selection methods

I OWA S TATE U NIVERSITY Department of Animal Science Proc Reg u Selection methods available in Proc Reg n Stepwise regression n Forward selection n Backward elimination u Other procedures (Procs) for : n Non-linear n Logistic Regresssion u Basic form u PROC REG; n MODEL dependent = independent;

I OWA S TATE U NIVERSITY Department of Animal Science Proc Reg Example proc reg data = "d:\hsb2"; model science = math female socst read / clb; run; quit;

I OWA S TATE U NIVERSITY Department of Animal Science Proc Reg Output Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model <.0001 Error Corrected Total Root MSE R-Square Dependent Mean Adj R-Sq Coeff Var

I OWA S TATE U NIVERSITY Department of Animal Science Proc Reg Output Parameter Estimates Parameter Standard Variable Label DF Estimate Error t Value Pr > |t| Intercept Intercept math math score <.0001 female socst social studies score read reading score <.0001 Parameter Estimates Variable Label DF 95% Confidence Limits Intercept Intercept math math score female socst social studies score read reading score

I OWA S TATE U NIVERSITY Department of Animal Science PROC REG OUTPUT Ypredicted = b0 + b1*x1 + b2*x2 + b3*x3 + b4*x4 The column of estimates provides the values for b0, b1, b2, b3 and b4 for this equation. math - The coefficient is So for every unit increase in math, a unit increase in science is predicted, holding all other variables constant. female - For every unit increase in female, we expect a unit decrease in the science score, holding all other variables constant. Since female is coded 0/1 (0=male, 1=female) the interpretation is more simply: for females, the predicted science score would be 2 points lower than for males. socst - The coefficient for socst is So for every unit increase in socst, we expect an approximately.05 point increase in the science score, holding all other variables constant. read - The coefficient for read is So for every unit increase in read, we expect a.34 point increase in the science score.

I OWA S TATE U NIVERSITY Department of Animal Science PROC REG OUTPUT Standard Error - These are the standard errors associated with the coefficients. t Value - These are the t-statistics used in testing whether a given coefficient is significantly different from zero. Pr > |t|- This column shows the 2-tailed p-values used in testing the null hypothesis that the coefficient (parameter) is 0. Using an alpha of 0.05: The coefficient for math is significantly different from 0 because its p-value is 0.000, which is smaller than The coefficient for socst ( ) is not statistically significantly different from 0 because its p-value is definitely larger than The coefficient for read ( ) is statistically significant because its p-value of is less than.05.

I OWA S TATE U NIVERSITY Department of Animal Science PROC REG OUTPUT The intercept is significantly different from 0 at the 0.05 alpha level. 95% Confidence Limits - These are the 95% confidence intervals for the coefficients. The confidence intervals are related to the p-values such that the coefficient will not be statistically significant if the confidence interval includes 0. These confidence intervals can help you to put the estimate from the coefficient into perspective by seeing how much the value could vary.

I OWA S TATE U NIVERSITY Department of Animal Science Creating Statistical Graphics with PROC REG General form ODS GRAPHICS ON; PROC REG PLOTS (OPTIONS) = (PLOT-LIST); Model dependent = independent; Run; Quit;

I OWA S TATE U NIVERSITY Department of Animal Science Creating Statistical Graphics with PROC REG FITPLOTscatter plot with regression line and confidence and prediction bands RESIDUALS residuals plotted against independent variable DIAGNOSTICSdiagnostics panel including all of the following plots COOKSDCook’s D statistic by observation number OBSERVATIONBY PREDICTEDdependent variable by predicted value QQPLOTNormal Quantile Plot of Residuals RESIDUAL BYPREDICTEDresiduals by predicted values RESIDUALHISTOGRAMhistogram of residuals RFPLOTresidual fit plot RSTUDENTBY LEVERAGEstudentized residuals by leverage RSTUDENTBYPREDICTEDstudentized residuals by predicted values

I OWA S TATE U NIVERSITY Department of Animal Science Default Options u By default the FITPLOT, RESIDUAL and DIAGNOSTIC plots are generated

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA u One of many SAS procedures that can perform Analysis of Variance or ANOVA u Is part of the SAS/STAT that is licensed separately from the base SAS software u Is designed for balanced data n Equal numbers of observations in each combination of the classification factors n Exception is for the one-way ANOVA where the data not need be balanced

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA u One-way analysis of variance. n The null hypothesis tested by one-way ANOVA is that two or more population means are equal. n The question is whether (H 0 ) the population means may equal for all groups and that the observed differences in sample means are due to random sampling variation, or (H a ) the observed differences between sample means are due to actual differences in the population means.

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA u Assumptions needed for the ANOVA. 1)random, independent sampling from some larger population; 2)normal population distributions; 3)equal variances within the population. n Assumption 1 is crucial for any inferential statistic. n Assumptions 2 and 3 can be relaxed when large samples are used, and n Assumption 3 can be relaxed when the sample sizes are roughly the same for each group even for small samples.

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA u If you are not performing a one-way analysis of variance and / or your data is not balanced you should be using the General Linear Models Procedure or GLM

I OWA S TATE U NIVERSITY Department of Animal Science PROC ANOVA u The ANOVA procedure performs analysis of variance (ANOVA) n It is designed for use with balanced data from a wide variety of experimental designs. u In analysis of variance, a continuous response variable, known as a dependent variable, is measured under experimental conditions identified by classification variables, known as independent variables. u The variation in the response is assumed to be due to effects in the classification, with random error accounting for the remaining variation.

I OWA S TATE U NIVERSITY Department of Animal Science PROC ANOVA u General form PROC ANOVA CLASS variable-list; Model dependent = effects; n The two required statements are the CLASS and MODEL statements. n The CLASS statement MUST come before the Model statement n For the one way ANOVA only one variable is listed

I OWA S TATE U NIVERSITY Department of Animal Science PROC ANOVA u Many options available when using the ANOVA Means – calculates means for the dependent variable for any of the main effects included in the model statement Several mean separation or comparison tests including 1. Bonferroni t tests (BON) 2. Duncan’s multiple-range test (DUNCANS) 3. Scheffe’s multiple-comparison procedure (SCHEFFE) 4. Pairwise t tests (T) 5. Tukey’s studentized range test (TUKEYS)

I OWA S TATE U NIVERSITY Department of Animal Science PROC ANOVA u Many options available when using the ANOVA n General form MEANS effects / options; n The effects can be any main effect in the model statement l Cannot be any crossed or nested effects n The options can be any one of the comparison tests (Duncans or Tukeys for example)

I OWA S TATE U NIVERSITY Department of Animal Science PROC ANOVA u If the ODS Graphics are turned on PROC ANOVA will produce a grouped box plot of the effect variable for one-way ANOVA and for all effects in the MEANS statement

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA output u The output from an ANOVA analysis has at least two parts 1. Table providing information about the classification variables in the model 1. Number of levels 2. Values 3. Number of observations 2. An ANOVA table 3. Options like means will be outputted next

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA output example Girls’ Heights on Basketball Teams The ANOVA Procedure Class Level Information CLASSLevelsValues Team 5Blue gold gray pink red Number of Observations 60

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA output example Girls’ Heights on Basketball Teams The ANOVA Procedure Dependent Variable: Height SourceDFSums of SquaresMean SquaresF ValuePr > F Model Error Corrected Total R-SquareCoeff VarRoot MSEHeight Mean SourceDFAnova SSMean SquareF ValuePr > F Team

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA output example Sourcesource of variation DFdegrees of freedom for the model, error, and total Sum of Squaressum of squares for the portion attributed to the model, error, and the total Mean SquareMean square (sum of squares divided by the degrees of freedom) F ValueF value (mean square for model divided by the mean square for error Pr > F significance probability associated with the F statistic R-squareR-square (how predictive your model is) Coeff Varcoefficient of variation (standard deviation divided by the mean) How much variation you have among means of the same variable Root MSEroot mean square error (The name comes from the fact that it is the square root of the mean of the squares of the values) a statistical measure of the magnitude of a varying quantity It gives a sense for the typical size of the numbers and is squared to account for negative numbers The RMS is always the same as or just a little bit larger than the average of the unsigned values Height mean mean of the dependent variable in this case height

I OWA S TATE U NIVERSITY Department of Animal Science Proc ANOVA output example Girls’ Height on Basketball Teams The ANOVA Procedure Scheffe’s Test for Height NOTE: This test controls the type I experimentwise error rate. Alpha0.05 Error Degrees of Freedom55 Error Mean Square Critical Value of F Minimum Significant Difference Means with the same letter are not significantly different Scheffe GroupingMeanNteam A Pink BA gold BA gray B blue B red