Chapter5 - Chapter 5 SAS Chapter 5 Correlation and...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 5 SAS - 1 - Chapter 5 Correlation and Regression Analysis In this chapter, we will introduce how to compute correlation and perform regression analysis. 5.1 Correlation 1. PROC CORR (BASE SAS) a. Finds the estimated correlation between variables. Usually, correlation is denoted by “r” . i. -1 r 1 ii. Closer to 1, the stronger the positive relationship (as X , Y ) iii. Closer to -1, the stronger the negative relationship (as X , Y ) iv. Closer to 0, the weaker the relationship between X and Y b. The formula for the estimated Pearson correlation is: c. Options in the PROC CORR line i. Different types of correlations can be found. By default, Pearson correlation statistics are computed from observations with nonmissing values for each pair of analysis variables. we will only discuss the Pearson correlation ii. COV – finds the covariance matrix iii. OUTP=___ - creates a data set containing the Pearson correlations d. VAR statement – put variables of interest here 2. A simple example Let us revisit the SASDATA.Adjcereal data set. We would like to find the correlations among the nutrition variables *Find the correlation matrix using PROC CORR; title2 'Correlations among the nutrition variables' ; proc corr data =sasdata.Adjcereal outp =out_set1; var sugar fat sodium; run ;
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Chapter 5 SAS - 2 - Correlations among the nutrition variables The CORR Procedure 3 Variables: sugar fat sodium Simple Statistics Variable N Mean Std Dev Sum sugar 40 0.28942 0.14956 11.57662 fat 40 0.03218 0.02769 1.28731 sodium 40 5.61470 2.46253 224.58815 Simple Statistics Variable Minimum Maximum sugar 0 0.55556 fat 0 0.09259 sodium 0 10.71429 Pearson Correlation Coefficients, N = 40 Prob > |r| under H0: Rho=0 sugar fat sodium sugar 1.00000 0.23972 -0.16357 0.1363 0.3132 fat 0.23972 1.00000 -0.06614 0.1363 0.6851 sodium -0.16357 -0.06614 1.00000 0.3132 0.6851 a. Interpretation of the output: i. The estimated correlation between sugar and fat is r = 0.23972. ii. The p-value for a hypothesis test of H o : Population correlation = 0 (no correlation) H a : Population correlation 0 (positive or negative correlation) is 0.1363. Thus, do not reject H o . There is not enough evidence to conclude a significant correlation between sugar and fat. b. Print of the data out_set1:
Image of page 2
Chapter 5 SAS - 3 - Correlations among the nutrition variables Obs _TYPE_ _NAME_ sugar fat sodium 1 MEAN 0.2894 0.0322 5.6147 2 STD 0.1496 0.0277 2.4625 3 N 40.0000 40.0000 40.0000 4 CORR sugar 1.0000 0.2397 -0.1636 5 CORR fat 0.2397 1.0000 -0.0661 6 CORR sodium -0.1636 -0.0661 1.0000
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon