Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction between categorical and spline predictor? #71

Open
olafdimigen opened this issue Jun 13, 2019 · 1 comment
Open

Interaction between categorical and spline predictor? #71

olafdimigen opened this issue Jun 13, 2019 · 1 comment

Comments

@olafdimigen
Copy link
Member

Do we have any experience with that? Produces error:

Error using classreg.regr.FormulaProcessor>parseStr (line 663)
Unable to understand the character vector 'response ~1+cat(myfactor)*spl(mysplinepredictor,5)+mylinearcovariate'.

@behinger
Copy link
Member

behinger commented Jun 13, 2019

interactions with splines are currently not supported

Edit: One would need to specify the interaction manually:
for e = 1:length(EEG.event)
EEG.event(e).mysplinepredictor_factorA = EEG.event(e).mysplinepredictor.*double(EEG.event(e).myfactor=='FactorLevelA');
EEG.event(e).mysplinepredictor_factorB = EEG.event(e).mysplinepredictor.*double(EEG.event(e).myfactor=='FactorLevelB');

And then add the spline twice
spl(mysplinepredictor_factorA,5) + spl(mysplinepredictor_factorB,5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants