Dear Statalist members,
I know that there is simple way to drop the duplicate variables using Stata. However, is there a way to do the opposite? I mean drop variables that are not duplicates.
For example, the data below with panelid and panel variable shows that if data is collected in 3 years, there will be 3 times the variable "pabelid" appearing. If there is only 1 year, there will be only 1 variable.
Is there a way I can drop all the variables with panel consisting of only 1 year?
Thank you in advance. Sorry if my explanation is somehow complicated.
panelid panel
101007 2006, 2010 and 2017
101007 2006, 2010 and 2017
101007 2006, 2010 and 2017
101018 2006, 2010 and 2017
101018 2006, 2010 and 2017
101018 2006, 2010 and 2017
101021 2006, 2010 and 2017
101021 2006, 2010 and 2017
101021 2006, 2010 and 2017
101025 2006, 2010 and 2017
101025 2006, 2010 and 2017
101025 2006, 2010 and 2017
101038 2006, 2010 and 2017
101038 2006, 2010 and 2017
101038 2006, 2010 and 2017
101041 2006, 2010 and 2017
101041 2006, 2010 and 2017
101041 2006, 2010 and 2017
101043 2006, 2010 and 2017
101043 2006, 2010 and 2017
101043 2006, 2010 and 2017
panelid panel
622654 2017 only
622655 2017 only
622656 2017 only
622657 2017 only
622658 2017 only
622659 2017 only
622660 2017 only
622661 2017 only
622662 2017 only
622663 2017 only
622664 2017 only
622665 2017 only
622666 2017 only
622667 2017 only
622668 2017 only
622669 2017 only
622670 2017 only
622671 2017 only
622672 2017 only
Related Posts with Drop variables
Generating risk-adjusted hospital admission rates using Empirical Bayes Means with melogitDear Statalisters,
I am using -melogit- to compare hospital admission rates between 177 public hosp…
When do I use GMM style instruments in a panel Vector Autoregression model?Dear all,
I am applying a panel Vector Autoregression model using the command pvar from Abrigo and …
How to replace the age and exit at a certain ageDear All,
Is there a way I can replace all age with the current age+1 till 2040 at one go and also …
Descriptive statistics with confidence intervalI wonder in order to have descriptive statistics with confidence interval, whether the data has to b…
Standardization of time in panel data with different treatmentsHi everybody
I am working with panel data and investigating how employees experience the transfer f…
Subscribe to:
Post Comments (Atom)
0 Response to Drop variables
Post a Comment