tisane.variable.AbstractVariable.moderates¶
method
- AbstractVariable.moderates(moderator, on)¶
Adds an interaction relationship to a data variable
- Parameters
moderator (AbstractVariable or List[AbstractVariable]) – The variable(s) that moderate(s) the effect of this variable on another variable
on (AbstractVariable) – The target of the moderated effect
Examples
Race interacts with SES to cause math achievement:
>>> import tisane as ts >>> student = ts.Unit(name="student_id") >>> race = student.nominal(name="race") >>> ses = student.ordinal(name="SES") >>> math_achievement = student.numeric(name="math_score") >>> race.moderates(moderator=ses, on=math_achievement)