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_low : float

Minimum value of the mean for variable 1

m1_upp : float

Maximum value of the mean for variable 1

mu2_low : float

Minimum value of the mean for variable 2

mu2_upp : float

Maximum value of the mean for variable 2

step1 : float

Increment of evaluations for variable 1

step2 : float

Increment of evaluations for variable 2

levs : list

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

plot_dta : bool

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

var1_name : str

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

var2_name : str

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()