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

924 questions
Filter by
Sorted by
Tagged with
22 views

### Is best model selection by RSS equivalent to best model selection by R2 value?

I am trying to compare models using K-Fold-CV using the regsubsets function in R. By default, it states that the ideal model is determined by the $RSS$. I wished to ...
39 views

### How to extract goodness of fit measures, like adjusted/conditional (pseudo) R squared values, from nlme models in R

I normally use r.squaredGLMM() (from MuMIn package) to extract marginal and conditional R-squared (or pseudo-R squared) values ...
17 views

### Effect size estimation in mixed model: why is magnitude of fixed effect estimate different to variation explained?

I ran a mixed effects model with a fixed effect, random intercept and random slope. The fixed effect is highly significant but I want to get a feeling for how important/practically relevant or big ...
14 views

### Random state value changes the results of rmse and R2

I want to know why everytime I run my algorithm (XGBoost regressor) with a different random state (applied to train/test split part) I get different values for R2 and RMSE. For example : Random state ...
44 views

### Interpreting nonlinear regression $R^2$

In ordinary least squares linear regression, $R^2=1-\frac{SSRes}{SSTotal}$ is described as the “proportion of variance explained”. Does this apply to nonlinear regression, too?
23 views

### Scikit-learn permutation importance is higher than 1 with R-squared scoring

I'm using Scikit-learn permutation_importance to compute the feature importance for a regression problem according to multiple models. I use $R^2$ as the scoring. ...
16 views

### Different results when i define my own score and when using model.score in linear regression (out of sample accuracy)

I am dealing with time feries data. I have a custom function created with sklearn.metrics.make_scorer to compute out-of-sample model accuracy: ...
30 views

### Interpreting the total-variance when the model lies over our data

I know that: $Variance_{Total}=Variance_{Explained} + Variance_{Unexplained}$, but I am wondering how the $Variance_{Total}$ relates to the $Variance_{Unexplained}$ and the $Variance_{Explained}$ if ...
20 views

### Is the Coefficient of Determination the "explained variance" or the ratio of explained variance to total variance

I have found in multiple texts that the coefficient of determination, or R-squared, is often referred to as the "variance explained". When, to be precise, it seems to be the ratio of the ...
22 views

### Accuracy percentage-wise of a regression model [duplicate]

I would like to check in percentage the accuracy of my regression model. I know that normally accuracy is used as a metric for classification. I have evaluated my model based on r-squared and also ...
41 views

### Adjusted R2 Validity for Big amounts of observations

I am working with a dataset that has a big amount of observations (2000). The purpose of my work is to find which dependent variables (x1, x2, x3...) are linked to my independent variable (y). I have ...
18 views

### Should correlated independant variables be removed to the expense of the adjusted r_squared and rmse?

I have a dataset with a target variable and multiple independent variables. Some independent variables are highly correlated with each other (sometimes r>0.9). First, I thought i'd create a linear ...
50 views

### Can $R^2$ be applied to non-linear least square regression? [duplicate]

$R^2$ is usually used as a measure to determine a goodness of a fit. It appears to be used often times for linear least square fits, linear regression. There's another measure which is RSS (residual ...
21 views

### R squared for a zero-truncated negative binomial model

Does anyone know how to calculate R squared for a zero-truncated NBM (ZTNB)? I used the methods developed by Nakagawa and Schielzeth 2013 and Nakagawa et al. 2017 to calculate R squared for Poisson ...
28 views

### LR test gives contradictory results to R squared

I have a difficult decision here. The R squared suggests that model 1 has a better fit than model 2, but the LR test suggests the model 2 has a better fit. How can I resolve this seemingly ...
16 views

### Does it make sense to calculate R2 on splits of test data based on target value percentile?

I have an XGBoost regression model to predict a numeric target y. y is quite right-skewed when I plot histogram. For example, ...
68 views

### Why are my elastic net and lasso r-squared measures negative?

I'm using sklearn.linear_model.Lasso and sklearn.linear_model.ElasticNet on a model that includes a constant. I don't expect a model with a constant to perform worse than the average of the data, ie ...
28 views

### ANOVA vs R-Squared (Explained Variance)

My goal is to determine whether for linear regression some predictors uniquely improve the fit beyond that which is already available via all other predictors combined. I have originally tried multi-...
50 views

### Designing an experiment with linear regression analysis: more categories or more observations per category?

During the design of my experiments I encountered the following question: When doing a linear fit (least squares), does it make more sense to have more categories or more observations per category. In ...
38 views

### How to interpret increase to AIC and adjusted r-squared?

I understand adjusted r-squared and AIC can be used to select an ideal model from a group. Higher AIC is worse but higher ar2 is better. After adding a categorical variable to an OLS model, my ...
21 views

### What does it mean when SSR>SST?

Following is an example of the observed and predicted values for my variable y (in R). ...
26 views

### Confidence interval of mean of sample R-squared values

I have read some posts about how to calculate the confidence interval for a single R-squared value from linear regression. But now I am asking that what if I have a sample of $R^2$ and I want to ...
32 views

### Find r-squared of points around an x=y line (R)

I have some data I obtained from a lab experiment that shows the theoretical value of variable A, against its actual, experimentally derived value, for a range of variable A. I've plotted the data as ...
120 views

### Here's why you can (hopefully) use $R^2$ for non-linear models. Why not?

We calculate $R^2$ as follows: $R^2 = 1 - \frac{\|y - \hat y\|^2}{\|y - \bar y\|^2}$ $y$ is a vector of true answers; $\bar y$ is a vector whose elements are mean of $y$; $\hat y$ is a a vector with ...
49 views

### conflicting values for RMSE and R-square

I am doing linear regression on a dataset. I divided the data into training (70%) and testing(30%). Here are the metrics for training and testing data: Training data: R2 is 0.85 and RMSE is 2339 ...
16 views

### Interaction term as a Covariate

Can I use an Interaction Term as a covariate, without any interaction with my primary variable of interest? $Y = a + bX_1 + cX_2 + dX_3 + eX_2*X_3 + error$ where a is the intercept, and b, c, d, e are ...
16 views

### Interpreting R2 Over Cross-Validated Folds

I am running a supervised regression with cross validation, and wish to use $R^2$ as my performance metric. I am using Leave-P-Out cross validation, with P=2, which gives me approximately 4500 folds, ...
107 views

### How is the relationship between two variables $X$ and $Y$ supposed to "explain" $R^2\text%$ of the variation of the data?

Suppose we have a linear regression and we calculate $R^2 = 0.81$. What do we mean when we say "the relationship between two variables $X$ and $Y$ explains $81\text%$ of the variation of the data&...
29 views

### Positive train score and negative test score in sklearn [duplicate]

I am doing a regression model using kfold cross validation using a dataset with ~200 data and noticed my r2 score on train data is positive(average 0.7) and my r2 test score is negative. What does it ...
31 views

25 views

### How does the meaning of R^2 come from squaring R?

I think more or less I understand what R and R^2 are, but I do not understand how R^2 comes from R. In a video I saw this explanation for R^2 : (VAR[mean] - VAR[line]) / VAR[mean]. From this formula I ...
11 views

### Total inconsistence between Pearson correlation in a correlation matrix vs Pearson test AND Rsquare smaller than Pearson [duplicate]

I have a very urgent issue that I need to solve this weekend. If I create a linear model between 2 variables and look for the R square with this code: ...
42 views

### Why can't we use sum of absolute residuals instead of R squared method in Linear regression [closed]

I am fairly new to statistics, so can somebody explain to me the given question in simple terminology. I read almost all answers on stack exchange but all I can say is they are too technical for me. A ...
118 views

### Conceptual/Math/brainteaser Question: Multiple Linear Regression

This is kind of a brainteaser and I'm struggling to solve it, any ideas on approaching this would be valued: I thought about using substitution of the different x and z into the third regression ...
7 views

### standard deviation of the model R2 in LOOCV in caret

I am performing a LOOCV linear model and I got the parameters R2 and RMSE, but I was wondering if there is a way to calculate the standard deviation of the model R2. I tried to do it in the same way I ...
19 views

### What is the relationship between a simple regression's $F$ value for $R^{2}$ and $t$ value for a slope?

I have a question that states: In a simple regression, if the $F$ value for $R^{2}$ is 4, then the $t$ value for the slope $b$ must be...? I'm having trouble understanding how to figure out the ...
19 views

### understanding R2 in probit

I try to create a model to predict football (socker) results with a performance variable. It doesn't really matter how this performance is calculated since any performance variable is an adequote ...
80 views

### Removing variables from a linear regression improves $R^2_{adj.}$

I am working on a linear regression model. The complete model with 11 variables in total has a quite low adjusted R-squared ($R^2_{adj.}$) of 0.11. 4 variables have a significant influence on the DV....
42 views

### How to adjust the standard error for a standardized beta after squaring the beta

I have a standardized beta from a regression, which is equivalent to a correlation. I also have it's standard error (SE). I want to plot the R2 (explained variance) with an error bar, and to get the ...
39 views

### Explained variance score vs $R^2$ score

I came across explained variance score and $R^2$ score in scikit learn docs. Docs defines exaplained variance score as: $\text{explained variance} (y,\hat{y})=1-\frac{Var\{y-\bar{y}\}}{Var\{y\}}$ ...
I was going through this answer which gives total sum of squares as $TSS=\sum_i(Y_i-\hat{Y}_i)^2+\sum_i(\hat{Y}_i-\bar{Y})^2+2\sum_i(Y_i-\hat{Y}_i)(\hat{Y}_i-\bar{Y})$ It then says: In a model with ...
Two related questions: I have read in different texts that the sum of squared semipartial correlations is "typically" less than $R^2$, except when supressor variables, or rather a supression ...