# Testing how well an unweighted linear regression explains variation compared to a weighted linear regression

I have a weighted and an unweighted linear regression (same dataset) and need a measure of how well one model can explain variation relative to the other (i.e. are the R-squared values significantly different?)

I have the R-squared value for both models. I can bootstrap a confidence interval for the R-squared values and perform a one-way anova on the two resulting distrubtions, but this is computationally intensive compared to a simple test. I will be performing this calculation for millions of instances, so every byte adds up.

A little context: I'm in bioinformatics measuring gene-gene coexpression with a Pearson correlation coefficient. I am asking whether some samples are contributing to a high coexpression correlation coefficient more than others, thus I am weighting out some samples and asking if this model can now explain variation better (or worse) than the unweighted model.

• Why $R^2$? Moreover, if weights play part, why would you compare to unweighted variance?
– Tim
Dec 16 '19 at 17:50
• @Tim I'm interested in the goodness of the fit. The null hypothesis is that a defined subset of data points have no effect on the goodness of the fit. The working hypothesis is that, in fact, they do, and weighting them out will increase the goodness of the fit. Dec 16 '19 at 19:06
• @Tim but your question motivates a second thought. Perhaps I could do a weighted t-test on the residual least squares... if that makes any sense. Dec 16 '19 at 20:07