I have been trying to search for the solution to how to do this, but I'm not exactly sure how to phrase it so excuse the title if it is confusing.
I have a term: $$\sum_{i=1}^n x_iy_i$$ where the sum of the $x_i$ terms is constant. I am trying to find the variance of the term $$\frac{\sum_{i=1}^n x_iy_i}{\sum_{i=1}^n x_i^2}$$ The sum $\sum_{i=1}^n x_i^2$ is also a constant. I know you can take out constants from the variance by squaring them, but I'm not sure if the way I am thinking of doing it is correct. I would like to do the following:
$$Var \bigg (\frac{\sum_{i=1}^n x_iy_i}{\sum_{i=1}^n x_i^2} \bigg ) = \bigg (\frac{\sum_{i=1}^n x_i}{\sum_{i=1}^n x_i^2} \bigg )^2 \times Var \bigg(\sum_{i=1}^n y_i \bigg )$$
If $Y_i$ follows the $N(\beta_0 + \beta_1 X, \sigma^2)$ distribution, is the variance of the sum of $Y_i$s equal to $\frac{\sigma^2}{n}$?
$\newcommand{\v}{\operatorname{var}}$ This is incorrect: $$ \require{cancel}\xcancel{ \v \bigg (\frac{\sum_{i=1}^n x_iy_i}{\sum_{i=1}^n x_i^2} \bigg ) = \bigg (\frac{\sum_{i=1}^n x_i}{\sum_{i=1}^n x_i^2} \bigg )^2 \times \v \bigg(\sum_{i=1}^n y_i \bigg )} $$ In your subject line you used capital $Y$ for the random variables and in the body of your post you used a different notation, lower-case $y.$ One should be consistent in such matters. One advantage of the convention of sometimes using capitals near the end of the alphabet for random variables is to draw attention to what is random and what is constant, and certainly attention to that is needed here. \begin{align} \v \bigg (\frac{\sum_{i=1}^n x_iy_i}{\sum_{i=1}^n x_i^2} \bigg ) & = \left( \frac 1 {\sum_{i=1}^n x_i^2} \right)^2 \v\left( \sum_{i=1}^n x_i y_i \right) \\[10pt] & = \left( \frac 1 {\sum_{i=1}^n x_i^2} \right)^2 \sum_{i=1}^n \v(x_i y_i) \\[10pt] & = \left( \frac 1 {\sum_{i=1}^n x_i^2} \right)^2 \sum_{i=1}^n x_i^2 \v(y_i) \end{align} I have assumed here that $Y_i$ are independent of each other. That is the justification of the "equals" sign on the second line above.
You cannot break $\displaystyle \sum_{i=1}^n x_i^2 \v(y_i)$ into two factors of which one is $\displaystyle \sum_{i=1}^n x_i^2$ unless the factors $\v(y_i),\,i=1,\ldots,n$ are all the same, for a reason that may be seen if you consider the case in which $n=3:$ $$ x_1^2 \v(y_1) + x_2^2 \v(y_2) + x_3^2 \v(y_3) $$
In your case, all three variances are equal to $\sigma^2,$ so you get $$ \sum_{i=1}^n (x_i^2 \sigma^2) = \sigma^2 \sum_{i=1}^n x_i^2, $$ and then the sum of squares of $x_i$ in the numerator cancels one of the sums of squares in the denominator, ultimately yielding $$ \frac{\sigma^2}{\sum_{i=1}^n x_i^2}. $$