OLS regression for bootstrapped data
2 views (last 30 days)
Hi, I bootstrapped some data 1000 times and now I want to regress each one of the columns of that bootstrapped data (A) on two vectors. This is: Y= each column in A; X=two vectors, but the "regress" command is not working. Any suggestion? All the data has the same number of rows. Thanks!
jgg on 22 Apr 2016
To answer your question based on my comment. The command Y = A(:,i) selects the i-th column from the A matrix, so this will give you your 1000 results. For instance,
X = randn(5000,2); %fake data; use real data
A = randn(5000,1000); %fake data;
betas = zeros(1000,2);
for i = 1:1000
Y = A(:,i);
betas(i,:) = regress(Y,X);
Your estimates are stored in the betas matrix so you can average or consider standard deviation etc.