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

Testing with two samples

If we assume that our data was drawn from normal distributions, the t-test can be used. For this test, we can use the statsmodels function, ttest_ind(). This is a more stable function from the package, and uses a different interface. So, here, we're going to test for a common mean.

Let's assume that your company has decided to stop outsourcing resistor production, and they're experimenting with different methods so that they can start producing resistors in-house. So, they have process A and process B, and they want you to test whether the mean resistance for these two processes is the same, or whether they're different. Therefore, you feel safe, assuming again that the resistance level of resistors is normally distributed regardless of whatever manufacturing process is employed, and you don't assume that they have the same standard deviation. Thus, the test statistic is as follows:

So, let's use this test statistic to perform your test:

Our first step is to load in the data, as follows:

Our next step is to load and define the ttest_ind function, as follows:

This will give us a p value. In this case, the value is 0.659this is a very large p value. It suggests that we should not reject the null hypothesis, and it appears that the two processes produce resistors with the same mean level of resistance.

主站蜘蛛池模板: 万源市| 东乡| 六安市| 祥云县| 茶陵县| 林周县| 喀喇沁旗| 探索| 清原| 保亭| 玛沁县| 永寿县| 井研县| 晴隆县| 商南县| 金阳县| 涪陵区| 云阳县| 仙桃市| 洱源县| 正阳县| 辽宁省| 安顺市| 岳阳市| 昌图县| 工布江达县| 万山特区| 越西县| 农安县| 呈贡县| 敦煌市| 原阳县| 正镶白旗| 郎溪县| 金华市| 普洱| 独山县| 博湖县| 东港市| 乐安县| 左贡县|