Here's the code for rounding and merging in:
Code:
*** merge in file gen c_zscore_wk0_test = round(c_zscore_wk0, 0.01) merge m:1 c_zscore_wk0_test using "\\childrens\research\nik\Mark\LMS files\standardnormaltable.dta", keepusing (percentile) keep (match master)
It appears to be an issue with float.
Here's a sample of my master data, after the merge:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float c_zscore_wk0 double(c_zscore_wk0_test percentile) 2.455643 2.4600000381469727 . 2.473743 2.4700000286102295 . 2.467938 2.4700000286102295 . 2.492309 2.490000009536743 . 2.504111 2.5 99.37903346742239 2.4952555 2.5 99.37903346742239 2.495467 2.5 99.37903346742239 2.503931 2.5 99.37903346742239 2.497605 2.5 99.37903346742239 2.521553 2.5199999809265137 . 2.5331485 2.5299999713897705 . end
Here's a sample of the using data (z scores and percentiles from a standard normal table):
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(c_zscore_wk0_test percentile) 2.44 99.26563690446517 2.45 99.28571892647285 2.46 99.30531492113757 2.47 99.32443473928593 2.48 99.34308808644532 2.49 99.36128452350567 2.5 99.37903346742239 2.51 99.39634419195873 2.52 99.41322582846675 2.53 99.42968736670494 2.54 99.44573765569173 end
I don't get an error for either line, they complete just fine but only 9 of 242 observations match (there's no missing data). I'd be happy to show the output but the Advice page says not to post screenshots, so I'm not sure the best way to do it.
0 Response to -merge- not finding all matches
Post a Comment