clear all;

data = xlsread('cgss05.csv');

income = data(:,1);
edu = data(:,6);
expr = data(:,7);

n = length(income);

Y = log(income);
X = [ones(n,1) edu expr];

[beta,se,pv,S,ssr,R2,R2a] = myols(Y,X);

disp('Estimation Results:');
disp('    Parameter    S.E.     P-value');
disp([beta se pv]);
disp(['R2 = ' num2str(R2)]);
disp(['Adjusted R2 = ' num2str(R2a)]);


