FIX: Select() requires var_names to be a subset whereas this needs to be an
intersection of variables and Model.X
@@ -641,8 +641,9 @@ class BIDSStatsModelsNodeOutput:
transformer = tm.TransformerManager(transformations['transformer'])
coll = transformer.transform(coll.clone(), transformations['instructions'])
- # retain only variables listed in 'X', and skip level if none are left.
- tm.Select(coll, var_names)
+ # Take the intersection of variables and Model.X (var_names), ignoring missing
+ # variables (usually contrasts)
+ coll.variables = {v: coll.variables[v] for v in var_names if v in coll.variables}
if not coll.variables:
continue
