Closed Hoeze closed 1 year ago
Hi @Hoeze, this would have to done in the data preparation just like sklearn. Say you have a dataframe df
with columns trait, sex, age, variable_to_test
. Two simple examples:
y, X = dmatrices('trait ~ sex:age + variable_to_test', df)
df['sex:age'] = df['sex'] * df['age']
X, y = df[['sex:age', 'variable_to_test']], df['trait']
Let me know if it works for you!
Hi, I would like to test the significance of a variable with an interaction term as covariate:
trait ~ sex:age + variable_to_test
Can I do this with your library @jzluo?