Ali,
I'm a bit stumped then. You say that you sued the -duplicates- command to check for duplicate observations. Just to make sure we're on the same page, did you use a varlist with the -duplicates- command? Specifically, I would try -duplicates list country company year- or -duplicates list cc year-. If there are indeed repeated years within a company-country, this should identify them.
Hope this helps.
Howie
Howie Lempel
Research Assistant
The Brookings Institution | Economic Studies
1775 Massachusetts Ave NW | Washington DC 20036
[email protected] | p: (202) 238-3576
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Shahzad, Muhammad
Sent: Sunday, November 16, 2008 1:26 PM
To: [email protected]
Subject: RE: st: How do I define this data as a panel?
Thanks Howard,
I followed your advice and generated the new variable, however, I'm still unable to define the panel:
. gen CountryComp=country+"_"+company_name
. encode CountryComp, gen(CC)
. xtset CC year
repeated time values within panel
r(451);
Regards
Ali Shahzad
[email protected]
________________________________________
From: [email protected] [[email protected]] On Behalf Of Howard Lempel [[email protected]]
Sent: Sunday, November 16, 2008 12:13 PM
To: [email protected]
Subject: RE: st: How do I define this data as a panel?
Hi ALi,
A quick hack would be to combine your country and company variables into a countrycomp variable, so you can uniquely identify observations with countrycomp and year. I don't have access to Stata right now, so I can't check this, but try the following:
gen countrycomp = country + " " + company
xtset countrycomp year
Hope this helps.
Howie
________________________________________
From: [email protected] [[email protected]] On Behalf Of Shahzad, Muhammad [[email protected]]
Sent: Sunday, November 16, 2008 12:58 PM
To: [email protected]
Subject: RE: st: How do I define this data as a panel?
Thanks for a prompt response, it's really appreciated.
Using country just as the panel "id" variable works. Using company, per your suggestion worked too. However I'm still unable to define the time dimension using either country or company in conjunction with year. For example:
xtset country year
or
xtset company year
both result in the "repeated time values within panel" message.
I have checked and I have zero missing observations on country, company and year. A --duplicates-- command found 0 observations. Suggestions on where else to look in my data for problems are most welcome.
Thanks & Regards
Ali Shahzad
[email protected]
________________________________________
From: [email protected] [[email protected]] On Behalf Of [email protected] [[email protected]]
Sent: Sunday, November 16, 2008 11:19 AM
To: [email protected]
Subject: Re: st: How do I define this data as a panel?
Hello Ali,
Year and Company should uniquely identify your observations. So do you
really need Country as identifier in your analysis? If not take
Company as "id"-variable and Year as "time"-dimension.
Best regards
Christian
Zitat von "Shahzad, Muhammad" <[email protected]>:
> Hello,
>
> My data has the following "shape":
>
> Country Year Company Industry Variables
> Country1 2000 CompanyA IndX V1 V2 VN
> Country1 2000 CompanyB IndY V1 V2 VN
> Country1 2001 CompanyA IndX V1 V2 VN
> ...
> Country1 2006 CompanyD IndZ V1 V2 VN
> .
> Country2 2000 CompanyB IndY V1 V2 VN
> ..
> Country2 2006 CompanyJ IndX V1 V2 VN
> ...
> CountryN 2006 CompanyN IndN V1 V2 VN
>
>
> When I try to define it as a panel using country and year as the
> panel and time variables respectively, I get the error message "
> repeated time values in sample". Obviously the combination of
> country and year is not uniquely defining each observation. What
> should I do in this case to define this data as a panel in order to
> utilize the --xt-- family of commands?
>
> Your help and suggestions are appreciated.
>
> Regards
>
> Ali Shahzad
> [email protected]
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
--
___________________________________________________________
Christian Böber
International Research Training Group
"Sustainable Resource Use in North China" (769)
Department of Agricultural Economics and Social Sciences in
the Tropics and Subtropics (490A)
University of Hohenheim
D-70593 Stuttgart/ Germany
Phone: ++49 (0) 711-459-23475
Email: [email protected]
___________________________________________________________
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/