This is the main entry point for handling basis functions in formulas. It evaluates the term on pooled data, extracts attributes, and creates both within and between versions of the term.
process_matrix_term(term, data)List with:
data: Updated data frame with expanded columns
within_cols: Character vector of within column names
between_cols: Character vector of between column names
var_name: Original variable name
fn_name: Function name
Character string like "ns(age, df=3)"
panel_data frame