I have duplicates that share values, but some are missing. I would like to keep the observation of each duplicate pair that has the least missing values.
I've used egen notmissing = rownonmiss(varlist) to count the number of non-missing variables per observation.
What command can I use to then remove duplicates based on which has the lowest notmissing-count?
Related Posts with How to drop the duplicates with the fewest missing values?
Increasing inner graph region to allow longer categorical x axis labels without overlapping – catplot with splitvallabelsDear Statalist, I am plotting a horizontal bar chart using catplot. Each categorical x axis label is…
How can I see the coefficients for the models used in gformula?Hello! I am using gformula for a mediation analysis, when I add an extra variable, the indirect eff…
Generating a dummy variable for observations within anotherHi everyone, I am having some problems in generating a variable matching two observations within the…
Stata Dialogue ProgrammingI was searching the documents and internet sources for an example on using radio buttons in dialogue…
Matching: Removing reversed causality?Hi everybody, I've read that endogeneity has many faces: One is omitted variable bias, another is m…
Subscribe to:
Post Comments (Atom)
0 Response to How to drop the duplicates with the fewest missing values?
Post a Comment