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
Variable transformations and the meaning of . in chi2(2) columnHow I read these . signs in col chi2(2) in this picture? Array From stata instructions I have unde…
Fixed-effects in svy strata?Hi all, My query is regarding fixed-effects in stratified survey data. I am working with cross-sec…
Plot graph of multiple categorical variables (with sub-categories) across outcome variableDear all, I more than two categorical variables with two sub groups in each. I want to graph them o…
ppml_panel_sg: "r(2000) no observations" error after 10 iterationsHello everyone, I'm currently working with a balanced panel dataset on bilateral exports at the sec…
Moderated Mediation in Panel Data analysisHi everyone, Please, can anyone guide me on conducting a moderated mediation model using panel data?…
Subscribe to:
Post Comments (Atom)
0 Response to All Observations are Duplicates - Panel Data r(451) Repeated Time Variables within panel
Post a Comment