Hi,
when I enter the following prompt:
* Define periods and variables
local periods "2005 2008 2009 2012 2013 2016 2017 2020 2021 2024"
local vars "debt_maturity_1 size market_to_book leverage rd capex ppe roa dividend_dummy cash age taxes"
* Loop over periods
foreach period in `periods' {
local start = word("`period'", 1)
local end = word("`period'", 2)
* Filter for the time period
preserve
keep if year >= `start' & year <= `end'
* Loop over variables and compute stats for each size group
foreach var in `vars' {
bysort size_group: summarize `var', detail
display "Period: `start'-`end', Variable: `var', Mean: " %9.2f r(mean) ", Median: " %9.2f r(p50)
}
restore
}
I get the Invalid Syntax Error. Any Ideas what I did wrong?
Thanks!
when I enter the following prompt:
* Define periods and variables
local periods "2005 2008 2009 2012 2013 2016 2017 2020 2021 2024"
local vars "debt_maturity_1 size market_to_book leverage rd capex ppe roa dividend_dummy cash age taxes"
* Loop over periods
foreach period in `periods' {
local start = word("`period'", 1)
local end = word("`period'", 2)
* Filter for the time period
preserve
keep if year >= `start' & year <= `end'
* Loop over variables and compute stats for each size group
foreach var in `vars' {
bysort size_group: summarize `var', detail
display "Period: `start'-`end', Variable: `var', Mean: " %9.2f r(mean) ", Median: " %9.2f r(p50)
}
restore
}
I get the Invalid Syntax Error. Any Ideas what I did wrong?
Thanks!
Comment