Estimators and estimates

library(MASS)
nsim <- 1000 #  replicates
betahat <- NULL
for (i in 1:nsim){
  n <- 20
  x <- seq(1:n)  # Fixed x vector
  y <- 2 + 0.4*x + rnorm(n, 0, 1)
  xbar <- mean(x)
  ybar <- mean(y)
  b <- sum((x-xbar)*(y-ybar))/sum((x-xbar)^2)
  a <- ybar - b* xbar
 betahat <- c(betahat, b)
}
truehist(betahat)
Shows an example of the distribution of the estimator $\hat{\beta}$
In OLS regression, note that the values of $a$ and $b$

$$a = \overline{y} - b \overline{x}$$

$$b = \frac{\sum_{i=1}^{n} (x_i - \overline{x}) (y_i - \overline{y})}{\sum_{i=1}^{n} (x_i - \overline{x})^2}$$

are outcomes of random variables e.g. $b$ is the outcome of

$$\hat{\beta} = \frac{\sum_{i=1}^{n} (x_i - \overline{x}) (Y_i - \overline{Y})}{\sum_{i=1}^{n} (x_i - \overline{x})^2}$$

the estimator which has some distribution.
Details
The following R commands can be used to generate a distribution for the estimator $\hat{\beta}$
\begin{lstlisting}
library(MASS)
nsim <- 1000 # replicates
betahat <- NULL
for (i in 1:nsim){
  n <- 20
  x <- seq(1:n) # Fixed x vector
  y <- 2 + 0.4*x + rnorm(n, 0, 1)
  xbar <- mean(x)
  ybar <- mean(y)
  b <- sum((x-xbar)*(y-ybar))/sum((x-xbar)^2)
  a <- ybar - b* xbar
 betahat <- c(betahat, b)
}
truehist(betahat)
\end{lstlisting}