13.07.2015 Views

LIAM 2 User Guide

LIAM 2 User Guide

LIAM 2 User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTERTENAPPENDIX10.1 Known issues10.1.1 Contextual filter is inconsistentFirst, what is a contextual filter? It is the name we gave to the feature which propagates the filter of an if functionto the “True” side of the function, and the opposite filter to the “False” side. So, for example, in:- aligned: if(gender, align(0.0, ’al_p_dead_m.csv’)align(0.0, ’al_p_dead_f.csv’))the “gender” filter is automatically propagated to the align functions. Which means, the above code is exactlyequivalent to:- aligned_m: align(0.0, ’al_p_dead_m.csv’, filter=gender)- aligned_f: align(0.0, ’al_p_dead_f.csv’, filter=not gender)- aligned: if(gender, aligned_m, aligned_f)One might wonder what happens if an explicit filter is used in addition to the contextual filter? Both filters arecombined (using “and”), as for example:- aligned: if(gender, align(0.0, ’al_p_dead_m.csv’, filter=age > 10)align(0.0, ’al_p_dead_f.csv’))which is in fact evaluated as:- aligned_m: align(0.0, ’al_p_dead_m.csv’, filter=gender and age > 10)- aligned_f: align(0.0, ’al_p_dead_f.csv’, filter=not gender)- aligned: if(gender, aligned_m, aligned_f)What is the inconsistency anyway?This contextual filter propagation is implemented for new(), align(), logit_regr(), matching() and some (but not all)aggregate functions. Specifically, it is implemented for sum and gini, but not for other aggregate functions (count,avg, min, max, std, median and percentile). This situation needs to be changed, but I am unsure in which way:implementing it for all aggregate functions or not contextutal filter for any aggregate function (or any function atall)?While this features feels natural for new, align and logit_regr, it feels out of place for aggregate functions becauseit means we work at both the individual level and at the “aggregate” levels in the same expression, or, in moretechnical terms, we work with both vectors and scalars, and it might be confusing: do users realize they areassigning a value for each individual, even if that is only one of two values?In an expression like the following:- age_sum: if(gender, sum(age), sum(age))49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!