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

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.

主站蜘蛛池模板: 锦屏县| 清镇市| 越西县| 丘北县| 永福县| 宁都县| 太湖县| 调兵山市| 阳原县| 阿坝县| 罗源县| 凤山市| 汉源县| 呼玛县| 若羌县| 遂平县| 湟源县| 徐闻县| 乌兰县| 唐山市| 边坝县| 博客| 安溪县| 沈丘县| 定结县| 靖边县| 格尔木市| 峨眉山市| 会同县| 云梦县| 团风县| 四会市| 宿迁市| 河北区| 聂拉木县| 铁岭市| 庆城县| 简阳市| 太仆寺旗| 山阴县| 庄浪县|