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

963 questions
Filter by
Sorted by
Tagged with
13 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 ...
16 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
7 views

### Variance explained at each level of a categorical variable

I have a deep learning regression that predicts the value of a continuous variable Y. There is a categorical variable Z that has ...
• 4,562
16 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
17 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 ...
6 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/...
• 109
30 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
31 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
20 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
46 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
32 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
13 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 ...
18 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
28 views

• 11
29 views

### What could cause the F-statistic to increase but adjusted $R^2$ to decrease?

I have created two multiple linear models of the same data. The two models vary only in the dropping of a few variables. Model_A includes all X independent vars (A,B,C,D): Model_B includes only A,B ...
73 views

### MSE is 'scale dependent'. R-squared seems a better measure of fit for regressions. Are there others?

Mean-Squared Error is scale dependent. For example if I have an MSE of 0.1 and multiply all of X and Y by 100, redo my regression and calculate MSE, I get an MSE of 1000.0. ((y_true-y_regr)^2 ---> ...
• 21
8 views

### Mean of Relative Error Vs. Coefficient of Determination

Consider we have a method that estimates a specific parameter. We want to find the accuracy of this method and we have 10 samples (these samples include the true values of the parameters and their ...
• 151
111 views

### How do you write the AIC and BIC of a regression model in terms of the coefficient-of-determination?

This question is to give a general exposition of the relationship between goodness-of-fit statistics in regression analysis, to answer questions like this one. Consider a nonlinear Gaussian regression ...
• 94.6k
107 views

### Linear regression gives a good $R^2$ but also a high BIC

I tried a linear model with interactions on my data ($n=95,840$ rows) : ...
• 131
1 vote
18 views

### Generating random samples that satisfies specific r-squared of MAPE

I would like to generate some samples that satisfies a specific r-squared or MAPE(Mean Absolute Percentage Error) with a given vector. For example, a vector a_i is given and I want to generate some ...
58 views

### Adjusted $R^2$ as an Alternative to a Test Set?

I am trying to understand the following statement from Max Kuhn and Julia Silge about the use of adjusted $R^2$ when fitting a regression model. Is it correct that the adjusted $R^2$ does not need to ...
70 views

### Is Stata xtreg "within" r-squared incorrect when using i.time fixed effect dummies?

In Stata xtreg y x1 x2 i.year, fe will give the within R-squared, but is it calculating it using the projected model (taking out fixed effects) yet mistakenly (my ...
• 91
20 views

### R packages for psuedo R squared disagreements

I'd like to report a psuedo-R^2_glmm for some glmms I've made. Oddly, I've found each R package I've tried gives a different result, while I thought these all are doing the same thing in principle. At ...
1 vote
97 views

### is it okay if r-square and RMSE for the lasso be worse than normal linear regression?

I am comparing three regression models, simple linear regression, Lasso and Bayesian Lasso then the R-Square and RSME for them are ...
• 123
10 views

### How to estimate standard errors and R2 from variance-covarariance matrix? [duplicate]

This is what says "the following table shows the variances and convariances of the logarithms of the importations, PIB and IPC in USA between 1975 and 2005. Here is the table with variances/...
51 views

### Comparison of predictor performances in different models

My intention is to test the power of a single predictor x in predicting different responses: y1 that is presence/absence and <...
14 views

### Proper metric to compare continuous to discrete data? [duplicate]

I have two measurements of the same thing. The first is a subjective rating score, the second is a quantitative metric. The rating score is discrete (0-10), while the quantitative metric is any value ...
15 views

### How meaningful is the outcome of a mixed effect model with small R²marginal combined with a medium R²conditional?

I have a mixed effect model with two independent categorical variables x1 (two levels) and x2 (4 levels), a nested design where <...
27 views

### Removing variables and getting a worst model

I checked several questions, but I think that my question is very simple comparing with others. I do understand that it is very naive question. I created model 1, after that I eliminated the non-...
212 views

### How to interpret a significant F-statistic but low R-squared?

I have never seen it, but using a dataset of 10k observations, a simple linear regression resulted in a significant F-statistic （over all variables）, but a low R-squared. I interpret it as that the ...
• 1,095
46 views

### $R^2$ vs. significance of the other variables

I am currently working with panel data to see if there is correlation between sustainability and performance in the energy and materials sector of the S&P500. I ran the regression twice, one with ...
41 views

### Is it possible to get an overall measure of variance explained by different levels of a categorical predictor, without using a reference level?

Let's take a model like this: mod <- lm(Petal.Width ~ Species, data = iris) Is there any way to know how much variance is explained by each level of Species ...
• 1,641
219 views

### Best way to perform a key drivers analysis

I am trying to perform a key driver analysis. I have performed a simple OLS regression on my dataset using the statsmodels api on python. It gives me the desired results, but I am not sure if ...
41 views

### I have a VAR model, can I use the R-square values to explain how good the model explains the dependent variable and if yes, how will it be done

I have a VAR model, can I use the R-square values to explain how good the model explains the dependent variable (explanatory power of the model) and if yes, how will the values of the R-square be ...
160 views

### Why do I get a lower R-squared value when I add more variables to my multiple linear regression?

I'm using the Regression Learner tool in MATLAB to do robust linear regression on a set of variables. However, with only one variable I get a higher R-squared value than when I'm adding one or two ...
1 vote
172 views

### Why would my R Squared increase AND my RMSE increase when I add more variables to a model?

I ran a regression with tidymodels following this following along with the random forest example here but using different data. When I ran it with four variables or so, I got an R Squared of 0.94 but ...
1 vote
32 views

### Is there any way to determine VIF of some variable that is included in the dataset that has so many variables?

I am new in statistics and need some help to determine the VIF value on all my variables/features in the dataset with a lot of variables. I have 98 variables with 76 observations and need to find VIF ...
• 11
1 vote
49 views

### do we need to consider the R square of a tree based regression (randomforest), when we use the regression for feature selection

I want select the importance features from 800 features. i plan to use the randomforest regression (XGBoost either). after i build the random forest regression model and then i use the ....
1 vote
I'm quite new to this field and would appreciate your help! As mentioned in this thread, here are the equations for R² and Q²: $R² = 1 - (RSS / TSS)$ where: $RSS = \sum (y-ŷ)²$ where: \$TSS = \sum(y-\...