Using OLS Regression with Repeated Independent Variable Values
Summary
The document considers a small dataset in which multiple observed outcomes share each independent-variable value. The accepted response says ordinary least squares can be applied directly to the individual observations, rather than requiring a different regression method solely because the x values repeat. It reports a fitted linear relationship and its coefficient of determination as an example of the result.
The answer also points to aggregation of outcomes with the same x value as a related topic, but does not explain when aggregation is appropriate or how it affects estimates and uncertainty. The dataset is small, and the response provides no diagnostics, assumptions checks, uncertainty estimates, or comparison with alternative models. It is therefore a brief illustration of regression setup rather than a complete modeling guide.
Key ideas
- Repeated values of the independent variable do not by themselves rule out ordinary least squares.
- The example fits a straight-line model to all listed observations.
- Grouping outcomes by their shared x value is a separate modeling consideration.
- The response gives no residual diagnostics or uncertainty analysis.
Tags
Full text
# Appropriate regression when multiple dependent values for same independent value
# Appropriate regression when multiple dependent values for same independent value
I have a data set which looks as following:
```
Y
1 2
1 1.5
1 2.5
2 5
2 3
3 5.2
3 6
3 6.8
4 6
4 7
```
And the corresponding plot is:
What kind of regression is appropriate for the above kind of data ?
## Answer by Kevin (score 1)
https://quant.stackexchange.com/a/53632
As noob2 suggested, you run a simple OLS regression (in Excel). You get the estimation result $$\hat{y}_i=0.63+1.61x_i$$ with an $R^2=0.84$. That seems to do the job!
You may want to read this about aggregating the $y_i$ values for the same $x_i$ observation.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.