? Part 1. Descriptive statistics SAMPLE ; all $ DSTAT ; rhs = * $ CREATE ; loginc=log(income)$ CALC ; xbar=xbr(loginc);sdv=sdv(loginc)$ CREATE ; normal=rnn(xbar,sdv)$ KERNEL ; rhs=loginc,normal$ NAMELIST ; demogrfc = age, female, married $ NAMELIST ; years = year1984,year1985,year1986,year1987,year1988,year1991 $ Part 2. Basic linear regression REGRESS ; lhs = income ; rhs = one, demogrfc, years $ CALC ; rsq0 = rsqrd $ REGRESS ; lhs = income ; rhs = one, demogrfc, years, educ $ CALC ; rsq1 = rsqrd $ CALC ; list ; fstat = ((rsq1 - rsq0)/1) / ((1-rsq1)/(n-kreg)) $ Part 3. Least absolute deviations SAMPLE ; 1 - 100 $ (use the first 100 observations) REGRESS ; lhs = income ; rhs = one,demogrfc $ REGRESS ; lhs = income ; rhs = one,demogrfc ; alg=LAD ; nbt=25 $ REGRESS ; lhs = income ; rhs = one,demogrfc ; alg=LAD ; nbt=25 $ CALC ; ran (12345) $ (use a 5 digit odd number) REGRESS ; lhs = income ; rhs = one,demogrfc ; alg=LAD ; nbt=25 $ CALC ; ran (12345) $ (use a 5 digit odd number)= REGRESS ; lhs = income ; rhs = one,demogrfc ; alg=LAD ; nbt=25 $ Part 4. A cluster corrected variance matrix SAMPLE ;all $ REGRESS ; lhs = income ; rhs = one,demogrfc,years; test:demogrfc$ REGRESS ; lhs = income ; rhs = one,demogrfc,years ; cluster=id $ Part 5. Wald test of a hypothesis SAMPLE ; all $ REGRESS ; lhs = income ; rhs = one,demogrfc,years ;cluster=id ; test: years = 0 $ REGRESS ; lhs = income ; rhs = one,demogrfc,years ; cluster=id$ MATRIX ; by=b(5:10) ; vy=varb(5:10,5:10) $ MATRIX ; list ; wld = by'by $ REGRESS ; lhs = income ; rhs = one,demogrfc,years; cluster=id ; test:demogrfc$ Part 6. Partial effects and simulation REGRESS ; Lhs = loginc ; rhs = one,age, educ, female, age*educ, age^2, age*female, educ*female $ PARTIAL ; effects: age | educ = 12,14,16,18,20 $ PARTIAL ; effects: educ & age = 25(3)64 ; plot(ci) $ PARTIAL ; effects: female | educ = 12,16,20 & age = 25(5)64 ; plot $ SIMULATE; scenario: female | educ = 12,16,20 & age = 25(5)64 ; plot $ Part 7. Normality tests REGRESS ; Lhs = loginc ; Rhs = one,demogrfc,years ; Res=e ; quietly $ CREATE ; v2 = e^2 ; v3 = v2*e ; v4 = v3*e $ CALC ; sv = sqr (xbr (v2)) ; m3 = xbr(v3) ; m4 = xbr (v4) $ CALC ; List ; Chisq = N *( ( m3/sv^3)^2 / 6 + ((m4/sv^4) - 3)^2 /24 ) $ CALC ; List ; kst(e)$ KERNEL ; Rhs = e ; normal $ Part 8. Panel Data Regressions SAMPLE ; all $ SETPANEL ; group = id ; pds = ti $ REGRESS ; Lhs = income ; Rhs = one,age,educ,female,female*age ; panel ; Fixed effects $ REGRESS ; Lhs = income ; Rhs = one,age,educ,female,female*age ; panel ; Random effects $ Part 9. More panel data analysis NAMELIST ; x=one,age,educ,hsat$ CREATE ; ageb = group mean(age, pds=ti)$ CREATE ; educb = group mean(educ,pds=ti)$ CREATE ; hsatb = group mean(hsat,pds=ti)$ REGR ; lhs = income ; rhs = age,educ,hsat ; Panel ; fixed effects $ REGR ; lhs = income ; rhs = age,educ,hsat,ageb,educb,hsatb $ Part 10. A random parameter model REGRESS ; Lhs = income ; Rhs = one,age,educ,hsat,working ; Panel ; RPM=female ; Pts=10 ; Halton ; Fcn = educ(n) ; Parameters $ CREATE ; b_educ = beta_i(_stratum)$ CREATE ; t=prd(id)$ KERNEL ; if[t=1] ; rhs=b_educ ; group=female$