I'm running Stata version 14.2 on Windows. My analysis includes weight data for children. My main analytic variable is child BMI z-score. BMI is kg/m^2; BMI z-score also incorporates child age and sex. I have z-score calculated already, and am trying to use a standard normal table to merge in percentiles. For example, a BMI z-score of 1.00 is the 84.13th percentile. My calculated z-scores have a lot of decimal places but the standard normal table only goes to two decimals, so my plan is: 1) round z-scores to two decimals, then use a m:1 merge to add percentiles to each participant. However, when I run the merge, only 9 observations match, and the other 233 are not matched (242 obs total). Each observation is exactly one participant.

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)
"c_zscore_wk0" is the original z-scores, I tried to make a new var that was a rounded version--that seemed to work fine. "Percentile" is the var in the using file (standard normal table) that has the percentiles in it.

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
The 9 z-scores that matched were 2.00, 2.00, 2.25, 2.5, 2.5, 2.5, 2.5, 2.5, and 2.75. All 9 are divisible by 0.25, which is odd. Only those 9 z-scores were divisible by 0.25. Using -recast- on c_zscore_wk0_test and setting it to float didn't help.

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.