Correlation Correlation is the relationship between two quantitative variables. Correlation coefficient (r) measures the strength of the linear relationship between two variables. If for two variables X and Y, SS(X) and SS(Y) stand for their sum of squares respectively, and SP(X,Y) for their sum of product, then r is defined as SP(X,Y) =, SS(X) = and SS(Y) =
Correlation Height Positive correlation Types of correlation: 1.Perfect positive correlation 2.Perfect negative correlation 3.Partial/Moderately positive correlation 4.Partial/Moderately negative correlation 5.Absolutely no correlation
Correlation The statistical significance of r is tested using a t-test. The null hypothesis is that in whole population there is no relationship between y and x. The hypotheses for this test are: H 0 : r= 0 H a : r <> 0 We refer this value to the t distribution table with df = n – 2, to find p - value. A low p - value for this test (less than 0.05 for example) means that there is evidence to reject the null hypothesis in favor of the alternative hypothesis, or that there is a statistically significant relationship between the two variables. with df = n – 2
Correlation The height and weight of 7 students are given below. Calculate the coefficient of correlation ( ‘ r ’ value) between height and weight. Height (in inch): 65, 66, 67, 68, 69, 70, 71 Weight (in pound): 67, 68, 66, 69, 72, 72, 69 xyx2x2 y2y2 xy
Correlation = 0.67 t = 0.67 x = 2
Linear regression Linear regression is used to develop an equation (a linear regression line) for predicting a value of the dependent variables given a value of the independent variable. A regression line is the line described by the equation and the regression equation is the formula for the line. The regression equation is given by: Y = a + bX Where X is the independent variable, Y is the dependent variable, a is the intercept and b is the slope of the line.
Linear regression - Exercise xy xx2x2 yy2y2 xy y = a + bx; y = x Now we can draw the best fitting line with this equation.