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
Problem with "Graph already exists" messageDear Statalist, I'm having problems with clearing graph memories even after using the "graph drop _…
How to Construct Daily Food Consumption ScoreDear Statalisters, I am working with a dataset that contains information on household consumption of…
How to get rows into columns when non transposable?Hi all , I was wondering whether someone could help me with a command so I can convert my data into…
Specifying a CorrelationSay I'd like to simulate academic data Code: clear * set seed 1066 cls matrix input mCorr = (1, .…
execute from top doesn't workDear all, in the do file editor, the "tools / execute (do) from top" command doesn't work. I click …
Subscribe to:
Post Comments (Atom)
0 Response to Keep/drop command affects different data than replace
Post a Comment