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.)

Filter by
Sorted by
Tagged with
0 votes
0 answers
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 ...
4 votes
1 answer
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
2 votes
3 answers
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 ...
0 votes
0 answers
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 ...
0 votes
0 answers
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
0 votes
0 answers
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) ...
  • 1
0 votes
0 answers
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 ...
1 vote
1 answer
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 ...
0 votes
0 answers
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
2 votes
2 answers
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
0 votes
1 answer
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?
4 votes
1 answer
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
2 votes
3 answers
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 ...
0 votes
0 answers
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
1 vote
1 answer
55 views

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

The answer is 33033/80265= 0.4115?
0 votes
1 answer
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
19 votes
2 answers
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
0 votes
0 answers
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
0 answers
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 ...
0 votes
0 answers
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
3 votes
1 answer
243 views

Why is the sum of individual Spearman's rho squared less than 1 as opposed to Pearson's r in a synthetic example?

A relatively low number of iid random vectors of a relatively high dimension (10,000) are added up together element wise: $$\sum_{i=1}^{n}X_i=Y$$ where $dim(X_i)=dim(X_j)=dim(Y),\forall i,j$ and $dim(...
  • 271
0 votes
1 answer
46 views

How does PC-ORD calculate the amount of variation captured by each axis in NMDS?

I've always been taught that a major downside of NMDS is that there's no way to calculate the amount of variance captured by each axis. Variance doesn't come into the calculation at all so this made ...
  • 208
1 vote
1 answer
46 views

Using Box-Cox transformed features as input decreased the $R^2$ score of a regression model

I am working on building a regression model to predict housing sales price using house features (Ames housing dataset). And I prepared feature set in two ways Case 1. I performed boxcox ...
0 votes
0 answers
15 views

R-Squared for real valued label under non linear regression learner

Below are my questions of R-Squared for real valued label under non linear regression learner. It may be a large problem, if there is no easy answer, could you give me some references? Firstly for the ...
  • 1,117
0 votes
0 answers
35 views

How to adjust $R^2$ (in R or Stata) when using LSDV technique for firm, industry and country fixed effect?

Is there any way to adjust $R^2$ (in R or Stata) if I am using the least squares dummy variable (LSDV) technique for firm, industry, and country fixed effects? As I am not aware of how to incorporate ...
  • 11
3 votes
1 answer
156 views

Strange definition of coefficient of determination

In Wei and Kusiak, 2015 a metric is used to evaluate the performance of a time-series prediction model. The paper calls it [the] correlation coefficient ($R^{2}$) and defines it as $R^{2} = 1-\frac{...
0 votes
0 answers
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 ...
0 votes
1 answer
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
1 answer
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 ...
0 votes
0 answers
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
0 votes
0 answers
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
0 answers
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 ...
0 votes
0 answers
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
3 votes
1 answer
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
0 votes
0 answers
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
0 votes
0 answers
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
1 answer
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
2 votes
1 answer
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
0 votes
0 answers
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 ...
0 votes
0 answers
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
0 votes
0 answers
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
1 answer
38 views

Using R-squared to assess the performance of prediction models

Say I have some true values of some variable of interest $y_i^t$ for a population of individuals indexed by $i$. Now say I have some model-based predictions of those true values, which I'll denote by $...
0 votes
0 answers
21 views

F-test value in significance test for Linear Regression; what is the value when R^2 is equals 1?

What is F-test value in significance test for Linear Regression when $R^2$ is equals 1?
0 votes
1 answer
94 views

Why normalize the vectors to calculate the Pearson correlation coefficient?

I learned from this answer that the correlation $R$ is $\cos(\theta)$ and $\theta$ is the angle between a dependent vector $Y$ and an independent vector $X$, but I learned from this article that the ...
  • 5,446
1 vote
0 answers
26 views

Why we do not use r squared for logistic regression? [duplicate]

Why we do not use R squared for logistic regression? What is the logic behind it?
  • 11
0 votes
0 answers
21 views

Why is R-squared Not Valid for Nonlinear Regression? [duplicate]

Why is R-squared Not Valid for Nonlinear Regression? Why we generally do not use it in nonlinear regression?
  • 11
0 votes
0 answers
18 views

Significance test if R-squared ($R^2$) is significantly different from 1 (or some number very close to 1)

I am trying to find a way to test if a R-squared value that is high (>90%, on a small sample of c30 observations) is not significantly different from 1 (or at least from a number very close to 1, 0....
0 votes
0 answers
12 views

Different tests for model fit

I saw that in linear regression models one often uses a hypothesis z- or t-test for $R^2$ or for effect sizes. A z-Test is only useful if the standardized $R^2$-values are standard normally ...
1 vote
0 answers
62 views

How to distinguish two versions of R-squared calculated on test set?

I've come across two ways that people calculate R-squared on a test set: Calculate the square of the correlation between predictions and actual values (in practice, I've seen people do this in R by ...
  • 3,850
2 votes
1 answer
58 views

Reference for calculating $R^2$ on a subset of the samples

I've been looking for a method to calculate $R^2$ on a subset of the samples (a subset of the instances, not a subset of features), and found this answer from Dave. It suggests using the mean of the ...
  • 987

1
2 3 4 5
20