1 / 5

Consequences of non-constant variance

Consequences of non-constant variance. /* ======================================================================== Consequence of non-constant variance Written by Ming-Yuan Leon Li ========================================================================= */ new; format /m1 /rd 9,3;

vance
Download Presentation

Consequences of non-constant variance

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Consequences of non-constant variance

  2. /* • ======================================================================== • Consequence of non-constant variance • Written by Ming-Yuan Leon Li • ========================================================================= • */ • new; • format /m1 /rd 9,3; • n=10000; @simulation number @ • beta=2; • Beta_OLS=zeros(n,1); • Beta_WLS=zeros(n,1); • x=2*Rndn(20,1); • z=1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20;

  3. i=1; • do until i>n; • @ Data Gerneration Process: Y=beta*X1+u@ • u=Rndn(20,1); u=z.*u; • Y=beta*x+u; • @ OLS @ • Beta_OLS[i,.]=olsqr(Y,x); • @ WLS @ • Y_star=Y./z; X_star=X./Z; • Beta_WLS[i,.]=olsqr(Y_star,X_star)'; • i=i+1; • endo;

  4. print " Mean of OLS beta estimates "; • meanc(Beta_OLS[.,1]); • print " Variance OLS beta estimates "; • stdc(Beta_OLS[.,1])^2; • print " "; • print " Mean of WLS beta estimates "; • meanc(Beta_WLS[.,1]); • print " Variance WLS beta estimates "; • stdc(Beta_WLS[.,1])^2;

More Related