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
Related Posts with All Observations are Duplicates - Panel Data r(451) Repeated Time Variables within panel
Cumulative frequency of unique values within groupsHello statalist, My dataset is an unbalanced time series (with repeated years). Each company can ha…
Cox-Model with very few observationsHello everybody, I am researching peace agreements and their durability if they include gender prov…
Changing Axis Range - Pre Saved .gphHi Im having an issue with a pre saved graph. I would like to change the range of mye y-axis. Someon…
How to find the matched observation with nearest Mahalanobis distance?Hi everyone, I am wondering how to find the matched observation with nearest Mahalanobis distance. …
Within Estimator StataI have a set of panel data showing Unemployment in NI & ROI pre brexit in 2015 and post brexit i…
Subscribe to:
Post Comments (Atom)
0 Response to All Observations are Duplicates - Panel Data r(451) Repeated Time Variables within panel
Post a Comment