alysonvanraalte / LifeIneq

An R-package to calculate measures of lifespan variation from a life table
7 stars 6 forks source link

abridged age issue with ineq_quantile() #12

Closed timriffe closed 1 year ago

timriffe commented 1 year ago

@alysonvanraalte Similar to ineq_gini(), abridged ages don't seem to work very well for ineq_quantile(). Behold:

plot(0:110,ineq_quantile(0:110,LT$lx, .2))
lines(LT$Age,ineq_quantile(LT$Age,LT$lx5, .2))

image

This is due to spline issues and will need a different sort of solution methinks.

The other methods using splines will suffer a similar fate: ineq_iqr(), ineq_cp()

timriffe commented 1 year ago

switching to method = "mono.HFC" helped a lot with this problem; otherwise handled in@details` sections where we say to smooth and graduate.