# How could forcing my regression line to go through the origin increase the R^2? [duplicate]

I created the scatterplot on the left in Tableau and ran the regression line, which resulted in an R^2 of 0.63 (confirmed this in excel as well). Then, I used the "Force y-intercept to zero" option in line settings and was surprised to find that the R^2 value of my regression line actually increased (see scatter on right with intercept of 0 and R^2 of 0.67). This is counter-intuitive to me because I thought that the purpose of a regression line was to create the line that results in the highest R^2 value. How could forcing it go to go through (0,0) increase the R^2? Thanks in advance for your help.

## marked as duplicate by whuber♦ regression StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Mar 7 '18 at 1:05
• Actually the regression line is fit by least squares which minimizes the sum of squared residuals. This is not quite the same as maximizing R$^2$. Also the calculated R$^2$ has strange properties when the line is fit with constraints. Also if I read your graphs correctly the least squares line has an intercept near the origin.. – Michael Chernick Mar 7 '18 at 0:57