{"id":1139,"date":"2023-07-27T13:02:39","date_gmt":"2023-07-27T13:02:39","guid":{"rendered":"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/"},"modified":"2023-07-27T13:02:39","modified_gmt":"2023-07-27T13:02:39","slug":"generare-una-distribuzione-normale-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/","title":{"rendered":"Come generare una distribuzione normale in r (con esempi)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Puoi generare rapidamente una <a href=\"https:\/\/statorials.org\/it\/la-distribuzione-normale\/\" target=\"_blank\" rel=\"noopener noreferrer\">distribuzione normale<\/a> in R utilizzando la funzione <strong>rnorm()<\/strong> , che utilizza la seguente sintassi:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>rnorm(n, mean=0, sd=1)<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Oro:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>n:<\/strong> numero di osservazioni.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>media:<\/strong> media della distribuzione normale. Il valore predefinito \u00e8 0.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>sd:<\/strong> deviazione standard della distribuzione normale. Il valore predefinito \u00e8 1.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Questo tutorial mostra un esempio di utilizzo di questa funzione per generare una distribuzione normale in R.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Correlato:<\/strong> <a href=\"https:\/\/statorials.org\/it\/dnorm-pnorm-rnorm-qnorm-nella-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Una guida a dnorm, pnorm, qnorm e rnorm in R<\/a><\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Esempio: generare una distribuzione normale in R<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Il codice seguente mostra come generare una distribuzione normale in R:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#make this example reproducible\n<span style=\"color: #000000;\">set.seed(1)<\/span>\n\n#generate sample of 200 obs. that follows normal dist. with mean=10 and sd=3<\/span>\ndata &lt;- rnorm(200, mean=10, sd=3)\n\n<span style=\"color: #008080;\">#view first 6 observations in sample\n<\/span>head(data)\n\n[1] 8.120639 10.550930 7.493114 14.785842 10.988523 7.538595\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Possiamo trovare rapidamente la media e la deviazione standard di questa distribuzione:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#find mean of sample\n<span style=\"color: #000000;\">mean(data)\n\n[1] 10.10662\n<\/span>\n#find standard deviation of sample\n<span style=\"color: #000000;\">sd(data)\n\n[1] 2.787292\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Possiamo anche creare un rapido istogramma per visualizzare la distribuzione dei valori dei dati:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\">hist(data, col=' <span style=\"color: #008000;\">steelblue<\/span> ')\n<\/span><\/span><\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11442 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistr1.png\" alt=\"Generare una distribuzione normale in R\" width=\"452\" height=\"451\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Possiamo anche eseguire un <a href=\"https:\/\/statorials.org\/it\/test-shapiro-wilk-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">test di Shapiro-Wilk<\/a> per vedere se il set di dati proviene da una popolazione normale:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\">shapiro.test(data)\n\n\tShapiro-Wilk normality test\n\ndata:data\nW = 0.99274, p-value = 0.4272\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Il valore p del test risulta essere <strong>0,4272<\/strong> . Poich\u00e9 questo valore non \u00e8 inferiore a 0,05, possiamo supporre che i dati del campione provengano da una popolazione distribuita normalmente.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Questo risultato non dovrebbe sorprendere poich\u00e9 abbiamo generato i dati utilizzando la funzione <strong>rnorm()<\/strong> , che genera naturalmente un campione casuale di dati da una distribuzione normale.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Risorse addizionali<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/it\/tracciare-la-distribuzione-normale-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Come tracciare una distribuzione normale in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/dnorm-pnorm-rnorm-qnorm-nella-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Una guida a dnorm, pnorm, qnorm e rnorm in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/test-shapiro-wilk-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Come eseguire un test di Shapiro-Wilk per la normalit\u00e0 in R<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Puoi generare rapidamente una distribuzione normale in R utilizzando la funzione rnorm() , che utilizza la seguente sintassi: rnorm(n, mean=0, sd=1) Oro: n: numero di osservazioni. media: media della distribuzione normale. Il valore predefinito \u00e8 0. sd: deviazione standard della distribuzione normale. Il valore predefinito \u00e8 1. Questo tutorial mostra un esempio di utilizzo di [&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>Come generare una distribuzione normale in R (con esempi)<\/title>\n<meta name=\"description\" content=\"Questo tutorial spiega come generare una distribuzione normale in R, con diversi esempi.\" \/>\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\/generare-una-distribuzione-normale-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Come generare una distribuzione normale in R (con esempi)\" \/>\n<meta property=\"og:description\" content=\"Questo tutorial spiega come generare una distribuzione normale in R, con diversi esempi.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T13:02:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistr1.png\" \/>\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\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/\",\"url\":\"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/\",\"name\":\"Come generare una distribuzione normale in R (con esempi)\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/it\/#website\"},\"datePublished\":\"2023-07-27T13:02:39+00:00\",\"dateModified\":\"2023-07-27T13:02:39+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\"},\"description\":\"Questo tutorial spiega come generare una distribuzione normale in R, con diversi esempi.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Casa\",\"item\":\"https:\/\/statorials.org\/it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Come generare una distribuzione normale in r (con esempi)\"}]},{\"@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":"Come generare una distribuzione normale in R (con esempi)","description":"Questo tutorial spiega come generare una distribuzione normale in R, con diversi esempi.","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\/generare-una-distribuzione-normale-in-r\/","og_locale":"it_IT","og_type":"article","og_title":"Come generare una distribuzione normale in R (con esempi)","og_description":"Questo tutorial spiega come generare una distribuzione normale in R, con diversi esempi.","og_url":"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-27T13:02:39+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistr1.png"}],"author":"Benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Benjamin anderson","Est. reading time":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/","url":"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/","name":"Come generare una distribuzione normale in R (con esempi)","isPartOf":{"@id":"https:\/\/statorials.org\/it\/#website"},"datePublished":"2023-07-27T13:02:39+00:00","dateModified":"2023-07-27T13:02:39+00:00","author":{"@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae"},"description":"Questo tutorial spiega come generare una distribuzione normale in R, con diversi esempi.","breadcrumb":{"@id":"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/it\/generare-una-distribuzione-normale-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Casa","item":"https:\/\/statorials.org\/it\/"},{"@type":"ListItem","position":2,"name":"Come generare una distribuzione normale in r (con esempi)"}]},{"@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\/1139"}],"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=1139"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/1139\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/media?parent=1139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/categories?post=1139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/tags?post=1139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}