-
Notifications
You must be signed in to change notification settings - Fork 0
/
sigmaToPval.m
36 lines (33 loc) · 923 Bytes
/
sigmaToPval.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function p = sigmaToPval(diffvals, sig1, sig2)
%function p = sigmaToPval(diffvals, sig1, sig2)
%
% diffvals - (scalar) difference of the values
% sig1 - (scalar) error of the first value
% sig2 - (scalar) error of the second value
%
% Returns:
% p - (scalar) statistical significance (p-value)
%
% Description:
% returns p-value (ANOVA) based on difference and two errors.
% This is the basis for the ErrorNum significance calculation.
% Probably it is more intuitive to use ErrorNum instead of using this
% function directly.
%
% Example:
% value1 = 3;
% value2 = 10;
% error1 = 3;
% error2 = 2;
% p = sigmaToPval(value2 - value1, error1, error2)
% (returns 0.0522 or so).
%
% Requires:
% none
%
% Author: Shinya Ito
% University of California, Santa Cruz ([email protected])
%
% Created: ??
% Modified: 2020-05-13
p = erfc(abs(diffvals) ./ sqrt(2*(sig1.^2 + sig2.^2)));