Hallo everyone,
i want to use command xtpdyn, but i didn't work. So I want to replicate xtpdyn with xtprobit and meprobit. The codes are all in Grotti and Cutuli (2018).
I use the following codes to capture the initial condition:
generate sample=!missing(id0, Jahr, Wachstumy_it, Gewerbesaldo, Baugenehmigung, Stadt, West, Schulden )
. foreach var of varlist Wachstumy_it Gewerbesaldo Baugenehmigung Schulden {
2. bysort sample id0 (Jahr): generate `var'__0 = `var'[1] if sample & sample[1]==1
3. }
but there is an error:
foreach command may not result from a macro expansion interactively or in do files
r(198);
can someone tell me what is wrong with these codes?
Besides, I dont understand why "bysort sample id0 (Jahr)" instead of "bysort id0 (Jahr)", they should be in this case the same right?
I also dont unterstand why "sample[1]==1", if i want to use the nonmissing data "sample ==1" should be enough right?
i want to use command xtpdyn, but i didn't work. So I want to replicate xtpdyn with xtprobit and meprobit. The codes are all in Grotti and Cutuli (2018).
I use the following codes to capture the initial condition:
generate sample=!missing(id0, Jahr, Wachstumy_it, Gewerbesaldo, Baugenehmigung, Stadt, West, Schulden )
. foreach var of varlist Wachstumy_it Gewerbesaldo Baugenehmigung Schulden {
2. bysort sample id0 (Jahr): generate `var'__0 = `var'[1] if sample & sample[1]==1
3. }
but there is an error:
foreach command may not result from a macro expansion interactively or in do files
r(198);
can someone tell me what is wrong with these codes?
Besides, I dont understand why "bysort sample id0 (Jahr)" instead of "bysort id0 (Jahr)", they should be in this case the same right?
I also dont unterstand why "sample[1]==1", if i want to use the nonmissing data "sample ==1" should be enough right?

Comment