Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Date Formats in Loops

From   Nick Cox <>
To   "''" <>
Subject   st: RE: Date Formats in Loops
Date   Wed, 3 Nov 2010 18:53:08 +0000

Kit already answered, but your search sequence is best as help -- manuals -- FAQs. 

Although there a few hundred FAQs at, their main function is to fill in gaps or spell out points that are sometimes misunderstood. Sometimes, where the documentation is detailed and fine, there are no corresponding FAQs. 

In this territory, for an introduction, see [U] Working with dates and times. For more
comprehensive treatments, see [D] dates and times and [D] functions.


Degas Wright

I have a simple question, on the Time Period title for my regression
results, I would like to show the weekly date format rather than the
number. I have reviewed the FAQ and did not see how to approach this

Thank you in advance for your comments.

local lo=tw(2006w15)
	local hi=tw(2010w30)
	forvalues i= `lo' / `hi' {
		local j=`i'+11
		local t1=`i'
		local t2= `j'
		display _n(3) in white _col(30) /// 
		"Time period:"  `t1'  "-" `t2'
		  xtregar (D.(r ep mom))  if date>=`i' & date<=`j' , fe
		  post `vector'	(`i') (`j')	(_b[D.ep])  (_b[])
(_b[_cons])	/// 
			(_se[D.ep]) (_se[]) (_se[_cons]) 
		    local j=`j'+1


A example of the results are :

                              Time period:2629-2640

FE (within) regression with AR(1) disturbances  Number of obs  =     99
Group variable: xticker                         Number of groups =     9

R-sq:  within  = 0.6656                         Obs per group: min =  11
       between = 0.0193                                        avg =
       overall = 0.4579        

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index