statsmodels.graphics.factorplots.interaction_plot(x, trace, response, func=<function mean>, ax=None, plottype='b', xlabel=None, ylabel=None, colors=None, markers=None, linestyles=None, legendloc='best', legendtitle=None, **kwargs)
[source]
Interaction plot for factor level statistics.
Note. If categorial factors are supplied levels will be internally recoded to integers. This ensures matplotlib compatiblity.
uses pandas.DataFrame to calculate an aggregate
statistic for each level of the factor or group given by trace
.
Parameters: |
|
---|---|
Returns: |
fig – The figure given by |
Return type: |
Figure |
>>> import numpy as np >>> np.random.seed(12345) >>> weight = np.random.randint(1,4,size=60) >>> duration = np.random.randint(1,3,size=60) >>> days = np.log(np.random.randint(1,30, size=60)) >>> fig = interaction_plot(weight, duration, days, ... colors=['red','blue'], markers=['D','^'], ms=10) >>> import matplotlib.pyplot as plt >>> plt.show()
(Source code, png, hires.png, pdf)
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.graphics.factorplots.interaction_plot.html