()
| 108 | } |
| 109 | |
| 110 | public double pValue() |
| 111 | { |
| 112 | |
| 113 | double tScore = (sampleMean - hypothMean)*Math.sqrt(sampleSize)/sampleDev; |
| 114 | |
| 115 | if(h1 == H1.NOT_EQUAL) |
| 116 | return tDist.cdf(-Math.abs(tScore))*2; |
| 117 | else if(h1 == H1.LESS_THAN) |
| 118 | return tDist.cdf(tScore); |
| 119 | else |
| 120 | return 1-tDist.cdf(tScore); |
| 121 | } |
| 122 | |
| 123 | } |