* Install ascol from SSC
ssc install ascol
* Generate log returns
bys symbol : gen daily_return = ln(close / close[_n-1])
* Create weekly date
gen week_date = wofd(date)
format week_date %tw
* Convert the daily returns to weekly
ascol daily_return , returns(log) keep(all) toweek gen(weekly_return) timevar(date) panelvar(symbol)
Reply To: Converting daily returns to weekly returns in Stata
Hello Nathan
To convert daily returns to weekly, you can either use asrol or ascol. Both of them employ similar methods, though ascol is specifically designed for this task. The help file of ascol provides several examples in this regard. You might also find this blog entry helpful. In the following paragraph, I show one additional example using data from my site.