{"id":743,"date":"2023-07-28T22:03:44","date_gmt":"2023-07-28T22:03:44","guid":{"rendered":"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/"},"modified":"2023-07-28T22:03:44","modified_gmt":"2023-07-28T22:03:44","slug":"un-calcolatore-del-test-t-di-esempio","status":"publish","type":"post","link":"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/","title":{"rendered":"Un esempio di calcolatore del test t"},"content":{"rendered":"<p><script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/mathjs\/5.1.1\/math.js\"><\/script><script src=\"https:\/\/cdn.jsdelivr.net\/npm\/jstat@latest\/dist\/jstat.min.js\"><\/script><\/p>\n<style>\n@import url('https:\/\/fonts.googleapis.com\/css?family=Droid+Serif|Raleway');<\/p>\n<p>.axis--y .domain {\n  display: none;\n}<\/p>\n<p>h1 {\ntext-align: center;\nfont-size: 50px;\nmargin-bottom: 0px;\nfont-family: 'Raleway', serif;\n}<\/p>\n<p>p {\ncolor: black;\nmargin-bottom: 15px;\nmargin-top: 15px;\nfont-family: 'Raleway', sans-serif;\n}<\/p>\n<p>#words {\ncolor: black;\nfont-family: Raleway;\nmax-width: 550px;\nmargin: 25px auto;\nline-height: 1.75;\npadding-left: 100px;\n}<\/p>\n<p>#words_calc {\ncolor: black;\nfont-family: Raleway;\nmax-width: 550px;\nmargin: 25px auto;\nline-height: 1.75;\npadding-left: 100px;\n}<\/p>\n<p>#words_calc input {\n    display: inline-block;\n    vertical-align: baseline;\n    width: 350px;\n    max-height: 35px;\n}<\/p>\n<p>#hr_top {\nwidth: 30%;\nmargin-bottom: 0px;\nborder: none;\nheight: 2px;\ncolor: black;\nbackground-color: black;\n}<\/p>\n<p>#hr_bottom {\nwidth: 30%;\nmargin-top: 15px;\nborder: none;\nheight: 2px;\ncolor: black;\nbackground-color: black;\n}<\/p>\n<p>#words label, #words input {\n    display: inline-block;\n    vertical-align: baseline;\n    width: 350px;\n    max-height: 35px;\n}<\/p>\n<p>    #buttonCalc {\n      border: 1px solid;\n      border-radius: 10px;\n      margin-top: 20px;\n      padding: 10px 10px;\n      cursor: pointer;\n      outline: none;\n      background-color: white;\n      color: black;\n      font-family: 'Work Sans', sans-serif;\n      border: 1px solid grey;\n      \/* Green *\/\n    }<\/p>\n<p>    #buttonCalc:hover {\n      background-color: #f6f6f6;\n      border: 1px solid black;\n    }<\/p>\n<p>#words_output {\ntext-align: center;\n}<\/p>\n<p>#solution_div {\ntext-align: center;\n}<\/p>\n<p>#words_intro {\ncolor: black;\nfont-family: Raleway;\nmax-width: 550px;\nmargin: 25px auto;\nline-height: 1.75;\n}<\/p>\n<p>#words_table {\ncolor: black;\nfont-family: Raleway;\nmax-width: 350px;\nmargin: 25px auto;\nline-height: 1.75;\n}\n.label_radio {\ntext-align: center;\n}\n<\/style>\n<div id=\"words_intro\">Un <b>test t su un campione<\/b> viene utilizzato per verificare se la media di una popolazione \u00e8 uguale o meno a un determinato valore.<\/div>\n<div id=\"words_intro\"> Per eseguire un test t per un campione, \u00e8 sufficiente inserire le informazioni seguenti e quindi fare clic sul pulsante &#8220;Calcola&#8221;.<\/div>\n<div id=\"words\"> <label class=\"label_radio\" for=\"raw\">Inserisci i dati grezzi<\/label><input type=\"radio\" id=\"raw\" name=\"tails\" onclick=\"check()\" checked=\"\"> <label class=\"label_radio\" for=\"summary\">Inserisci i dati di riepilogo<\/label> <input type=\"radio\" id=\"summary\" name=\"tails\" onclick=\"check()\"><\/div>\n<div id=\"words_table\"><textarea id=\"rawData\" rows=\"5\" cols=\"40\"> 301, 298, 295, 297, 304, 305, 309, 298, 291, 299, 293, 304<\/textarea><\/div>\n<div id=\"summary_table\">\n<div id=\"words\"> <label><b><span style=\"text-decoration:overline\">x<\/span><\/b> (media campionaria)<\/label><input type=\"number\" id=\"x\" value=\"300\"><\/div>\n<div id=\"words\"> <label><b>s<\/b> (deviazione standard del campione)<\/label><input type=\"number\" id=\"s\" value=\"18.5\"><\/div>\n<div id=\"words\"> <label><b>n<\/b> (dimensione del campione)<\/label><input type=\"number\" id=\"n\" value=\"40\"><\/div>\n<\/div>\n<div id=\"words\"> <label><b>\u03bc <sub>0<\/sub><\/b> (media ipotetica della popolazione)<\/label> <input type=\"number\" id=\"mu\" value=\"310\"><\/div>\n<div id=\"words_calc\"><input class=\"input_label_calc\" type=\"button\" id=\"buttonCalc\" onclick=\"calc()\" value=\"Calculate\"><\/div>\n<div id=\"words\">\n<p> <b>t =<\/b> <span id=\"t\">0,3232<\/span><\/p>\n<\/div>\n<div id=\"words\">\n<p> <b>df =<\/b> <span id=\"df\">39<\/span><\/p>\n<\/div>\n<div id=\"words\">\n<p> <b>valore p (unilaterale) =<\/b> <span id=\"p1\">0,1245<\/span><\/p>\n<\/div>\n<div id=\"words\">\n<p> <b>valore p (2 lati) =<\/b> <span id=\"p2\">0,3232<\/span><\/p>\n<\/div>\n<p><script><\/p>\n<p>\/\/set summary table to hidden to start\nvar summary_display = document.getElementById(\"summary_table\");\nsummary_display.style.display = \"none\";<\/p>\n<p>\/\/find which radio button is checked\nfunction check() {\nif (document.getElementById('raw').checked) {\n\tvar table_display = document.getElementById(\"words_table\");\n        table_display.style.display = \"block\";\n        var summary_display = document.getElementById(\"summary_table\");\n        summary_display.style.display = \"none\";\n\t} else {\n\tvar table_display = document.getElementById(\"words_table\");\n        table_display.style.display = \"none\";\n        var summary_display = document.getElementById(\"summary_table\");\n        summary_display.style.display = \"block\";\n\t}<\/p>\n<p>} \/\/end check<\/p>\n<p>\/\/perform one-sample t-test\nfunction calc() {\nif (document.getElementById('summary').checked) {\nvar mu = +document.getElementById('mu').value;\nvar x = +document.getElementById('x').value;\nvar s = +document.getElementById('s').value;\nvar n = +document.getElementById('n').value;<\/p>\n<p>var t = (x-mu)\/(s\/Math.sqrt(n));\nvar df = n-1;\nif (t<0) {\nvar p1 = jStat.studentt.cdf(t, df);\nvar p2 = p1*2;\n} else {\nvar p1 = 1-jStat.studentt.cdf(t, df);\nvar p2 = p1*2;\n}\n\ndocument.getElementById('t').innerHTML = t.toFixed(6);\ndocument.getElementById('df').innerHTML = df;\ndocument.getElementById('p1').innerHTML = p1.toFixed(6);\ndocument.getElementById('p2').innerHTML = p2.toFixed(6);\n\t} else {\nvar raw = document.getElementById('rawData').value.split(',').map(Number);\nvar mu = +document.getElementById('mu').value;\nvar x = math.mean(raw)\nvar s = math.std(raw)\nvar n = raw.length;\n\nvar t = (x-mu)\/(s\/Math.sqrt(n));\nvar df = n-1;\nif (t<0) {\nvar p1 = jStat.studentt.cdf(t, df);\nvar p2 = p1*2;\n} else {\nvar p1 = 1-jStat.studentt.cdf(t, df);\nvar p2 = p1*2;\n}\n\ndocument.getElementById('t').innerHTML = t.toFixed(6);\ndocument.getElementById('df').innerHTML = df;\ndocument.getElementById('p1').innerHTML = p1.toFixed(6);\ndocument.getElementById('p2').innerHTML = p2.toFixed(6);\n\t}\n\n\/\/output results\n}\n\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Un test t su un campione viene utilizzato per verificare se la media di una popolazione \u00e8 uguale o meno a un determinato valore. Per eseguire un test t per un campione, \u00e8 sufficiente inserire le informazioni seguenti e quindi fare clic sul pulsante &#8220;Calcola&#8221;. Inserisci i dati grezzi Inserisci i dati di riepilogo 301, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Calcolatore del test t per un campione - Statorials<\/title>\n<meta name=\"description\" content=\"Questa calcolatrice esegue un test t per un campione in base agli input forniti dall&#039;utente.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Calcolatore del test t per un campione - Statorials\" \/>\n<meta property=\"og:description\" content=\"Questa calcolatrice esegue un test t per un campione in base agli input forniti dall&#039;utente.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-28T22:03:44+00:00\" \/>\n<meta name=\"author\" content=\"Benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin anderson\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/\",\"url\":\"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/\",\"name\":\"Calcolatore del test t per un campione - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/it\/#website\"},\"datePublished\":\"2023-07-28T22:03:44+00:00\",\"dateModified\":\"2023-07-28T22:03:44+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\"},\"description\":\"Questa calcolatrice esegue un test t per un campione in base agli input forniti dall&#39;utente.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Casa\",\"item\":\"https:\/\/statorials.org\/it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Un esempio di calcolatore del test t\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/it\/#website\",\"url\":\"https:\/\/statorials.org\/it\/\",\"name\":\"Statorials\",\"description\":\"La tua guida all&#039;alfabetizzazione statistica!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/it\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\",\"name\":\"Benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Benjamin anderson\"},\"description\":\"Ciao, sono Benjamin, un professore di statistica in pensione diventato insegnante dedicato di Statorials. Con una vasta esperienza e competenza nel campo della statistica, sono ansioso di condividere le mie conoscenze per potenziare gli studenti attraverso Statorials. Scopri di pi\u00f9\",\"sameAs\":[\"https:\/\/statorials.org\/it\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Calcolatore del test t per un campione - Statorials","description":"Questa calcolatrice esegue un test t per un campione in base agli input forniti dall&#39;utente.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/","og_locale":"it_IT","og_type":"article","og_title":"Calcolatore del test t per un campione - Statorials","og_description":"Questa calcolatrice esegue un test t per un campione in base agli input forniti dall&#39;utente.","og_url":"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/","og_site_name":"Statorials","article_published_time":"2023-07-28T22:03:44+00:00","author":"Benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Benjamin anderson"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/","url":"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/","name":"Calcolatore del test t per un campione - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/it\/#website"},"datePublished":"2023-07-28T22:03:44+00:00","dateModified":"2023-07-28T22:03:44+00:00","author":{"@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae"},"description":"Questa calcolatrice esegue un test t per un campione in base agli input forniti dall&#39;utente.","breadcrumb":{"@id":"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/it\/un-calcolatore-del-test-t-di-esempio\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Casa","item":"https:\/\/statorials.org\/it\/"},{"@type":"ListItem","position":2,"name":"Un esempio di calcolatore del test t"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/it\/#website","url":"https:\/\/statorials.org\/it\/","name":"Statorials","description":"La tua guida all&#039;alfabetizzazione statistica!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/it\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"it-IT"},{"@type":"Person","@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae","name":"Benjamin anderson","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Benjamin anderson"},"description":"Ciao, sono Benjamin, un professore di statistica in pensione diventato insegnante dedicato di Statorials. Con una vasta esperienza e competenza nel campo della statistica, sono ansioso di condividere le mie conoscenze per potenziare gli studenti attraverso Statorials. Scopri di pi\u00f9","sameAs":["https:\/\/statorials.org\/it"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/743"}],"collection":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/comments?post=743"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/743\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/media?parent=743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/categories?post=743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/tags?post=743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}