Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing more significant digits for p-value. Showing chi-squared, t-… #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions grails-app/services/ChartService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class ChartService {
def double [] t = (double[])result[2].conceptData.toArray()

result.commons.tstat = TestUtils.t(o, t).round(5)
result.commons.pvalue = TestUtils.tTest(o, t).round(5)
result.commons.pvalue = String.format("%1.3e", TestUtils.tTest(o, t))
result.commons.significance = TestUtils.tTest(o, t, 0.05)

if (result.commons.significance)
Expand Down Expand Up @@ -270,7 +270,7 @@ class ChartService {
def double [] t = (double[])result[2].conceptData.toArray()

result.commons.tstat = TestUtils.t(o, t).round(5)
result.commons.pvalue = TestUtils.tTest(o, t).round(5)
result.commons.pvalue = String.format("%1.3e", TestUtils.tTest(o, t))
result.commons.significance = TestUtils.tTest(o, t, 0.05)

if (result.commons.significance)
Expand Down Expand Up @@ -322,7 +322,7 @@ class ChartService {
def long [][] counts = [result[1].conceptData.values(), result[2].conceptData.values()]

result.commons.chisquare = TestUtils.chiSquare(counts).round(5)
result.commons.pvalue = TestUtils.chiSquareTest(counts).round(5)
result.commons.pvalue = String.format("%1.3e", TestUtils.chiSquareTest(counts))
result.commons.significance = TestUtils.chiSquareTest(counts, 0.05)

if (result.commons.significance)
Expand Down
16 changes: 13 additions & 3 deletions grails-app/views/chart/_conceptsAnalysis.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,24 @@
<g:if test="${concept.value?.commons?.omics_params != null}">
<div class="analysissubtitle">${concept.value?.commons?.conceptKey ?: ""}</div>
</g:if>
<div style="margin-top: -15px; padding-bottom: 10px;">
<div style="margin-top: -15px; padding-bottom: 10px; font-size: 12px;">
${concept.value?.commons?.testmessage}<br/>
<g:if test="${concept.value?.commons.pvalue != null}">
<g:if test="${concept.value?.commons.tstat != null && concept.value?.commons.tstat != Double.NaN}">
With a <i>p-value of ${concept.value?.commons.pvalue}</i> for a <i>T-stat at ${concept.value?.commons.tstat}</i>
<table class="stats_table">
<tr><td><span class="stats_title">p-value</span></td>
<td>${concept.value?.commons.pvalue}</td>
</tr>
<tr><td><span class="stats_title">t-statistic</span></td>
<td>${concept.value?.commons.tstat}</td>
</tr>
</table>
</g:if>
<g:elseif test="${concept.value?.commons.chisquare != null && concept.value?.commons.chisquare != Double.NaN}">
With a <i>p-value of ${concept.value?.commons.pvalue}</i> for a <i>χ² at ${concept.value?.commons.chisquare}</i>
<table class="stats_table">
<tr><td><span class="stats_title">p-Value</span></td><td>${concept.value?.commons.pvalue}</td></tr>
<tr><td><span class="stats_title">χ²</span></td><td>${concept.value?.commons.chisquare}</td></tr>
</table>
</g:elseif>
<g:else>
Variable arithmetically undefined <i>(NaN)</i>
Expand Down
14 changes: 14 additions & 0 deletions web-app/css/datasetExplorer.css
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,20 @@ div.analysissubtitle {
margin-bottom: 15px;
}

table.stats_table {
margin-top: 5px;
border-collapse: collapse;
}

table.stats_table td {
border: 1px solid black;
padding: 5px;
}

.stats_title {
font-weight: bold;
}

div.smalltitle {
padding-bottom: 5px !important;
}
Expand Down