<p>OLS considers all values. The method doesn't care if some samples have the same X value as long as not all of them do.</p>

<p>In many cases there is no controversy in having multiple samples with the same Xi but different Yi.</p>

<p>For example, if you plot company turnover (Y) versus number of employees (X) for a sample of companies there can be companies that happen to have the exact same number of employees.</p>

CC BY-SA 4.0
2018-05-17T11:10:30.220Z
2018-05-17T11:10:30.220Z
Klas Lindbäck
<p>It is not very clear what you're asking, but if the model is of the form</p>

<p>$$
y_i = \beta_0 + \beta_1 x_i + \epsilon_i \tag{1}
$$</p>

<p>Then the sample regression function (SRF)</p>

<p>$$
\hat{y}_i = \beta_0 + \beta_1 x_i \tag{2}
$$</p>

<p>indeed only considers one value of $x_i$ at the time. If you have a situation in which several observations $y$ are associated with the same value $x_i$, then a linear model is perhaps not appropriate for describing your data</p>

CC BY-SA 3.0
2018-02-18T20:02:14.617Z
Then according to you ,if there are more than one values of Yi at a given Xi, then OLS can't be used to find SRF?
akshit arora
CC BY-SA 3.0
2018-02-18T20:05:39.893Z
@akshitarora That's not what I said. Eqn (2) an still be used to find the prediction $\hat{y}_i$. What I said is that if you have a bunch of values of possible $y$s for a given $x$ then perhaps a linear model with a single feature is not the best model for your system
caverac
CC BY-SA 3.0
2018-02-17T12:31:26.283Z
2018-02-17T12:31:26.283Z
caverac
<p>Suppose you use OLS to estimate the model:</p>

<p>$$Y_i = \beta_1 + \beta_2X_i + \varepsilon_i$$</p>

<p>Note that what $i$ indexes is not values of $X$ but units (eg individuals, countries) within the population of interest.</p>

<p>Given sample data for units $i=1,...,N$, OLS will find the values of $\beta_1$ and $\beta_2$ that minimize $\Sigma(Y_i - \beta_1 - \beta_2X_i)^2$.  It does not matter at all if some of the $X_i$'s have the same value.  The sum to be minimised is calculated over all the sample units.</p>

CC BY-SA 4.0
2018-06-16T12:25:11.903Z
2018-06-16T12:25:11.903Z
Adam Bailey
<p>Does the OLS (ordinary least squares) method of regression consider only one sample value in calculating the sample regression function (SRF)? If not, then how is the SRF created when there is more than one observation per $X_{i}$?</p>

CC BY-SA 3.0
2018-02-17T12:52:50.197Z
Then according to you , if there are more than one values of Yi at a given Xi, then OLS can't be used to find SRF
akshit arora
CC BY-SA 3.0
2018-04-17T02:11:15.737Z
I am not sure what does SRF mean in this context. Can you clarify?
Tom
CC BY-SA 3.0
2018-04-17T02:59:22.690Z
Can you provide a little more context?
Dave Harris
CC BY-SA 3.0
2018-04-17T03:45:00.433Z
My question is supposed a table of data is given in which for each x there are more than y , then how to regess y on x
akshit arora
CC BY-SA 3.0
2018-04-17T05:19:18.470Z
Are the multiple y's due to ties or is it multi-valued?  For example, do you have two men who are the same height, but with different weight?  Or do you believe it is a relation and not a function as in $y=\pm\sqrt{x}$?  If it is the former, then the ties do not matter.  If it is the latter then you cannot use regression at all.
Dave Harris
CC BY-SA 4.0
2018-06-17T09:01:32.113Z
If every question on the site that was somehow related to linear regression was titled "Linear rgression" then it would be impossible to find anything here.
Ubiquitous
<econometrics><regression>
Sample used in calculating the sample regression function
akshit arora
# Sample used in calculating the sample regression function

(Asked by: username_0 on 2018-02-17)

Does the OLS (ordinary least squares) method of regression consider only one sample value in calculating the sample regression function (SRF)? If not, then how is the SRF created when there is more than one observation per $X\_{i}$?

**Tags:** econometrics, regression
> **Comments:**
> **username_0**: Then according to you , if there are more than one values of Yi at a given Xi, then OLS can't be used to find SRF  
> **username_1**: I am not sure what does SRF mean in this context. Can you clarify?  
> **username_2**: Can you provide a little more context?  
> **username_0**: My question is supposed a table of data is given in which for each x there are more than y , then how to regess y on x  
> **username_2**: Are the multiple y's due to ties or is it multi-valued?  For example, do you have two men who are the same height, but with different weight?  Or do you believe it is a relation and not a function as in $y=\pm\sqrt{x}$?  If it is the former, then the ties do not matter.  If it is the latter then you cannot use regression at all.  
> **username_3**: If every question on the site that was somehow related to linear regression was titled "Linear rgression" then it would be impossible to find anything here.  

---

## 3 answers

### Answer by username_4 on 2018-05-17. Score: 1

OLS considers all values. The method doesn't care if some samples have the same X value as long as not all of them do.

In many cases there is no controversy in having multiple samples with the same Xi but different Yi.

For example, if you plot company turnover (Y) versus number of employees (X) for a sample of companies there can be companies that happen to have the exact same number of employees.


---

### Answer by username_5 on 2018-02-17. Score: 1

It is not very clear what you're asking, but if the model is of the form

$$
y\_i = \beta\_0 + \beta\_1 x\_i + \epsilon\_i \tag{1}
$$

Then the sample regression function (SRF)

$$
\hat{y}\_i = \beta\_0 + \beta\_1 x\_i \tag{2}
$$

indeed only considers one value of $x\_i$ at the time. If you have a situation in which several observations $y$ are associated with the same value $x\_i$, then a linear model is perhaps not appropriate for describing your data

> **Comments:**
> **username_0**: Then according to you ,if there are more than one values of Yi at a given Xi, then OLS can't be used to find SRF?  
> **username_5**: @akshitarora That's not what I said. Eqn (2) an still be used to find the prediction $\hat{y}_i$. What I said is that if you have a bunch of values of possible $y$s for a given $x$ then perhaps a linear model with a single feature is not the best model for your system  

---

### Answer by username_6 on 2018-06-16. Score: 1

Suppose you use OLS to estimate the model:

$$Y\_i = \beta\_1 + \beta\_2X\_i + \varepsilon\_i$$

Note that what $i$ indexes is not values of $X$ but units (eg individuals, countries) within the population of interest.

Given sample data for units $i=1,...,N$, OLS will find the values of $\beta\_1$ and $\beta\_2$ that minimize $\Sigma(Y\_i - \beta\_1 - \beta\_2X\_i)^2$. It does not matter at all if some of the $X\_i$'s have the same value. The sum to be minimised is calculated over all the sample units.


---

