------------------------------------------------------------------------------- log: :acomp hd (2001-02):save stuff here (temporary):class 3.log log type: text opened on: 2 Oct 2002, 14:07:54 . use ":AComp HD (2001-02):Desktop Folder:frog.dta" . *In order to understand the dummy variables, you can table them . table color live, contents (sum _x_1) ------------------------------ | live Color | lillypad water ----------+------------------- blue | 0 0 green | 1 1 ------------------------------ . sysdir set STBPLUS ":AComp HD (2001-02):Applications:Stata (optional):Stata:a > do:stbplus:" . desmat: poisson count color*live ------------------------------------------------------------------------------- poisson ------------------------------------------------------------------------------- Dependent variable count Number of observations: 4 Initial log likelihood: -14.328 Log likelihood: -9.417 LR chi square: 9.822 Model degrees of freedom: 3 Pseudo R-squared: 0.343 Prob: 0.020 ------------------------------------------------------------------------------- nr Effect Coeff s.e. ------------------------------------------------------------------------------- count color 1 green -0.833* 0.379 live 2 water 0.160 0.284 color.live 3 green.water 0.245 0.497 4 _cons 3.135** 0.209 ------------------------------------------------------------------------------- * p < .05 ** p < .01 . desmat: poisson count color*live=ind(2)*ind(2) ------------------------------------------------------------------------------- poisson ------------------------------------------------------------------------------- Dependent variable count Number of observations: 4 Initial log likelihood: -14.328 Log likelihood: -9.417 LR chi square: 9.822 Model degrees of freedom: 3 Pseudo R-squared: 0.343 Prob: 0.020 ------------------------------------------------------------------------------- nr Effect Coeff s.e. ------------------------------------------------------------------------------- count color 1 blue 0.588 0.322 live 2 lillypad -0.405 0.408 color.live 3 blue.lillypad 0.245 0.497 4 _cons 2.708** 0.258 ------------------------------------------------------------------------------- * p < .05 ** p < .01 . *So here we're using desmat to pick which categories are going to be the excl > uded, or comparison category . desmat: poisson count color*live=ind(2)*ind(1) ------------------------------------------------------------------------------- poisson ------------------------------------------------------------------------------- Dependent variable count Number of observations: 4 Initial log likelihood: -14.328 Log likelihood: -9.417 LR chi square: 9.822 Model degrees of freedom: 3 Pseudo R-squared: 0.343 Prob: 0.020 ------------------------------------------------------------------------------- nr Effect Coeff s.e. ------------------------------------------------------------------------------- count color 1 blue 0.833* 0.379 live 2 water 0.405 0.408 color.live 3 blue.water -0.245 0.497 4 _cons 2.303** 0.316 ------------------------------------------------------------------------------- * p < .05 ** p < .01 . *There are 4 different possible combinations of color and live, and they all > have exactly the same value (except for sign), and exactly the same standard > error, and the models are exactly the same regardless . *I just wanted to show that the same interaction can be achieved with differe > nt dummy variable configurations . . . desmat: poisson count color live ------------------------------------------------------------------------------- poisson ------------------------------------------------------------------------------- Dependent variable count Number of observations: 4 Initial log likelihood: -14.328 Log likelihood: -9.540 LR chi square: 9.578 Model degrees of freedom: 2 Pseudo R-squared: 0.334 Prob: 0.008 ------------------------------------------------------------------------------- nr Effect Coeff s.e. ------------------------------------------------------------------------------- count color 1 green -0.693** 0.245 live 2 water 0.241 0.233 3 _cons 3.091** 0.192 ------------------------------------------------------------------------------- * p < .05 ** p < .01 . poisgof Goodness-of-fit chi2 = .2445188 Prob > chi2(1) = 0.6210 . desmat: poisson count color=ind(2) live=ind(2) ------------------------------------------------------------------------------- poisson ------------------------------------------------------------------------------- Dependent variable count Number of observations: 4 Initial log likelihood: -14.328 Log likelihood: -9.540 LR chi square: 9.578 Model degrees of freedom: 2 Pseudo R-squared: 0.334 Prob: 0.008 ------------------------------------------------------------------------------- nr Effect Coeff s.e. ------------------------------------------------------------------------------- count color 1 blue 0.693** 0.245 live 2 lillypad -0.241 0.233 3 _cons 2.639** 0.225 ------------------------------------------------------------------------------- * p < .05 ** p < .01 . poisgof Goodness-of-fit chi2 = .2445188 Prob > chi2(1) = 0.6210 . *thus ends class 3 log . exit, clear