Contents
How to calculate the sampling distribution of the OLS estimator?
The interactive simulation below continuously generates random samples (Xi,Y i) ( X i, Y i) of 200 200 observations where E(Y |X) = 100+3X E ( Y | X) = 100 + 3 X, estimates a simple regression model, stores the estimate of the slope β1 β 1 and visualizes the distribution of the ˆβ1 β ^ 1 s observed so far using a histogram.
How does the variance of the OLS estimator decrease?
Furthermore, (4.1) reveals that the variance of the OLS estimator for β1 β 1 decreases as the variance of the Xi X i increases.
How to calculate the sampling distribution with R?
To do this we need values for the independent variable X X, for the error term u u, and for the parameters β0 β 0 and β1 β 1. With these combined in a simple regression model, we compute the dependent variable Y Y.
Which is a good approximation of the sampling distribution of the estimator?
The idea here is that for a large number of ˆβ1 β ^ 1 s, the histogram gives a good approximation of the sampling distribution of the estimator. By decreasing the time between two sampling iterations, it becomes clear that the shape of the histogram approaches the characteristic bell shape of a normal distribution centered at the true slope of 3 3.
What is the matrix fit for OLS estimator?
Thus fit has to be a matrix of dimensions reps×2 × 2. In the next step we draw reps random samples of size n from the population and obtain the OLS estimates for each sample. The results are stored as row entries in the outcome matrix fit.
How to calculate the sampling distribution of the sample?
First, let us calculate the true variances σ2 ^β0 σ β ^ 0 2 and σ2 ^β1 σ β ^ 1 2 for a randomly drawn sample of size n =100 n = 100. Now let us assume that we do not know the true values of β0 β 0 and β1 β 1 and that it is not possible to observe the whole population. However, we can observe a random sample of n n observations.