clear all /* There are more than 6000 stocks, so you need to change the maxvar setting */ set maxvar 10000 use https://bigblue.depaul.edu/jlee141/econdata/Financial_data/historic_stock_adjprice.dta gen daten = ref_date format daten %td keep daten IBM drop if IBM == . gen t = _n tsset t tsline IBM /* Monthly Average Data */ gen yearm = mofd(daten) collapse (mean) IBM , by(yearm) tsset yearm format yearm %tm tsline IBM