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
Monte Carlo simulation comparing output for OLS and 2SLS by saving beta and se's in matrixHi In my simulation I am trying to compare output from OLS and 2SLS. I have the following code which…
dropping observations if variable is zero between time periodHello, Could someone please help me dropping some observations? I'm investigating the influence of …
Combining two categorical income variablesHi, I'm using a cumulative dataset of the European Social Survey from 2002-2018. In my analysis I wa…
Using drop-command for a variable depending on the value of another variableHi, for my cumulative dataset (European Social Survey 2002-2018) I have a variable which measures if…
Stripplot -Hi to everybody Below the dataset Code: * Example generated by -dataex-. To install: ssc install …
Subscribe to:
Post Comments (Atom)
0 Response to All Observations are Duplicates - Panel Data r(451) Repeated Time Variables within panel
Post a Comment