-------------------------------------------------------------------------------
       logC:\AAA Miker Files\newer web pages\soc_388_notes\soc_388_2003\class 3.smcl
  log type:  smcl
 opened on:   1 Oct 2003, 11:32:46
 
 
. set linesize 79
 
. edit
(3 vars, 4 obs pasted into editor)
- preserve
. describe
 
Contains data
  obs:             4                          
 vars:             3                          
 size:            60 (99.9% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
color           str5   %9s                    Color
live            str5   %9s                    
count           byte   %8.0g                  
-------------------------------------------------------------------------------
Sorted by:  
     Note:  dataset has changed since last saved
 
. table live color, contents(sum count) row col
 
-------------------------------
          |        Color       
     live |  Blue  Green  Total
----------+--------------------
    Lilly |    23     10     33
    Water |    27     15     42
          | 
    Total |    50     25     75
-------------------------------


. desmat: poisson count color live
-----------------------------------------------------------------------------------------
   Poisson regression
-----------------------------------------------------------------------------------------
   Dependent variable                                                               count
   Optimization:                                                                       ml
   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
 
 
. poisgof, pearson
 
 
         Goodness-of-fit chi2  =  .2435065
         Prob > chi2(1)        =    0.6217
 
 
. table live color, contents (mean _x_1)
 
 
------------------------
          |    Color    
     live |  Blue  Green
----------+-------------
    Lilly |     0      1
    Water |     0      1
------------------------
 
 
. table live color, contents (mean _x_2)
 
 
------------------------
          |    Color    
     live |  Blue  Green
----------+-------------
    Lilly |     0      0
    Water |     1      1
------------------------
 
 
. *Those above two tables are the dummy variables that desmat creates for the direct effects of color and the direct effects of live.
. desmat: poisson count color*live
-----------------------------------------------------------------------------------------
   Poisson regression
-----------------------------------------------------------------------------------------
   Dependent variable                                                               count
   Optimization:                                                                       ml
   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
 
 
. poisgof
 
 
         Goodness-of-fit chi2  =  7.95e-06
         Prob > chi2(0)        =         .
 
 
. desmat: poisson count color*live, verbose
 
 
Desmat generated the following design matrix:
 
 
nr   Variables       Term                        Parameterization     First    Last
 
 
 1    _x_1           color                       ind(1)
 2    _x_2           live                        ind(1)
 3    _x_3           color.live                  ind(1).ind(1)
 
 
Iteration 0:   log likelihood =  -9.417463  
Iteration 1:   log likelihood = -9.4173319  
Iteration 2:   log likelihood = -9.4173319  
 
 
Poisson regression                                Number of obs   =          4
                                                  LR chi2(3)      =       9.82
                                                  Prob > chi2     =     0.0201
Log likelihood = -9.4173319                       Pseudo R2       =     0.3427
 
 
------------------------------------------------------------------------------
       count |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        _x_1 |  -.8329091   .3787852    -2.20   0.028    -1.575315   -.0905037
        _x_2 |   .1603427   .2837522     0.57   0.572    -.3958014    .7164867
        _x_3 |   .2451225    .497174     0.49   0.622    -.7293206    1.219566
       _cons |   3.135494   .2085144    15.04   0.000     2.726813    3.544175
------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
   Poisson regression
-----------------------------------------------------------------------------------------
   Dependent variable                                                               count
   Optimization:                                                                       ml
   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
 
 
. table live color, contents (mean _x_3)
 
 
------------------------
          |    Color    
     live |  Blue  Green
----------+-------------
    Lilly |     0      0
    Water |     0      1
------------------------
 
 
. help desmat
 
 
. *I'm going to try to use desmat to generate the indicator variables different ly.
. desmat: poisson count color*live=ind(0)*ind(1)
-----------------------------------------------------------------------------------------
   Poisson regression
-----------------------------------------------------------------------------------------
   Dependent variable                                                               count
   Optimization:                                                                       ml
   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(1)*ind(2)
-----------------------------------------------------------------------------------------
   Poisson regression
-----------------------------------------------------------------------------------------
   Dependent variable                                                               count
   Optimization:                                                                       ml
   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.588        0.322
     live
2      Lilly                                                          -0.160        0.284
     color.live
3      Green.Lilly                                                    -0.245        0.497
4    _cons                                                             3.296**      0.192
-----------------------------------------------------------------------------------------
*  p < .05
** p < .01
 
 
. display exp(-.245)
.78270454
 
 
. log close
       logC:\AAA Miker Files\newer web pages\soc_388_notes\soc_388_2003\clas s 3.smcl
  log type:  smcl
 closed on:   1 Oct 2003, 12:22:44
-------------------------------------------------------------------------------