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

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.

主站蜘蛛池模板: 利辛县| 绵竹市| 池州市| 盱眙县| 西乌| 马龙县| 曲周县| 桑日县| 衡阳县| 双城市| 南宁市| 保定市| 舟山市| 水富县| 芮城县| 临海市| 淮北市| 台前县| 石棉县| 称多县| 阜城县| 沂南县| 三明市| 社旗县| 札达县| 金昌市| 皮山县| 贵定县| 富宁县| 商河县| 昌图县| 元江| 镇康县| 惠州市| 横峰县| 兰西县| 彰化市| 毕节市| 孟津县| 鞍山市| 丹寨县|