web/js/tests.js
// Transforms the output of a normality test into HTML tables
Transforms the output of a normality test into HTML tables
Transforms the output of a normality test into HTML tables
function normality_table(data, names, test, alpha) {
    var salida = 
    "<div class=\"table-responsive\"><h2>Results</h2>\
        <a href=\"#modal_export\" data-toggle=\"modal\"><button class=\"btn btn-default\"><span class=\"glyphicon glyphicon-export\"></span>Export</button></a>\
		<table class=\"table table-hover table-striped\">\
				<caption>"+ $("input[value="+test+"]").parent().text() + " test (significance level of " + alpha + ")</caption>\
				<thead>\
					<tr>\
						<th>Dataset</th>";
    salida = salida + "<th>Statistic</th><th>p-value</th><th>Result</th></thead><tbody>";
    $.each(data.p_value, function(index, value) {
        salida = salida + "<tr><td>" + names[index] + "</td><td>" + data.statistic[index].toFixed(5) + "</td><td>" + data.p_value[index].toFixed(5) + "</td>";
        if(data.result[index] == true)
            salida = salida + "<td>H0 is rejected</td></tr>";
        else
            salida = salida + "<td>H0 is accepted</td></tr>";
    });
	salida = salida + "</tbody></table></div>";
    return salida;
}
function normality_table ( data , names , test , alpha ) { var salida = "<div class=\"table-responsive\"><h2>Results</h2>\
        <a href=\"#modal_export\" data-toggle=\"modal\"><button class=\"btn btn-default\"><span class=\"glyphicon glyphicon-export\"></span>Export</button></a>\
		<table class=\"table table-hover table-striped\">\
				<caption>" + $ ( "input[value=" + test + "]" ) . parent ( ) . text ( ) + " test (significance level of " + alpha + ")</caption>\
				<thead>\
					<tr>\
						<th>Dataset</th>" ; salida = salida + "<th>Statistic</th><th>p-value</th><th>Result</th></thead><tbody>" ; $ . each ( data . p_value , function ( index , value ) { salida = salida + "<tr><td>" + names [ index ] + "</td><td>" + data . statistic [ index ] . toFixed ( 5 ) + "</td><td>" + data . p_value [ index ] . toFixed ( 5 ) + "</td>" ; if ( data . result [ index ] == true ) salida = salida + "<td>H0 is rejected</td></tr>" ; else salida = salida + "<td>H0 is accepted</td></tr>" ; } ) ; salida = salida + "</tbody></table></div>" ; return salida ; }
Transforms the output of a normality test into HTML tables
Transforms the output of a normality test into HTML tables