# Questions tagged [r-squared]

The coefficient of determination, usually symbolized by $R^2$, is the proportion of the total response variance explained by a regression model. Can also be used for various pseudo R-squared proposed, for instance for logistic regression (and other models.)

982 questions
Filter by
Sorted by
Tagged with
2 views

### How is R squared calculated in context to H.clustering?

I was reading the paper "Consistent Individualized Feature Attribution for Tree Ensembles" by Scott Lundberg et al. and cannot understand how the calculation for the $R^2$ works here - see ...
59 views

### How to motivate the definition of $R^2$ in sklearn.metrics.r2_score?

TLDR: What motivates the definition of $R^2$ in the Python function sklearn.metrics.r2_score? DETAILS The Python machine learning package ...
• 35.7k
63 views

### R squared comparison

I have 5 features in my data. The R squared value when I use features 1,2, and 3 is $x$ and the R squared value when I use features 1,3, and 4 is $x + 0.1.$ Does this mean my second model is better ...
13 views

### Explained variance in a boostraped analysis

Is there a way to estimate the variance explained by bootstrapped comparison of means? For example, I have a continuous dependent variable and a factor of 3 levels. When I run a standard, linear model ...
19 views

### OLS R-Squared from Sliced OLS Regression

I have the following question: suppose we have a data set with 3000 observations $(X,y)$ and $X$ can be matrix. So we want to use a bunch of features to predict $y$. Suppose we sliced the data into ...
• 213
13 views

### Why is the following dataset giving me a negative R squared value? [duplicate]

This is my code, I calculated R square using Scikit learn : y =[0, 10, 20, 30, 40] f =[0, 1, 2, 3, 4] r2 = r2_score(y, f) print('r2 score for perfect model is', r2) ...
57 views

### Interpret Coefficient of Determination in matrix form

In matrix form, a linear regression can be represented in the following form: $$Y \sim \mathbf{X} \beta + \epsilon; \\ \epsilon \sim N(0, \sigma^2 \mathbf{I})$$ The definition of $R^2$ is the ...
• 121
1 vote
41 views

### What is the difference between Partial Eta Squared and Partial R Squared in factorial repeated ANOVA?

I carried out an repeated measures ANOVA in SPSS with two within subjects predictors, and requested for measures of effect size. SPSS provides partial Eta Squared as a measure of effect size, but I ...
9 views

### Understanding FE explanatory power

I am trying to understand what is going on in terms of the additional variation explained by my fixed effects. The set up is as follows. I have a a data set of roughly 3929 firm acquisition events ...
• 1
90 views

### What is the interpretation of the "traditional" $R^2$?

Suppose the following data correspond to observed responses and their predictions obtained from some model. ...
• 1,737
120 views

### Highest in-sample R-squared

Which of the following model has the highest in-sample $R^2$ in the same dataset: OLS linear regression, lasso, or ridge? My guess is OLS. Am I wrong?
• 363
66 views

### Why do we use $R^2$ instead of $R$ in linear regression?

$R^2$ equals the "amount of variance explained by the model". However, we rarely use variance in descriptive statistics. We say a sample's weight is 78 ± 13 kg, which is $\bar x$ ± $\sigma$ (...
• 41
92 views

### Interpretation of "low variance" in PCA

I have a question to ask about the interpretation of the PCA result. The context concerns biological samples (spectroscopically analyzed) divided into treated and untreated samples (control) If the ...
29 views

### Estimates of correlated predictors and R squared in a multiple linear regression model

I am currently working out how different predictors contribute to a multiple linear regression model, especially when they are correlated and how it effects $R^2$. Given this diagram... the author ...
1 vote
55 views

### How to calculate the R-square with the following figure?

The answer is 33033/80265= 0.4115?
40 views

### Why is the coefficient of determination less than or equal to 1?

I have been reading about the Coefficient of Determination and am wondering why it is necessarily less than or equal to 1. I understand that RSS is the sum of the difference between each dependent ...
• 439
3k views

### Showing machine learning results are statistically irrelevant

This is a question as part of a paper review which was already published. The authors of the paper publish $R^2$ and RMSE in training but only RMSE in validation. Utilizing the published code, $R^2$ ...
• 313
16 views

### Are there a levels of "goodness" for Adjusted R-Squared values?

In a psychological experiment with an explanatory and a response variable, are there a levels of "goodness" for Adjusted R-Squared to explain the variability of data? I an experimental test, ...
1 vote
31 views

### How can it come to have a negative r-squared value and a relative absolute error (RAE) below 1?

i am training for my masterthesis a feed forward neural network regression model to predict the annual sales of accounts. The training data is highly skewed, which means that there are a lot of low ...
8 views

### Coefficient of determination of zero vector

I have a vector "a" that contains the real experimental results and another vector "b" that is predicted values of the same experiments. I want to find the accuracy of predictions ...
• 151
243 views

15 views

### Contribution in a regression with interaction terms

I have a simple regression model y ~ intc + a + b + a * b, let's say I can estimate this model accurately. (a, b) are two positive variables. I want to know what ...
• 263
114 views

### What is the uncertainty of Leave-one-out-cross-validation method?

I have used the LOOCV to validate my model. As we know, the LOOCV method is a special case of cross-validation where the number of folds equals the number of instances in the data set. Thus, the ...
1 vote
27 views

### Change in R squared

I am running a regression to test how different attributes affect house prices. These attributes have been separated into three categories that are: structural factors (number of room, size, square ...
• 11
48 views

### R squared of subgroups

I am trying to predict a value using a linear regression, and I get an R squared of 0.63. My data is composed of 5 different groups (each with different ...
• 101
43 views

### Adjusted $R^2$ (R-squared) for multivariate regression

For univariate or single independent variable regressions, this formula can be used (details here): $$R^2_{adjusted} = 1- \dfrac{SSRes}{SSTotal}\dfrac{n-1}{n-p}$$ However, I cannot find a similar ...
1 vote
24 views

### Meta-analysis of "adjusted r-squared" from multiple prediction models

Using data from multiple cohorts, I am trying to check the performance of a prediction model I developed. The plan is to get the Adjusted r-squared from 2 models, one model has the score and the other ...
14 views

### Multilevel models significance

For example, in the OLS regression (not multilevel), we have R^2 and p-value for F test. This p value indicates whether R^2 is significance or not. In multilevel models, we have R^2 as well (marginal/...
• 139
41 views

### Extreme Heteroskedasticity - Multiplicative Model - Strange residuals

I absolutely need your help with my research. When I checked for heteroskedasticity I obtained a weird result from the white test (p value = 0). When I plot the residuals, these are the results: ...
• 31
36 views

### Does $R^2$ measure goodness of fit or not? [duplicate]

I have been warned against $R^2$ as goodness of fit before, but am unsure why. What is wrong with using it to characterize how well a line fits data points? I have looked at a few sources to try and ...
• 13
80 views

### mgcv GAM models in R package caret - how to interpret output

I am attempting to evaluate two GAM models I developed in mgcv via leave-one-out cross validation in the caret package. I am a newbie to both GAMs and cross-validation. For the purposes of this ...
• 11
1 vote
85 views

### Why OLS perform better than LASSO?

I am comparing OLS and LASSO regression for survey data. I have n>p, but I think my data is high-dimensional data as the p is 3000 and n is 48000. I am using k cross-validation. The results are ...
• 11
39 views

### Adj. $R^2$ with tree ensembles

Consider tree ensemble methods such as XGBoost, Lightgbm and/or Catboost. Is the adj. $R^2$ a valid metric for tree ensembles? I'm curious because these methods handle factor variables differently. E....
• 218
34 views

### Can introducing time fixed effects variable into a PanelOLS decrease overall and between R^2?

I am trying to find if there is a relationship between the number of people employed by the tech industry within a city and wages in that city. I ran two Linear Regressions on my data. The first one ...
30 views

### Measure of goodness-of-fit in errors-in-variable regression

I have two observed time series $x_i$ and $y_i$ and I want to test if $x_i$ is a good predictor of of $y_i$. So I would usually run a simple linear regression Y ~ X and use $R^2$ as a measure of ...
• 1
19 views

### Weighting the R-squared as a measure of goodness-of-fit in Linear Regression [duplicate]

I have two observed time series $x_i$ and $y_i$ and I want to test if $x_i$ is a good predictor of of $y_i$. So I run a simple linear regression Y ~ X and use $R^2$ as a measure of goodness of fit. ...
• 1
1 vote