web/js/tests.js
// Transforms the output of a homoscedasticity test into HTML tables
Transforms the output of a homoscedasticity test into HTML tables
Transforms the output of a homoscedasticity test into HTML tables
function homocedasticity_table(data, test, alpha) {
    var salida = 
    "<div class=\"table-responsive\"><h2>Results</h2>\
		<a href=\"#\" onclick=\"exportTableToCSV.apply(this, [$('table'), $('input[name=test]:checked').val()+'.csv'])\"><button class=\"btn btn-default\"><span class=\"glyphicon glyphicon-export\"></span> CSV</button></a>&nbsp;&nbsp;\
		<a href=\"#\" onclick=\"exportTableToLaTeX.apply(this, [$('table'), $('input[name=test]:checked').val()+'.tex'])\"><button class=\"btn btn-default\"><span class=\"glyphicon glyphicon-export\"></span> LaTeX</button></a> \
		<table class=\"table table-hover table-striped\">\
			<caption>"+ $("input[value="+test+"]").parent().text() + " test (significance level of " + alpha + ")</caption>\
			<thead><tr><th>Statistic</th><th>p-value</th><th>Result</th></tr></thead>\
			<tbody><tr><td>" +data.statistic.toFixed(5)+ "</td><td>" +data.p_value.toFixed(5)+ "</td>";
    if (data.resultado == 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 homocedasticity_table ( data , test , alpha ) { var salida = "<div class=\"table-responsive\"><h2>Results</h2>\
		<a href=\"#\" onclick=\"exportTableToCSV.apply(this, [$('table'), $('input[name=test]:checked').val()+'.csv'])\"><button class=\"btn btn-default\"><span class=\"glyphicon glyphicon-export\"></span> CSV</button></a>&nbsp;&nbsp;\
		<a href=\"#\" onclick=\"exportTableToLaTeX.apply(this, [$('table'), $('input[name=test]:checked').val()+'.tex'])\"><button class=\"btn btn-default\"><span class=\"glyphicon glyphicon-export\"></span> LaTeX</button></a> \
		<table class=\"table table-hover table-striped\">\
			<caption>" + $ ( "input[value=" + test + "]" ) . parent ( ) . text ( ) + " test (significance level of " + alpha + ")</caption>\
			<thead><tr><th>Statistic</th><th>p-value</th><th>Result</th></tr></thead>\
			<tbody><tr><td>" + data . statistic . toFixed ( 5 ) + "</td><td>" + data . p_value . toFixed ( 5 ) + "</td>" ; if ( data . resultado == 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 homoscedasticity test into HTML tables
Transforms the output of a homoscedasticity test into HTML tables