hddm-devs / hddm

HDDM is a python module that implements Hierarchical Bayesian parameter estimation of Drift Diffusion Models (via PyMC).
http://ski.clps.brown.edu/hddm_docs/
Other
261 stars 117 forks source link

regressor with interaction #69

Open dokato opened 3 years ago

dokato commented 3 years ago

I've got data that looks like this (with response accuracy encoded):

        Idx        rt  response  axes  cogr      cond      subj    angle
          0  2.384600         1   2.0   0.0        I2         0      20
          1  1.960730         1   2.0   0.0        I2         0      20
          3  1.857445         1   1.0   0.0        I1         0      20
          4 -2.672745         0   2.0   1.0        C2         0      20
          5  1.869880         1   2.0   0.0        I2         0      20

I want to create regression model for v and t, with baseline condition I2. I also want to include interaction dep. on angle. After studying docs of hddm and patsy I think that something like this should work:

vmod = {'model': "v ~ C(cond, Treatment('I2')):C(angle)", 'link_func': lambda x: x}
tmod = {'model': "t ~ C(cond, Treatment('I2')):C(angle)", 'link_func': lambda x: x}

m = hddm.HDDMRegressor(dataf, [vmod, tmod], include = 't', p_outlier=0.05, bias = False)

However, I'm getting:

NotImplementedError: Missing columns in design matrix. You need data for all conditions for all subjects.

Do you know some workaround?