Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Panel data - Finding repeated time values in observations


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Panel data - Finding repeated time values in observations
Date   Thu, 24 May 2007 15:50:05 -0400

..
Just create a variable with the count for each combination of panel id and time:

bysort name yr_mo: gen count=_N
browse if count>1

or, if you want to look at the whole panel for any panel with duplicates:

bysort name (count): gen panelmaxcount=count[_N]
sort name yr_mo
browse if panelmaxcount>1

Michael Blasnik

----- Original Message ----- From: "Michael Crain" <michaelcrain@hotmail.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Thursday, May 24, 2007 3:37 PM
Subject: st: Panel data - Finding repeated time values in observations



My data set is panel data. I am trying to define the data set as time series with the -tsset- command (tsset name yr_mo) but I am getting a message that I have repeated time values within the panel.

I have a large number of observations. What is the most efficient way to identify the repeated time values (other than visually inspecting every observation)?

Thank you.
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index