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
Calculating difference between observations and sumDear experts, I'm wondering whether you can help me. I wanted to calculate the age similarity based…
Warning strata using hotdeck commandHello, I am imputing data using hotdeck command. Just so you may know exactly how I am doing this, …
het() option - Which variables do I have to include?Hello, I am dealing with an intreg model, which does not meet the assumption of homoskedasticity. I…
Extracting Parts of a Sting variable: Numerous Attempts failedHello, I've spent the last 3 hours trying to extract various parts of this string variable <mcas…
Interactive do File à la C++/PythonI have 2 datasets: A.dta, and B.dta. I want the same set of codes to run on A & B depending on t…
Subscribe to:
Post Comments (Atom)
0 Response to Keep/drop command affects different data than replace
Post a Comment