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

Re: st: RE: nested forvalues loop

From   "Ariel Linden" <>
To   <>
Subject   Re: st: RE: nested forvalues loop
Date   Tue, 6 Oct 2009 11:39:02 -0700

Hi Austin,

I tried your suggested code and I am getting an error r(2000) which means no

Could it be because the line: loc j=`j'-14 starts without indicating what
the starting value of j is? 

I tried loc j=`i'-14 but that also returned the same error with no

Thanks for your help


Date: Mon, 5 Oct 2009 15:27:37 -0400
From: Austin Nichols <>
Subject: Re: st: RE: nested forvalues loop

Ariel Linden <>:

Probably you are not running any logits. Maybe you want:

g double ps=.
forv i=14/24 {
 loc j=`j'-14
 logit Y l(0/`j').X1 l(0/`j').X2 l(0/`j').X3 if month==`i'
 tempvar w
 predict double `w'
 replace ps=`w' if e(sample)
 drop `w'

*   For searches and help try:

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