%Open pdf and cdf visualization GUI disttool %Also can call pdfs and cdfs from the command line s=-2:.01:2; %call exp pdf of mean 1 exp1=exppdf(s,1); %plot exp pdf plot(s,exp1); %compare exp1 with exp pdf of mean 2; exp2=exppdf(s,2); hold on; plot(s,exp2); %Run simple regression on wage1 data load('wage1.mat'); %call regressand data y=data(:,1); %call dependent variable data X1=data(:,2); %run fit of degree one polyfit(y,X1,1); %run ttest against null hypothesis h: B(2)=0, obtain pvalue and conf %interval [h,pvalue,ci]=ttest(X1,0); %notice that h=1, i.e we reject null. Compare with h: B(2)=12.5; [h, pvalue, ci]=ttest(X1,12.5); %now notice that h=0. %Condcut analysis of variance to determine if two samples come from same %population X2=[data(1:525,1) data(1:525,2)]; p=anova1(X2); %We obtain p value very close to zero and so we conclude samples do not %come from same population %run a multiple linear regression with wage1 data %include column of ones to compute intercept X3=[ones(size(data,1),1) data(:,2:4)]; [b, bint,r,rint,stats] = regress(y,X3); %show regression stats, i.e Rsquared,F-stat,pvalue, error variance stats;