Borrar filtros
Borrar filtros

plotInteraction issue with categorical data...wtf?

6 visualizaciones (últimos 30 días)
Ben
Ben el 4 de Nov. de 2015
Comentada: Tom Lane el 11 de Nov. de 2015
after this: fitlm(X,y,'interactions','Categorical',[1],'RobustOpts','on') then the following are not working:
>> plotInteraction(ans,x1,x2) Undefined function or variable 'x1'.
SO
>> ans.CoefficientNames(2)
ans =
'x1_1'
OK
>> plotInteraction(ans,ans.CoefficientNames(2),ans.CoefficientNames(3)) Error using classreg.regr.FitObject/identifyVar (line 541) 'x1_1' is not a variable for this fit.
Error in LinearModel/plotInteraction (line 62) [vname1,vnum1] = identifyVar(model,var1);
BUT this does work for some odd reason (given that >> ans.Formula.VariableNames(1)
ans =
'x1'
):
>> plotInteraction(ans,ans.Formula.VariableNames(1),ans.Formula.VariableNames(2))
  2 comentarios
Ben
Ben el 4 de Nov. de 2015
what a stupid question, loser! thanks, schmuck!
Tom Lane
Tom Lane el 11 de Nov. de 2015
Not so sure this is a stupid question. The plotInteraction function wants to treat X1 as a single term, and does not expect a name like X1_1 which represents the coefficients of just one category.

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by