the sample produced by this code
replace region =. if region==-1
drop if region==.
sum if region ==1
differ from the sample produced by this code
keep if region ==1
sum
I thought perhaps it was specific to the keep command, but
drop if region != 1
sum
produced the same sample as the keep command.
Is there something in the keep/drop command that changes the storage type of the variable but this doesn't happen with the replace command?
Thank you!
Related Posts with Keep/drop command affects different data than replace
Different results from Mundlak and Hansen-Sargan test (xtoverid)Dear all, I am getting different results from the Mundlak test and the Hansen-Sargan test (xtoverid…
Simple question from a beginnerGood morning/afternoon/evening/night I'm new to stata and I'm trying to generate a dummy variable f…
continuous variable to categorical one.Dear All, Is there a more concise way to do the following. Code: * Example generated by -dataex-. T…
Interval regression with cross-sectional dependenceI have a panel data with fixed N = 197 countries. T is in years (15). My dependent variable varies b…
to draw vertical line on kdensity ploti have generated kdensity plot using this code: kdensity mpce if year==2019 & household_type ==1…
Subscribe to:
Post Comments (Atom)
0 Response to Keep/drop command affects different data than replace
Post a Comment