bancanfei 发表于 2014-11-18 11:17
理解是这么理解,能否举个例子
Here is an example--
There are three categorical variables in the data set.
list
race gender belief count
1. 1 1 1 371
2. 1 1 2 49
3. 1 1 3 74
4. 1 0 1 250
5. 1 0 2 45
6. 1 0 3 71
7. 0 1 1 64
8. 0 1 2 9
9. 0 1 3 15
10. 0 0 1 25
11. 0 0 2 5
12. 0 0 3 13
To generate a saturated model, we can simply do the following. The three predictors grouped with "*" indicate that we want all the main effects, 2-way interactions and the 3-way interaction.
desmat: poisson count race*gender*belief
-------------------------------------------------------------------------------
poisson
-------------------------------------------------------------------------------
Dependent variable count
Number of observations: 12
Initial log likelihood: -665.927
Log likelihood: -33.156
LR chi square: 1265.541
Model degrees of freedom: 11
Pseudo R-squared: 0.950
Prob: 0.000
-------------------------------------------------------------------------------
nr Effect Coeff s.e.
-------------------------------------------------------------------------------
count
race
1 1 2.303** 0.210
gender
2 1 0.940** 0.236
race.gender
3 1.1 -0.545* 0.250
belief
4 2 -1.609** 0.490
5 3 -0.654 0.342
race.belief
6 1.2 -0.105 0.516
7 1.3 -0.605 0.367
gender.belief
8 1.2 -0.352 0.606
9 1.3 -0.797 0.446
race.gender.belief
10 1.1.2 0.043 0.645
11 1.1.3 0.444 0.483
12 _cons 3.219** 0.200
-------------------------------------------------------------------------------
* p < .05
** p < .01