statsmodels.emplike.descriptive.DescStatMV.mv_mean_contour

DescStatMV.mv_mean_contour(mu1_low, mu1_upp, mu2_low, mu2_upp, step1, step2, levs=(0.001, 0.01, 0.05, 0.1, 0.2), var1_name=None, var2_name=None, plot_dta=False)[source]

Creates a confidence region plot for the mean of bivariate data

Parameters
m1_lowfloat

Minimum value of the mean for variable 1

m1_uppfloat

Maximum value of the mean for variable 1

mu2_lowfloat

Minimum value of the mean for variable 2

mu2_uppfloat

Maximum value of the mean for variable 2

step1float

Increment of evaluations for variable 1

step2float

Increment of evaluations for variable 2

levslist

Levels to be drawn on the contour plot. Default = (.001, .01, .05, .1, .2)

plot_dtabool

If True, makes a scatter plot of the data on top of the contour plot. Defaultis False.

var1_namestr

Name of variable 1 to be plotted on the x-axis

var2_namestr

Name of variable 2 to be plotted on the y-axis

Notes

The smaller the step size, the more accurate the intervals will be

If the function returns optimization failed, consider narrowing the boundaries of the plot

Examples

>>> import statsmodels.api as sm
>>> two_rvs = np.random.standard_normal((20,2))
>>> el_analysis = sm.emplike.DescStat(two_rvs)
>>> contourp = el_analysis.mv_mean_contour(-2, 2, -2, 2, .1, .1)
>>> contourp.show()