/* ** poisson & negative binomial regression */ library count; #include count.ext; countset; dataset = "c:\lynch\lynch"; lbl = { AYRES, LCOTTON, LYNBLK, LBLK52, BKEVENT, PRPCGNP, LAGLYN, LAGL52, LAGBEVT, year,year2 }; @------------------------------------------------------------------@ @ Regress lynching on lagged lynching and on Ayres Index 1883-1930 @ @------------------------------------------------------------------@ dep1 = { lynblk }; ind1 = { laglyn,ayres }; call ols("lynch",dep1,ind1); _cnstart=2; __rowfac = .2; _mlditer=10; _mlmdmth= "bhhh"; @ poisson regression @ screen off; { b,vc,llik } = poisson("lynch",dep1,ind1); call countprt(b,vc,llik); _cnsval=b|-2; @ negative binomial regression @ { b,vc,llik } = negbin("lynch",dep1,ind1,0); screen on; call countprt(b,vc,llik); @----------------------------------------------------------------------@ @ Regress lynching on lagged lynching and change in real GNP 1883-1930 @ @----------------------------------------------------------------------@ dep1 = { lynblk }; ind1 = { laglyn,prpcgnp }; call ols("lynch",dep1,ind1); _cnstart=2; __rowfac = .2; _mlditer=10; _mlmdmth= "bhhh"; @ poisson regression @ screen off; { b,vc,llik } = poisson("lynch",dep1,ind1); call countprt(b,vc,llik); _cnsval=b|-2; @ negative binomial regression @ { b,vc,llik } = negbin("lynch",dep1,ind1,0); screen on; call countprt(b,vc,llik); @----------------------------------------------------------------------@ @ Regress lynching on lagged lynching and log Cotton prices 1883-1930 @ @----------------------------------------------------------------------@ dep1 = { lynblk }; ind1 = { laglyn,lcotton }; call ols("lynch",dep1,ind1); _cnstart=2; __rowfac = .2; _mlditer=10; _mlmdmth= "bhhh"; @ poisson regression @ screen off; { b,vc,llik } = poisson("lynch",dep1,ind1); call countprt(b,vc,llik); _cnsval=b|-2; @ negative binomial regression @ { b,vc,llik } = negbin("lynch",dep1,ind1,0); screen on; call countprt(b,vc,llik); @----------------------------------------------------------------------@ @ Regress lynching on lagged lynching and log Cotton prices 1883-1930 @ @ and nonlinear trend @ @----------------------------------------------------------------------@ dep1 = { lynblk }; ind1 = { laglyn,lcotton,year,year2 }; call ols("lynch",dep1,ind1); _cnstart=2; __rowfac = .2; _mlditer=10; _mlmdmth= "bhhh"; @ poisson regression @ screen off; { b,vc,llik } = poisson("lynch",dep1,ind1); call countprt(b,vc,llik); _cnsval=b|-2; @ negative binomial regression @ { b,vc,llik } = negbin("lynch",dep1,ind1,0); screen on; call countprt(b,vc,llik); @------------------------------------------------------------------------------@ @ Regress events in deep South on lagged lynching and on Ayres Index 1883-1930 @ @------------------------------------------------------------------------------@ dep1 = { bkevent }; ind1 = { lagbevt,ayres }; call ols("lynch",dep1,ind1); _cnstart=2; __rowfac = .2; _mlditer=10; _mlmdmth= "bhhh"; @ poisson regression @ screen off; { b,vc,llik } = poisson("lynch",dep1,ind1); call countprt(b,vc,llik); _cnsval=b|-2; @ negative binomial regression @ { b,vc,llik } = negbin("lynch",dep1,ind1,0); screen on; call countprt(b,vc,llik); @----------------------------------------------------------------------@ @ Regress events on lagged events and change in real GNP 1883-1930 @ @----------------------------------------------------------------------@ dep1 = { bkevent }; ind1 = { lagbevt,prpcgnp }; call ols("lynch",dep1,ind1); _cnstart=2; __rowfac = .2; _mlditer=10; _mlmdmth= "bhhh"; @ poisson regression @ screen off; { b,vc,llik } = poisson("lynch",dep1,ind1); call countprt(b,vc,llik); _cnsval=b|-2; @ negative binomial regression @ { b,vc,llik } = negbin("lynch",dep1,ind1,0); screen on; call countprt(b,vc,llik); @----------------------------------------------------------------------@ @ Regress events on lagged events and log Cotton prices 1883-1930 @ @----------------------------------------------------------------------@ dep1 = { bkevent }; ind1 = { lagbevt,lcotton }; call ols("lynch",dep1,ind1); _cnstart=2; __rowfac = .2; _mlditer=10; _mlmdmth= "bhhh"; @ poisson regression @ screen off; { b,vc,llik } = poisson("lynch",dep1,ind1); call countprt(b,vc,llik); _cnsval=b|-2; @ negative binomial regression @ { b,vc,llik } = negbin("lynch",dep1,ind1,0); screen on; call countprt(b,vc,llik); @----------------------------------------------------------------------@ @ Regress events on lagged lynching and log Cotton prices 1883-1930 @ @ and nonlinear trend @ @----------------------------------------------------------------------@ dep1 = { bkevent }; ind1 = { lagbevt,lcotton,year,year2 }; call ols("lynch",dep1,ind1); _cnstart=2; __rowfac = .2; _mlditer=10; _mlmdmth= "bhhh"; @ poisson regression @ screen off; { b,vc,llik } = poisson("lynch",dep1,ind1); call countprt(b,vc,llik); _cnsval=b|-2; @ negative binomial regression @ { b,vc,llik } = negbin("lynch",dep1,ind1,0); screen on; call countprt(b,vc,llik);