Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: ice and random-number seed


From   "Medina, Tait Runnfeldt" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: ice and random-number seed
Date   Thu, 21 Aug 2008 22:43:10 -0400

I am unable to reproduce regression results using imputed data generated via Royston's -ice- command, although I am using the -seed- option. A comparison of a mock original and an attempted replication, illustrating this problem, can be found in step #4 below.

I am using Stata version 10.1. The version of -ice- and -micombine- being used can be found in step #5 below.

Please advise.

Thank you.

Tait

. //===========================
. //ORIGINAL
. //===========================
.
. //  #1a
. //  get data
. use _b-vigschiz-gss-04 , clear
(GSS 1996 & 2006 \ 2008feb25)

.
. //  #2a
. //  ice
. local rhs " mentlillR imbalnceR geneticsR"

. local rhs "`rhs' upsdownsR charactrR wayraiseR"

. local rhs "`rhs' meddocR mentldocR mentlhosR mentlothR rxmedR"

. local rhs "`rhs' female white ed_gths age age2 age3"

.
. ice yr06 `rhs' using impvigschiz01 [pw=wtssall] ///
>     , m(5) genmiss(m_) seed(1001) replace

   #missing |
     values |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        509       78.43       78.43
          1 |         59        9.09       87.52
          2 |         33        5.08       92.60
          3 |         10        1.54       94.14
          4 |          9        1.39       95.53
          5 |          6        0.92       96.46
          6 |          2        0.31       96.76
          7 |          4        0.62       97.38
          8 |          2        0.31       97.69
         11 |         15        2.31      100.00
------------+-----------------------------------
      Total |        649      100.00

   Variable | Command | Prediction equation
------------+---------+-------------------------------------------------------
       yr06 |         | [No missing data in estimation sample]
  mentlillR | logit   | yr06 imbalnceR geneticsR upsdownsR charactrR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  imbalnceR | logit   | yr06 mentlillR geneticsR upsdownsR charactrR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  geneticsR | logit   | yr06 mentlillR imbalnceR upsdownsR charactrR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  upsdownsR | logit   | yr06 mentlillR imbalnceR geneticsR charactrR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  charactrR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  wayraiseR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
    meddocR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  mentldocR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR meddocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  mentlhosR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR meddocR mentldocR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  mentlothR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR meddocR mentldocR mentlhosR rxmedR female
            |         | white ed_gths age age2 age3
     rxmedR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR meddocR mentldocR mentlhosR mentlothR female
            |         | white ed_gths age age2 age3
     female |         | [No missing data in estimation sample]
      white |         | [No missing data in estimation sample]
    ed_gths |         | [No missing data in estimation sample]
        age |         | [No missing data in estimation sample]
       age2 |         | [No missing data in estimation sample]
       age3 |         | [No missing data in estimation sample]
------------------------------------------------------------------------------

Imputing 1..2..3..4..5..file impvigschiz01.dta saved

.
. //  #3a
. //  regression
. use impvigschiz01 , clear
(GSS 1996 & 2006 \ 2008feb25)

. qui micombine reg socd `rhs'

. eststo original

.
. //===========================
. //REPLICATION
. //===========================
.
. //  #1b
. //  get data
. use _b-vigschiz-gss-04 , clear
(GSS 1996 & 2006 \ 2008feb25)

.
. //  #2b
. //  ice
. local rhs " mentlillR imbalnceR geneticsR"

. local rhs "`rhs' upsdownsR charactrR wayraiseR"

. local rhs "`rhs' meddocR mentldocR mentlhosR mentlothR rxmedR"

. local rhs "`rhs' female white ed_gths age age2 age3"

.
. ice yr06 `rhs' using impvigschiz01 [pw=wtssall] ///
>     , m(5) genmiss(m_) seed(1001) replace

   #missing |
     values |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        509       78.43       78.43
          1 |         59        9.09       87.52
          2 |         33        5.08       92.60
          3 |         10        1.54       94.14
          4 |          9        1.39       95.53
          5 |          6        0.92       96.46
          6 |          2        0.31       96.76
          7 |          4        0.62       97.38
          8 |          2        0.31       97.69
         11 |         15        2.31      100.00
------------+-----------------------------------
      Total |        649      100.00

   Variable | Command | Prediction equation
------------+---------+-------------------------------------------------------
       yr06 |         | [No missing data in estimation sample]
  mentlillR | logit   | yr06 imbalnceR geneticsR upsdownsR charactrR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  imbalnceR | logit   | yr06 mentlillR geneticsR upsdownsR charactrR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  geneticsR | logit   | yr06 mentlillR imbalnceR upsdownsR charactrR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  upsdownsR | logit   | yr06 mentlillR imbalnceR geneticsR charactrR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  charactrR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR wayraiseR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  wayraiseR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | meddocR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
    meddocR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR mentldocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  mentldocR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR meddocR mentlhosR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  mentlhosR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR meddocR mentldocR mentlothR rxmedR female
            |         | white ed_gths age age2 age3
  mentlothR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR meddocR mentldocR mentlhosR rxmedR female
            |         | white ed_gths age age2 age3
     rxmedR | logit   | yr06 mentlillR imbalnceR geneticsR upsdownsR charactrR
            |         | wayraiseR meddocR mentldocR mentlhosR mentlothR female
            |         | white ed_gths age age2 age3
     female |         | [No missing data in estimation sample]
      white |         | [No missing data in estimation sample]
    ed_gths |         | [No missing data in estimation sample]
        age |         | [No missing data in estimation sample]
       age2 |         | [No missing data in estimation sample]
       age3 |         | [No missing data in estimation sample]
------------------------------------------------------------------------------

Imputing 1..2..3..4..5..file impvigschiz01.dta saved

.
. //  #3b
. //  regression
. use impvigschiz01 , clear
(GSS 1996 & 2006 \ 2008feb25)

. qui micombine reg socd `rhs'

. eststo replication

. //===========================
. //COMPARE
. //===========================
. //  #4
. //  print
. esttab original replication , mtitles(original replication)

--------------------------------------------
                      (1)             (2)
                 original     replication
--------------------------------------------
mentlillR         -0.0380         -0.0392
                  (-0.36)         (-0.37)

imbalnceR          0.0843          0.0859
                   (0.85)          (0.85)

geneticsR          0.0532          0.0528
                   (0.78)          (0.78)

upsdownsR          -0.109          -0.109
                  (-1.70)         (-1.71)

charactrR          0.0144          0.0148
                   (0.22)          (0.23)

wayraiseR          0.0274          0.0264
                   (0.45)          (0.44)

meddocR            0.0412          0.0427
                   (0.55)          (0.57)

mentldocR           0.172           0.172
                   (1.45)          (1.45)

mentlhosR           0.119           0.119
                   (1.88)          (1.88)

mentlothR         -0.0431         -0.0432
                  (-0.42)         (-0.42)

rxmedR            0.00145         0.00102
                   (0.02)          (0.01)

female            -0.0204         -0.0205
                  (-0.37)         (-0.37)

white              -0.107          -0.107
                  (-1.59)         (-1.59)

ed_gths            0.0830          0.0829
                   (1.42)          (1.42)

age                0.0342          0.0342
                   (1.00)          (1.00)

age2            -0.000914       -0.000914
                  (-1.29)         (-1.29)

age3           0.00000739      0.00000739
                   (1.63)          (1.63)

_cons               1.970***        1.970***
                   (3.69)          (3.69)
--------------------------------------------
N                     627             627
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. //  #5
. //  version
. about
Stata/SE 10.1 for Windows
Born 11 Aug 2008

. which ice
*! version 1.4.4 PR 10dec2007.
*! Based on _mvis2 version 1.0.2 PR 19jan2005.
*! v 1.0.0 PR 01Jun2001.
*! version 1.0.0 PR 20dec2004.
*! Based on artformatnos.ado v 1.0.0 PR 26Feb2004
*! version 1.0.0 PR 30may2006.

. which micombine
*! version 1.1.6 PR 04jan2007


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index