Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: RE: Imputing error: Obs. nos. out of range


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: RE: Imputing error: Obs. nos. out of range
Date   Tue, 13 Apr 2010 15:47:33 +0100

I suggest that you contact Patrick Royston, the author of the program. He is not a member of Statalist. 

Nick 
[email protected] 

Ploutz-Snyder, Robert (JSC-SK)[USRA]

Martin,

My apologies for misreading your suggestion..

Using the set trace on option throws up so much in the results window that Stata eliminates early lines (I also set more off). I've pasted some of the code surrounding the error message below... is this enough to know what's hanging?   I suppose I could set more back to on and then copy every "chunk" of the trace out manually, one screen at a time??   (is there a better way to capture very long trace lines?)

...earliest trace available ... 

  - local ++n
      - local n`n' `1'
      = local n11 x11
      - }
      - macro shift
      - }
      - while "`1'"!="" {
      = while "x12"!="" {
      - if "`1'"!="`separator'" {
      = if "x12"!="" {
      - local ++n
      - local n`n' `1'
      = local n12 x12
      - }
      - macro shift

... trace output omitted...
      = if ""!="" {
        capture local out: display `format' `n`i''
        if _rc {
        di as err "invalid format attempted for: " `"`n`i''"'
        exit 198
        }
        }
      - else local out `n`i''
      = else local out x1
      - if `leading'>0 {
      = if 1>0 {
      - local out " `out'"
      = local out " x1"
      - }
      - local l1=length("`out'")
      = local l1=length(" x1")
      - local l2=`length'+`l1'
      = local l2=0+3
      - if `l2'>`maxlen' {
      = if 3>55 {
        local ++j
        return local line`j'="`line'"
        local line "`out'"
        local length `l1'
        }
      - else {
      - local length `l2'

... trace output omitted...
    }
      - else {
      - local length `l2'
      = local length 41
      - local line "`line'`out'"
      = local line " x1 x2 x1x2 x4 z_x5 x6 x7 x8 x7x8 x10 x11"
      - }
      - }
      - if "`format'"!="" {
      = if ""!="" {
        capture local out: display `format' `n`i''
        if _rc {
        di as err "invalid format attempted for: " `"`n`i''"'

... trace output omitted...
    - else {
        local length `l2'
        local line "`line'`out'"
        }
      - }
      - if "`format'"!="" {
      = if ""!="" {
        capture local out: display `format' `n`i''
        if _rc {
        di as err "invalid format attempted for: " `"`n`i''"'
        exit 198
        }
        }

... trace output omitted...   

   = local l2=55+4
      - if `l2'>`maxlen' {
      = if 59>55 {
      - local ++j
      - return local line`j'="`line'"
      = return local line2=" y1 y2 y3 y4 y5 y6 z_y7 z_y8 y9 y10 y11 y12 y13 y14 y15"
      - local line "`out'"
      = local line " y16"
      - local length `l1'
      = local length 4
      - }
      - else {
        local length `l2'
        local line "`line'`out'"
        }
      - }
      - if "`format'"!="" {
      = if ""!="" {
        capture local out: display `format' `n`i''
        if _rc {
        di as err "invalid format attempted for: " `"`n`i''"'
        exit 198
        }
        }
      - else local out `n`i''
      = else local out y18
      - if `leading'>0 {
      = if 1>0 {
      - local out " `out'"
      = local out " y18"
      - }
      - local l1=length("`out'")
      = local l1=length(" y18")
      - local l2=`length'+`l1'
      = local l2=4+4
      - if `l2'>`maxlen' {

... a LOT of trace output omitted...

... a LOT of trace output omitted...

      - qui replace `c'=`pi'+(`i'-1)/`np' in `i'
      = qui replace __00000Y=8+(26-1)/36 in 26
      - }
      - local pi: word `i' of `p'
      = local pi: word 27 of 0 0 0 14 5 5 1 1 1 10 16 14 5 5 2 3 1 0 0 0 0 0 0 0 8 8 1 1 4 5 1 1 1 1 0 0
      - if !`lex' confirm number `pi'
      = if !0 confirm number 1
      - qui replace `c'=`pi'+(`i'-1)/`np' in `i'
      = qui replace __00000Y=1+(27-1)/36 in 27
      - }
      - local pi: word `i' of `p'
      = local pi: word 28 of 0 0 0 14 5 5 1 1 1 10 16 14 5 5 2 3 1 0 0 0 0 0 0 0 8 8 1 1 4 5 1 1 1 1 0 0
      - if !`lex' confirm number `pi'
      = if !0 confirm number 1
      - qui replace `c'=`pi'+(`i'-1)/`np' in `i'
      = qui replace __00000Y=1+(28-1)/36 in 28
Obs. nos. out of range
        }
      --------------------------------------------------------------------------------------------------------------- end ice_.listsort3 ---
      forvalues i=1/`nvar' {
      local r`i' `s(index`i')'
      }
      }
      if `"`trace'"'!="" {
      tempname tmp
      local postvl cycle
      forvalues r=1/`nvar' {

Martin Weiss

Yes, I was unaware there is a -trace- option to -ice-, but -set trace on-, issued before any other command, should give you a log regardless. 

Maarten buis

--- On Tue, 13/4/10, Ploutz-Snyder, Robert  wrote:
> I've returned to this error
> problem--unsuccessful attempt to use ice to impute missing
> values in a dataset.
> 
> Per Martin's suggestion I used the trace option, with m=1
> and cycles=100.  Here the code that I used:
> 
> 
> ice x1 x2 x1x2 x4 z_x5 x6 x7 x8 x7x8 x10 x11 x12 x13 z_x14
> y1-y6 z_y7 z_y8 y9-y22,
> m(1)   passive(x7x8:x7*x8)
> saving(mrid_imputed, replace) seed(112233) trace(mridtrace)
> cycles(100)

The suggestion was not to use the -trace- option, but to 
precede the -ice- command with the command -set trace on-.
The former can be used to see if the Gibbs sample has
converged, while the latter can be used to find problem in
the program.

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index