I am trying to generate a value for the expected change in the unemployment rate (expdump) by creating a forvalues loop. There are a total of 892 periods in my data set. I would like each prediction to incorporate data from all of the previous periods, which is why I'm using a loop.
In this loop, I am trying to run the predict command and have it generate one new variable column in my data set called expdump, which would represent the expected change in unemployment. When I run the code below, though, it gives an error that says "expdump already defined."
Any advice on how to solve this issue?
Here is the code I have currently:
forvalues i= 180/891 {
regress dump ipgrate1 ipgrate2 ipgrate3 dump1 dtb3 dba if period in 1/`i'
predict expdump if period==`i'+1
}
Thank you!
In this loop, I am trying to run the predict command and have it generate one new variable column in my data set called expdump, which would represent the expected change in unemployment. When I run the code below, though, it gives an error that says "expdump already defined."
Any advice on how to solve this issue?
Here is the code I have currently:
forvalues i= 180/891 {
regress dump ipgrate1 ipgrate2 ipgrate3 dump1 dtb3 dba if period in 1/`i'
predict expdump if period==`i'+1
}
Thank you!
Comment