Hello,
Using Stata 12, I have a panel dataset from 2010 to 2019 with 23 variables and 1484908 observations.
It is data of fish sales prices($) and amounts sold (kg) by year, region and species category.
I wish to study the effect of different predictors on the sales prices and amounts by category of species (category and sub category).
To achieve that, I want to estimate a multilevel fixed effects model, but whenever I try to declare the dataset as panel data, I get the error message :
xtset SousCatégorie_Espèce Year
repeated time values within panel
r(451);
While searching through the forum to fix this issue, I found that the duplicate set of commands helps show and delete the duplicate observations within variables.
However, after running the commands on my variable DateKey(DD/MM/YYY) and variable Year(YYYY), both variables show that almost all observations are duplicates(except for the first occurence).
The following screenshots show the commands used and results :
Array
Array
Array
Array
Array
As you can see in the "duplicates list" command, it shows that there are no duplicates in the dataset.
However the "duplicates report Year", the "duplicates tag Year, gen(dup_Year) and the "drop if Year==Year[_n-1]" commands show that only the first occurence of the date value is an observation; all the rest are duplicates.
Is there any way aroud this ?
How can I notify stata to take into consideration the values of all other the variables so that it doesn't count all my dates as duplicates?
Any kind of help is highly appreciated,
Thanks in advance
0 Response to All Observations are Duplicates - Panel Data r(451) Repeated Time Variables within panel
Post a Comment