Uploaded February 2014 | Updated November 2026, 4 days ago
This video provides a derivation of the model-implied variance-covariance matrix of indicator variables, when the matrix notation form for factor analysis models is used. Check out ben-lambert.com/econometrics-course-problem-sets-and-data for course materials, and information regarding updates on each of the courses. Quite excitingly (for me at least), I am about to publish a whole series of new videos on Bayesian statistics on youtube. See here for information: ben-lambert.com/bayesian Accompanying this series, there will be a book: amazon.co.uk/gp/product/1473916364/ref=pe_3140701_247401851_em_1p_0_ti
This video provides a derivation of the model-implied variance-covariance matrix of indicator variables, when the matrix notation form for factor analysis models is used. Check out ben-lambert.com/econometrics-course-problem-sets-and-data for course materials, and information regarding updates on each of the courses. Quite excitingly (for me at least), I am about to publish a whole series of new videos on Bayesian statistics on youtube. See here for information: ben-lambert.com/bayesian Accompanying this series, there will be a book: amazon.co.uk/gp/product/1473916364/ref=pe_3140701_247401851_em_1p_0_ti










![Monte Carlo Simulation of Omitted Variable Bias in Least Squares
This video provides an example of how Monte Carlo Simulation can be used to demonstrate the bias and inconsistency of Ordinary Least Squares in the presence of an omitted variable.
clear; close all; clc;
%Define the population parameters
alpha=1;
beta1=1;
beta2=1;
% Sample size n
n=10000;
% Number of samples m
m=1000;
% Store the estimated beta in a vector
beta_hat=zeros(m,1);
for i=1:m
%Generate independent variables randomly
x1=4*randn(n,1);
x2=0.25*x1+randn(n,1);
%Generate errors in the population
e=randn(n,1);
%Generate the dependent variable
y=alpha+beta1*x1+beta2*x2+e;
%Generate the LS estimates of alpha and beta using matrix formulation
X=[ones(n,1) x1];
beta_hatvec=(inv((X*X)))*X*y;
% Pull out only the second component - the estimate of beta
beta_hat(i)=beta_hatvec(2);
end
zoom=0.8;
% Draw a histogram of the result
FigHandle = figure(Position, [750, 300, 1049*zoom, 895*zoom]);
hist(beta_hat,20)
xlabel(Beta hat)
ylabel(Frequency)
xlim([0.5,1.5]) Check out https://ben-lambert.com/econometrics-course-problem-sets-and-data/ for course materials, and information regarding updates on each of the courses. Quite excitingly (for me at least), I am about to publish a whole series of new videos on Bayesian statistics on youtube. See here for information: https://ben-lambert.com/bayesian/ Accompanying this series, there will be a book: https://www.amazon.co.uk/gp/product/1473916364/ref=pe_3140701_247401851_em_1p_0_ti Monte Carlo Simulation of Omitted Variable Bias in Least Squares](https://i.ytimg.com/vi/BmQvpLiM1ks/mqdefault.jpg)