官术网_书友最值得收藏!

Classical inference for means

We'll continue along a similar line to the previous section, in discussing classical statistical methods, but now in a new context. This section focuses on the mean of data that is quantitative, and not necessarily binary. We will demonstrate how to construct confidence intervals for the population mean, as well as several statistical tests that we can perform. Bear in mind throughout this section that we want to infer from a sample mean properties about a theoretical, unseen, yet fixed, population mean. We also want to compare the means of multiple populations, so as to determine whether they are the same or not.

When we assume that the population is a normal distribution, otherwise known as a classic bell curve, then we may use confidence intervals constructed using the t-distribution. These confidence intervals assume a normal distribution but tend to work well for large sample sizes even if the data is not normally distributed. In other words, these intervals tend to be robust. Unfortunately, statsmodels does not have a stable function with an easy user interface for competing these confidence intervals; however, there is a function, called _tconfint_generic(), that can compute them. You need to supply a lot of what this function needs to compute the confidence interval yourself. This means supplying the sample mean, the standard error of the mean, and the degrees of freedom, as shown in the following diagram:

As this looks like an unstable function, this procedure could change in future versions of statsmodels.

主站蜘蛛池模板: 惠东县| 邓州市| 东光县| 鄂托克旗| 那坡县| 大田县| 什邡市| 阳西县| 乳源| 宜丰县| 温宿县| 忻州市| 长春市| 正蓝旗| 莱芜市| 巴青县| 孟连| 北安市| 屏南县| 田阳县| 东兰县| 蓬莱市| 乐东| 札达县| 巨鹿县| 兴城市| 永康市| 沁水县| 尖扎县| 长宁县| 浦北县| 民乐县| 冕宁县| 菏泽市| 永和县| 龙山县| 永济市| 翼城县| 东源县| 察雅县| 伊金霍洛旗|