matlab - matlab如何测试测量值之间的显着差异?
问题描述
我有一个电子元件的输出样本,我想知道我的系统稳健的 p 值。理想情况下,我想得到一个 p 值(P<0.05)来证明我的系统可以不断产生相同的结果。请注意,我的数据样本很小。
我的输出:
sample=[2.180213,2.178298 ,2.310851 ,2.114255 ,3.012553 ,2.69234 ,2.079787];
我尝试使用:
[h,p] = chi2gof(sample,'CDF',pd)
[h,p,ci,stats] = ttest(x)
[h,p,stats] = fishertest(x)
[h,p,ksstat,cv] = kstest(___)
我搞不清楚了!我在 MATLAB 上执行什么样的测试来真正测试我的输出彼此之间的接近程度以及我的系统输出的一致性(使用 p 值)?
编辑:我试过这个:
sample=[2.180213,2.178298 ,2.310851 ,2.114255 ,3.012553 ,2.69234 ,2.079787];
n = numel(sample);
xobs = mean(sample); % Sample mean
s = std(sample); % Sample standard deviation
[h,p] = ttest(sample,xobs)
结果是:
h =
0
p =
1
我的数字有点接近,但结果没有意义。h = 0 表示均值为真且未被拒绝,但 p 值为 1!为什么这么高!
解决方案
我相信我想通了。我选择了一个任意平均值,这是我想要输出的理想值,并将其用作假设条件。
sample=[2.180213,2.178298 ,2.310851 ,2.114255 ,3.012553 ,2.69234 ,2.079787];
n = numel(sample);
xobs = mean(sample); % Sample mean
s = std(sample); % Sample standard deviation
[h,p] = ttest(sample,3)
推荐阅读
- p5.js - 在 for 循环中创建按钮,每个按钮在 p5 中都有不同的 mousePressed 函数
- python - 逻辑回归的沙普利?
- scala - 如何在 spark 1.6 中显示带有标签的不匹配报告 - scala 除了函数?
- flutter - 如何在颤振中处理 100vh?
- angular - 代码是否在区域中运行,如果是,为什么以及如何运行?
- python - Python / ete3:将最密切相关的叶子定位到系统发育树中的特定物种
- gitlab - 自动关闭过时的 GitLab 合并请求
- vue.js - VueJS 动态添加表单组件
- html - 为什么我在 iFrame oEmbed 中的链接在 Wordpress 中不起作用?
- excel - VBA:在单元格值实际更改时运行“Worksheet_Change Function”,而不是在没有任何更改的情况下进入和退出编辑模式