You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Medians appear to be calculated wrong in at least this simple case:
clear all
set obs 3
gen x = 1
replace x = 3 in 2
replace x = 5 in 3
egen med_egen = pctile(x), p(50)
gegen med_gegen = pctile(x), p(50)
list
The same problem also emerges in gcollapse:
clear all
set obs 3
gen x = 1
replace x = 3 in 2
replace x = 5 in 3
tempfile t1
save `t1'
collapse (p50) x
list
use `t1', clear
gcollapse (p50) x
list
The text was updated successfully, but these errors were encountered:
mdroste
changed the title
Serious issue w/ p50 in gegen pctile and gcollapse
Issue calculating medians in gegen pctile and gcollapse w/ small groups
May 1, 2018
Pending
- For now, throws error for strL variable; see
#39
Plugin version 2.0 makes no mention of strL variables; however, plugin
version 3.0 notes that they are actually not supported by the macros
that I use to access strings. I think I'll have to compile a sepparate
version of the plugin for Stata 13 and Stata 14 and above. The Stata
13 version will throw an error for strL variables. This is currently
the only version until I figure out where to test Stata 14 and how to
implement this switch.
Bug fixes
- Fixes#38
When the quantile requested was N - 1 out of an array of length N, I
makde an exception so the function picked up the largest value, instead
of passing N - 1 to the selection algorithm. However, I made a mistake
and quantiles between 100 - 150 / N and 100 - 100 / N, left-inclusive
right-exclusive, would give the wrong quantile.
Medians appear to be calculated wrong in at least this simple case:
The same problem also emerges in gcollapse:
The text was updated successfully, but these errors were encountered: