Hello,
I am new to Stata. Can you please help me with the following issue: for different companies, which I labeled as id, I have different variables describing some stock characteristics.
I would like to keep the companies that have data for the stock characteristics for every month within a year.
The issue is that the data does not appear as missing, is just simply absent.
For example, if we consider the year 2017, I have the following entries for the dates: date id
31jan2017 1
28feb2017 1
31mar2017 1
30apr2017 1
31may2017 1
30jun2017 1
31jul2017 1
31aug2017 1
30sep2017 1
31oct2017 1
30nov2017 1
31dec2017 1
and then data entries for other variables.
How do I drop observations that have only 3 entries for the dates above, as opposed to 12, e.g. for id=2, I only have observations for 28feb2017, 30apr2017 and 30sep2017?
I thought about doing a bysort by id and date, i.e. bysort id (date): drop if
but I don't know how to write the condition, as the data is not missing ., but simply not present.
Thank you for your help.
Related Posts with Drop variables if no entry for monthly dates within a year
xtabond2 vs xtreg / xtregarDear Stata users, I have always assumed that in the presence of serial autocorrelation and assumpti…
ANOVA REPEATE MEASURES - HOW TO INTERPRET CONTRADICTORY RESULTS BETWEEN ANOVA AND MULTIPLE PAIRWISE COMPARISONS (post hoc)?Good mornig to everybody. 1)HOW TO INTERPRET CONTRADICTORY RESULTS BETWEEN ANOVA AND MULTIPLE PAIRW…
merging data files to create a large panel data by VDS_Id and SUR_MON_YRhere is data below Code: * Example generated by -dataex-. To install: ssc install dataex clear inpu…
Time Series Graph Percentage Deviations from TrendHello, I am currently working on time series analysis, trying to identify the effect of an increase…
ANOVA REPEATE MEASURES - HOW TO INTERPRET CONTRADICTORY RESULTS BETWEEN ANOVA AND MULTIPLE PAIRWISE COMPARISONS (post hoc)?Good mornig to everybody. HOW TO INTERPRET CONTRADICTORY RESULTS BETWEEN ANOVA AND MULTIPLE PAIRWIS…
Subscribe to:
Post Comments (Atom)
0 Response to Drop variables if no entry for monthly dates within a year
Post a Comment