Skip to content

Commit

Permalink
initial comit
Browse files Browse the repository at this point in the history
  • Loading branch information
ramesh8v committed Jun 26, 2018
1 parent 53d63c0 commit bfd0593
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions js/compute_p_val.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const alpha = 3.656;
const beta = 1.089;
const z_table = {'-3.4':0.003, "-3.3":0.005, "-3.2":0.007, "-3.1":0.0010,
"-3.0": 0.0013, "-2.9":0.0019, "-2.8":0.0026, "-2.7":0.0035, "-2.6":0.0047,
"-2.5":0.0062, "-2.4":0.0082, "-2.3":0.0107, "-2.2": 0.139, "-2.1":0.0179,
"-2.0":0.0228, "-1.9":0.0287, "-1.8":0.0359, "-1.7":0.0446, "-1.6":0.0548,
"-1.5":0.0668, "-1.4":0.0808, "-1.3":0.0968, "-1.2":0.1151, "-1.1":0.1357,
"-1.0":0.1587, "-0.9":0.1841, "-0.8":0.2119, "-0.7":0.2420, "-0.6":0.2743,
"-0.5":0.3085 ,"0.4":0.3446, "0.3":0.3821, "0.2":0.4207, "0.1":0.4602,
"0.0":0.5000
};
function computepval(){
console.log("running");
let irr = document.getElementById("irr").value;
let srr = document.getElementById("srr").value;
let ipos = document.getElementById("ipos").value;
let spos = document.getElementById("spos").value;
let rr = Math.abs(irr - srr)/2;
let sigma = Math.pow((alpha+beta*rr), 2);
let dif = Math.abs(ipos-spos);
let phi_func = dif/Math.sqrt(2*sigma);

console.log("Phi value", phi_func);
}

0 comments on commit bfd0593

Please sign in to comment.