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: syntax loop
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: syntax loop
Date
Tue, 19 Apr 2011 10:34:45 +0100
-if- here is a qualifier (not an option). See -help if-.
forvalues i = 1/5{
qui regress indepvar depvar if _j== `i', vce(cluster respid)
}
On Tue, Apr 19, 2011 at 10:26 AM, Lamla, Bettina
<[email protected]> wrote:
> I have a multiply imputed data set and want to do the same regression for all data sets independently.
> The loop works as long as I do not add options after the regress command.
> The error is: “option if not allowed. “
> Can anyone help me correct the syntax?
>
> forvalues i = 1/5{
> #delimit;
> qui regress indepvar depvar, vce(cluster respid)
> if _j== `i'
> ;
> #delimit cr
> }
>
>
>
> I use Stata 11.
>
*
* 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/