All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s412101. See general information about how to correct material in RePEc. Show
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: . General contact details of provider: https://edirc.repec.org/data/debocus.html . If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about. We have no bibliographic references for this item. You can help adding them by using this form . If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation. For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/debocus.html . Please note that corrections may take a couple of weeks to filter through the various RePEc services. It is pretty easy to convert your data from daily frequency to weekly, monthly, quarterly, or yearly frequency. We can use the Stata built-in collapse function after creating period identifiers. Alternatively, we can use the ascol program that I have written. ascol makes it pretty simple to convert stock returns or prices data from daily to weekly, monthly, quarterly, or yearly frequency. Since returns and prices need different treatments for conversion (returns need to be summed for their conversion from daily to say weekly frequency, while in case of prices, the conversion will just results in producing end of the week prices.), the program gives us both the option of converting returns and prices data. This program requires data to be a panel data or time series series data. This program can be downloaded from SSC by typing: ssc install ascol For Stata 13, the program can downloaded using net command: net from "https://sites.google.com/site/imspeshawar" The program requires the data to be declared as panel data Syntax ascol varlist , return price [frequency options] options return This option tells the program that the data is stock returns data. Since stock returns are already expressed in percentage change form, the collapse treatement would be to sum these returns within the specified time interval. price Alternatively, users can specify that the data in memory is share prices data using option price. The return and price cannot be combined together. To collapse prices to desired frequency, the program finds the last traded prices of the period which the users specify. Let us use some examples to understand how the program works In all of the following examples, I assume that we have data or returns (named as ri) and prices (named as pr) Let us first generate some examples data for practice. -----------------------------------------------------+ set obs 1000 | gen date=date("1/1/2012" , "DMY")+_n | format %td date | gen pr=10 | replace pr=pr[_n-1]+uniform() if _n>1 | gen ri=(pr/l.pr)-1 | save stocks,replace | ---------------------------------------+ From Daily to weekly –returns (adsbygoogle = window.adsbygoogle || []).push({});----------------------------------+ use stocks, clear | ascol returns, toweek returns | | OR | ascol ri, tow r | --------------------------------------------- + ascol is the program name, ri is the variable name in our data set, toweek is the program option that tells Stata that we want to convert the daily data to weakly frequency, and the return option tells Stata that our ri variable is return (i.e. already converted from prices into periodic returns) From Daily to weekly – Prices----------------------------------+ use stocks, clear | ascol returns, toweek prices | | OR | ascol ri, tow p | --------------------------------------------- + ascol can also be used similarly as in the above examples to convert from daily to monthly, quarterly, and yearly frequency. The options to be used in each case are given below; STATA: Time series dataA. Colin Cameron, Dept. of Economics, Univ. of Calif. - DavisLAGS AND CHANGES IN STATASuppose we have annual data on variable GDP and we want to compute lagged GDP, the annual change in GDP and the annual percentage change in GDP. LAGS AND CHANGES IN STATA FOLLOWING TSSET Suppose the dataset has a variable year that takes numeric values, say, 1985, 1986, 1987, .... CONVERTING STRING DATES TO A NUMERIC DATE - DIFFICULT Dates are often given in data sets as string variables e.g. "February 1, 1960 " or "2/1/1960" As an example, suppose we have string variable named date formatted as e.g. "2/1/1960" Note that the particulars for steps (1) - (3) will change according to whether your data is daily, weekly, monthly, quarterly, yearly, ..... and the exact way that they appear in the original data e.g. "February 1, 1960 " or "2/1/1960". For further information on how to use Stata go to How to convert monthly data to quarterly data in Stata?For instance, monthly data may be converted to quarterly, half-yearly, or annual (yearly) data by specifying to(q), to(h), or to(y), respectively. Data may be averaged over the interval (using either an arithmetic or geometric mean) or summed (as would be appropriate for income statement data).
How do I convert yearly data to quarterly data in Excel?Unless you are willing to make assumptions, there is no way to convert yearly data into monthly or quarterly data. If you are willing to make the assumption that whatever it is you have data on happens at a uniform rate throughout the year then quarterly data would just be yearly data divided by 4.
|