Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Tetsuji Tanaka <tetsujitanaka.w@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: tsset for panel data with many variables |
Date | Tue, 05 Nov 2013 11:34:46 -0800 (PST) |
Thanks again, Nick, for the quick reply. I will try to change the expression for dates and will get the STATA understand it properly. TJ On Mon, 4 Nov 2013 21:09:35 +0000 Nick Cox <njcoxstata@gmail.com> wrote > It's really not clear what you are doing. Which command produces that > error message? > > If you are telling Stata that you have monthly dates which are > integers like 200610, to Stata they are several thousand years into > the future. For Stata month 0 was January 1960 and this is month 646: > > . di %tm 0 > 1960m1 > > . di %tm 646 > 2013m11 > > Conversely, if you are telling Stata something else, what is it? > > It is futile deciding on your own date convention and hoping that > Stata will understand it. There is only one rule: follow Stata's date > conventions, or invent your own completely separate system. > > In the long run it is a waste of time _not_ to read -help dates and > times- until what you need to know is clearly understood. > > Please show us the results of > > . describe case_id monthly_var > > . list case_id monthly_var in 1/20 > > The request that you read > http://www.stata.com/support/faqs/resources/statalist-faq/#spell still > stands. > > Nick > njcoxstata@gmail.com > > On 4 November 2013 20:43, Tetsuji Tanaka <tetsujitanaka.w@gmail.com> wrote: > > > Dear all, and thank you for the response, Nick. > > > > I am trying that the STATA recognise my panel data as a panel data. > > I made an id variable "case_id" to identify individual data (to avoid data duplication). > > My monthly data variable is written like "200601" "200612" meaning January and December in 2006, respectively. > > > > format monthly_var %tm > > tsset case_id monthly_var > > > > And I got an error message > > > > =exp required > > r(100); > > > > I don't understand what is wrong. > > Please give me ideas to overcome these problems. > > Nick Cox <njcoxstata@gmail.com> wrote > > >> You don't give your exact command. Presumably you tried something of the form > >> > >> tsset panelid time > >> > >> If you omitted a panel identifier variable, that will be problem: such > >> a variable is essential. Otherwise see > >> > >> http://www.stata.com/support/faqs/data-management/repeated-time-values/ > >> > >> http://www.stata.com/support/faqs/resources/statalist-faq/#spell > > On 3 November 2013 10:52, Tetsuji Tanaka <tetsujitanaka.w@gmail.com> wrote: > > >> > I am an economist and am trying to make the STATA recognise my panel > >> > data of prices as a panel data using the tsset. > >> > However, the dataset has many variables and the STATA gave me an error > >> > message "repeated time values within panel". > >> > > >> > My data has monthly time variable, price, region, shop type, shop size > >> > etc. > >> > > >> > Please let me know about how to deal with the problem if you had similar > >> > experiences. > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ -------------------------------------------- Tetsuji Tanaka PhD, Research Fellow, Lifelong Health Theme Rowett Institute of Nutrition & Health University of Aberdeen Greenburn Road, Bucksburn Aberdeen, Aberdeenshire AB21 9SB United Kingdom Email: tetsujitanaka.w@gmail.com Tel. +44 (0)1224 43 8747 (Rowett) or +44 (0)1224 43 7128 (Polwarth) Mobile: +44 (0)750 361 8172 * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/