Also how would I go about doing the same modeling for the genexp, protfault, and disclos variables?
-
Login or Register
- Log in with
collapse (count) n_lawsuits = payment2 (first) apology, by(workstat2 pre_post)
collapse (count) n_lawsuits = payment2 (first) apology genexp protfault disclos, by(workstat2 pre_post)
. xtset workstat2 panel variable: workstat2 (unbalanced) . xtpoisson n_lawsuits i.apology##i.pre_post, fe vce(robust) Iteration 0: log pseudolikelihood = -1548.224 Iteration 1: log pseudolikelihood = -319.24879 Iteration 2: log pseudolikelihood = -319.02494 Iteration 3: log pseudolikelihood = -319.02494 Conditional fixed-effects Poisson regression Number of obs = 88 Group variable: workstat2 Number of groups = 44 Obs per group: min = 2 avg = 2.0 max = 2 Wald chi2(2) = 352.79 Log pseudolikelihood = -319.02494 Prob > chi2 = 0.0000 (Std. Err. adjusted for clustering on workstat2) ---------------------------------------------------------------------------------- | Robust n_lawsuits | Coef. Std. Err. z P>|z| [95% Conf. Interval] -----------------+---------------------------------------------------------------- 1.apology | 0 (omitted) 1.pre_post | -.4459613 .0297531 -14.99 0.000 -.5042763 -.3876463 | apology#pre_post | 1 1 | .0684329 .044695 1.53 0.126 -.0191677 .1560336 ---------------------------------------------------------------------------------- . margins apology#pre_post, predict(nu0) noestimcheck Adjusted predictions Number of obs = 88 Model VCE : Robust Expression : Predicted number of events (assuming u_i=0), predict(nu0) ---------------------------------------------------------------------------------- | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -----------------+---------------------------------------------------------------- apology#pre_post | 0 0 | 1 . . . . . 0 1 | .6402085 .0190482 33.61 0.000 .6028748 .6775423 1 0 | 1 . . . . . 1 1 | .6855537 .022865 29.98 0.000 .6407391 .7303684 ---------------------------------------------------------------------------------- . . margins apology, dydx(pre_post) predict(nu0) noestimcheck Conditional marginal effects Number of obs = 88 Model VCE : Robust Expression : Predicted number of events (assuming u_i=0), predict(nu0) dy/dx w.r.t. : 1.pre_post ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.pre_post | apology | 0 | -.3597915 .0190482 -18.89 0.000 -.3971252 -.3224577 1 | -.3144463 .022865 -13.75 0.000 -.3592609 -.2696316 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level. . xtpoisson n_lawsuits i.genexp##i.pre_post, fe vce(robust) Iteration 0: log pseudolikelihood = -1548.224 Iteration 1: log pseudolikelihood = -308.50506 Iteration 2: log pseudolikelihood = -308.26194 Iteration 3: log pseudolikelihood = -308.26194 Conditional fixed-effects Poisson regression Number of obs = 88 Group variable: workstat2 Number of groups = 44 Obs per group: min = 2 avg = 2.0 max = 2 Wald chi2(3) = 345.15 Log pseudolikelihood = -308.26194 Prob > chi2 = 0.0000 (Std. Err. adjusted for clustering on workstat2) --------------------------------------------------------------------------------- | Robust n_lawsuits | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- genexp | 1 | 0 (omitted) 2 | 0 (omitted) | 1.pre_post | -.4420631 .0310951 -14.22 0.000 -.5030085 -.3811178 | genexp#pre_post | 1 1 | .0242712 .0502038 0.48 0.629 -.0741263 .1226688 2 1 | .1231934 .0654282 1.88 0.060 -.0050435 .2514303 --------------------------------------------------------------------------------- . margins genexp, dydx(pre_post) predict(nu0) noestimcheck Conditional marginal effects Number of obs = 88 Model VCE : Robust Expression : Predicted number of events (assuming u_i=0), predict(nu0) dy/dx w.r.t. : 1.pre_post ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.pre_post | genexp | 0 | -.3572909 .0199851 -17.88 0.000 -.3964611 -.3181208 1 | -.3415008 .0259545 -13.16 0.000 -.3923706 -.2906309 2 | -.2730297 .0418494 -6.52 0.000 -.355053 -.1910065 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level. . margins genexp#pre_post, predict(nu0) noestimcheck Adjusted predictions Number of obs = 88 Model VCE : Robust Expression : Predicted number of events (assuming u_i=0), predict(nu0) --------------------------------------------------------------------------------- | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- genexp#pre_post | 0 0 | 1 . . . . . 0 1 | .6427091 .0199851 32.16 0.000 .6035389 .6818792 1 0 | 1 . . . . . 1 1 | .6584992 .0259545 25.37 0.000 .6076294 .7093691 2 0 | 1 . . . . . 2 1 | .7269703 .0418494 17.37 0.000 .644947 .8089935 ---------------------------------------------------------------------------------
xtreg payment2 i.apology##i.pre_post, fe vce(cluster workstat2)
margins disclos#pre_post, noestimcheck
margins disclos, dydx(pre_post) noestimcheck
. xtreg payment2 i.genexp##i.pre_post, fe vce(cluster workstat2) note: 1.genexp omitted because of collinearity note: 2.genexp omitted because of collinearity Fixed-effects (within) regression Number of obs = 62,701 Group variable: workstat2 Number of groups = 44 R-sq: Obs per group: within = 0.0007 min = 75 between = 0.0594 avg = 1,425.0 overall = 0.0053 max = 9,653 F(3,43) = 1.26 corr(u_i, Xb) = 0.2796 Prob > F = 0.2989 (Std. Err. adjusted for 44 clusters in workstat2) --------------------------------------------------------------------------------- | Robust payment2 | Coef. Std. Err. t P>|t| [95% Conf. Interval] ----------------+---------------------------------------------------------------- genexp | 1 | 0 (omitted) 2 | 0 (omitted) | 1.pre_post | -4541.811 12249.42 -0.37 0.713 -29245.12 20161.5 | genexp#pre_post | 1 1 | -41235.08 28872.65 -1.43 0.160 -99462.34 16992.17 2 1 | -4663.423 17158.73 -0.27 0.787 -39267.31 29940.46 | _cons | 317271.1 4899.144 64.76 0.000 307391.1 327151.2 ----------------+---------------------------------------------------------------- sigma_u | 89418.111 sigma_e | 585450.14 rho | .02279588 (fraction of variance due to u_i) --------------------------------------------------------------------------------- . . margins genexp#pre_post, noestimcheck Adjusted predictions Number of obs = 62,701 Model VCE : Robust Expression : Linear prediction, predict() --------------------------------------------------------------------------------- | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- genexp#pre_post | 0 0 | 317271.1 4899.144 64.76 0.000 307669 326873.3 0 1 | 312729.3 11766.09 26.58 0.000 289668.2 335790.4 1 0 | 317271.1 4899.144 64.76 0.000 307669 326873.3 1 1 | 271494.2 21752.82 12.48 0.000 228859.5 314129 2 0 | 317271.1 4899.144 64.76 0.000 307669 326873.3 2 1 | 308065.9 11669.46 26.40 0.000 285194.2 330937.6 --------------------------------------------------------------------------------- . . margins genexp, dydx(pre_post) noestimcheck Conditional marginal effects Number of obs = 62,701 Model VCE : Robust Expression : Linear prediction, predict() dy/dx w.r.t. : 1.pre_post ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.pre_post | genexp | 0 | -4541.811 12249.42 -0.37 0.711 -28550.23 19466.61 1 | -45776.89 26145.4 -1.75 0.080 -97020.93 5467.141 2 | -9205.234 12015.57 -0.77 0.444 -32755.32 14344.85 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level.
. xtpoisson n_lawsuits i.genexp##i.pre_post, fe vce(robust) Iteration 0: log pseudolikelihood = -1548.224 Iteration 1: log pseudolikelihood = -308.50506 Iteration 2: log pseudolikelihood = -308.26194 Iteration 3: log pseudolikelihood = -308.26194 Conditional fixed-effects Poisson regression Number of obs = 88 Group variable: workstat2 Number of groups = 44 Obs per group: min = 2 avg = 2.0 max = 2 Wald chi2(3) = 345.15 Log pseudolikelihood = -308.26194 Prob > chi2 = 0.0000 (Std. Err. adjusted for clustering on workstat2) --------------------------------------------------------------------------------- | Robust n_lawsuits | Coef. Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- genexp | 1 | 0 (omitted) 2 | 0 (omitted) | 1.pre_post | -.4420631 .0310951 -14.22 0.000 -.5030085 -.3811178 | genexp#pre_post | 1 1 | .0242712 .0502038 0.48 0.629 -.0741263 .1226688 2 1 | .1231934 .0654282 1.88 0.060 -.0050435 .2514303 --------------------------------------------------------------------------------- . . margins genexp#pre_post, predict(nu0) noestimcheck Adjusted predictions Number of obs = 88 Model VCE : Robust Expression : Predicted number of events (assuming u_i=0), predict(nu0) --------------------------------------------------------------------------------- | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- genexp#pre_post | 0 0 | 1 . . . . . 0 1 | .6427091 .0199851 32.16 0.000 .6035389 .6818792 1 0 | 1 . . . . . 1 1 | .6584992 .0259545 25.37 0.000 .6076294 .7093691 2 0 | 1 . . . . . 2 1 | .7269703 .0418494 17.37 0.000 .644947 .8089935 --------------------------------------------------------------------------------- . . margins genexp, dydx(pre_post) predict(nu0) noestimcheck Conditional marginal effects Number of obs = 88 Model VCE : Robust Expression : Predicted number of events (assuming u_i=0), predict(nu0) dy/dx w.r.t. : 1.pre_post ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.pre_post | genexp | 0 | -.3572909 .0199851 -17.88 0.000 -.3964611 -.3181208 1 | -.3415008 .0259545 -13.16 0.000 -.3923706 -.2906309 2 | -.2730297 .0418494 -6.52 0.000 -.355053 -.1910065 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level.
margins genexp, dydx(pre_post) predict(nu0) noestimcheck pwcompare
. margins genexp, dydx(pre_post) predict(nu0) noestimcheck pwcompare Pairwise comparisons of conditional marginal effects Model VCE : Robust Expression : Predicted number of events (assuming u_i=0), predict(nu0) dy/dx w.r.t. : 1.pre_post -------------------------------------------------------------- | Contrast Delta-method Unadjusted | dy/dx Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ 1.pre_post | genexp | 1 vs 0 | .0157902 .0327573 -.0484129 .0799933 2 vs 0 | .0842612 .0463765 -.006635 .1751574 2 vs 1 | .068471 .0492443 -.0280461 .1649882 -------------------------------------------------------------- Note: dy/dx for factor levels is the discrete change from the base level.
assert ((apology == 0) == (regexp == 0)) & ((regexp == 0) == (protfault == 0) ) if pre_post == 0
assert ((apology == 0) == (genexp == 0)) & ((disclos == 0) == (protfault == 0) ) if pre_post == 0
margins genexp, dydx(pre_post) noestimcheck Conditional marginal effects Number of obs = 62,701 Model VCE : Robust Expression : Linear prediction, predict() dy/dx w.r.t. : 1.pre_post ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.pre_post | genexp | 0 | -5196.25 11769.18 -0.44 0.659 -28263.43 17870.92 1 | -46028.91 26614.4 -1.73 0.084 -98192.17 6134.352 2 | -9205.234 12015.57 -0.77 0.444 -32755.32 14344.85 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level. . margins disclos, dydx(pre_post) noestimcheck Conditional marginal effects Number of obs = 62,701 Model VCE : Robust Expression : Linear prediction, predict() dy/dx w.r.t. : 1.pre_post ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.pre_post | disclos | 0 | -5196.25 11769.18 -0.44 0.659 -28263.43 17870.92 1 | -45733.4 27644.15 -1.65 0.098 -99914.94 8448.149 2 | -11750.78 11488.22 -1.02 0.306 -34267.28 10765.71 ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level.
Comment