On Tue, 2 Feb 2010, Summers, Peter wrote:
However, when I try to run the following one, I get an error
saying "undefined variable nreps in loop condition". This
happens even though the script output says "generated scalar
nreps = 1:"
\begin{script}
n = 25; # sample size
nreps = 1; # number of replications
beta1 = 1;
beta2 = 0.8; # true values of parameters
b1 = 0;
b2 = 0;
nulldata n
loop ii=1..nreps
You just deleted nreps via the nulldata command. Use
nulldata --preserve to preserve existing scalars and matrices.
BTW, the trailing semi-colons are not needed (though they
shouldn't do any harm).
Allin.