what is r squared 
r squared r2 is a number that tells you how well the independent variable s in a statistical model explain the variation in the dependent variable it ranges from 0 to 1 where 1 indicates a perfect fit of the model to the data xiaojie liu investopediaunderstanding r squaredr squared represents the proportion of the variance in the dependent variable that is predictable from the independent variables a value of 1 implies that all the variability in the dependent variable is explained by the independent variables while a value of 0 suggests that the independent variables do not explain any of the variability r squared should be interpreted alongside other statistics and context as high r squared values can sometimes be misleading if the model is overfitted whereas correlation explains the strength of the relationship between an independent and a dependent variable r squared explains the extent to which the variance of one variable explains the variance of the second variable so if the r squared of a model is 0 50 then approximately half of the observed variation can be explained by the model s inputs formula for r squaredr 2 1 unexplained variation total variation begin aligned text r 2 1 frac text unexplained variation text total variation end aligned r2 1 total variationunexplained variation the calculation of r squared requires several steps steps this includes taking the data points observations of dependent and independent variables and conducting regression analysis to find the line of best fit often from a regression model this regression line helps to visualize the relationship between the variables open a new bank account advertiser disclosure the offers that appear in this table are from partnerships from which investopedia receives compensation this compensation may impact how and where listings appear investopedia does not include all offers available in the marketplace from there you would calculate predicted values subtract actual values and square the results these coefficient estimates and predictions are crucial for understanding the relationship between the variables this yields a list of errors squared which is then summed and equals the unexplained variance to calculate the total variance you would subtract the average actual value from each of the actual values square the results and sum them this process helps in determining the total sum of squares which is an important component in calculating r squared from there divide the first sum of errors unexplained variance by the second sum total variance subtract the result from one and you have the r squared 