I want to merge two datasets based on one variable (neither dataset contains duplicates on this variable and there are no other identical variables in both sets) and I would expect _merge==3 to be 4,845 (I exported my data to excel and checked it there), both datasets are original datasets so the input data must be identical with each run;
the code is very simple and looks like the following:
use "$path\facility", clear
sort id
drop if id == id[_n-1]
save "$path\facility", replace
use "$path\facilitysponsor", clear
sort id
drop if id == id[_n-1]
merge 1:1 id using "$path\facility"
keep if _merge ==3
However, each time I run the do-file I get slightly different values but never the correct number of merged data. Anyone has an idea where is my mistake?
Thank you in advance!
Related Posts with Please help: Merge 1:1 delivers different results after each runthrough
Non parametric of ManovaHi! The title is the question. Is there a non parametric counterpart of Manova? I found that resampl…
Why the enhanced module of lclogit (lclogit2) does not converge?Dears I am estimating latent class models and i have some problems with the command lclogit2. Appar…
Appending ColumnsI have 4 different variable names that I want to collapse to a single column, though keep the identi…
Insignificant F statistics, R square approximately equal to 0. Insignficant t statisticsDear Stata list members Advance apologies for asking a naive question. I conducted an analysis to c…
Exporting confidence intervals that loop through all vars in an excel formatFor each of my regional data files, I am trying to export confidence interval tables in a csv file. …
Subscribe to:
Post Comments (Atom)
0 Response to Please help: Merge 1:1 delivers different results after each runthrough
Post a Comment