From | "Jelmer Ypma" <[email protected]> |
To | <[email protected]> |
Subject | st: Re: Iterative regression runs |
Date | Wed, 22 Dec 2004 00:40:07 -0800 |
I'm a relatively new Stata user with a simple question. I want to iteratively run a regression that allows a dummy variable to change value (compared to the value of a reference variable called "spread") and append some of the results of each run to a table/matrix.This error message means that you're trying to generate a variable which already exists. Try
This is a simplified version of what I'm trying to do (never mind what it's supposed to mean):
Forvalues i=1(0.5)5 {
gen dummy = (spread>`i')
reg y x dummy
here I want to append the value of i and the AIC to a (i,2) matrix so I can look at the results later and pick out the value of i that is min(AIC)
}
This would seem to be a simple thing, but the loop stops after the first iteration with the message "dummy already defined."
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |