{"id":3905,"date":"2023-07-14T20:50:46","date_gmt":"2023-07-14T20:50:46","guid":{"rendered":"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/"},"modified":"2023-07-14T20:50:46","modified_gmt":"2023-07-14T20:50:46","slug":"lineaire-hypothese-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/","title":{"rendered":"Hoe de linearhypothese()-functie in r te gebruiken"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">U kunt de functie <strong>LinearHypothese()<\/strong> uit het <strong>car-<\/strong> pakket in R gebruiken om lineaire hypothesen in een specifiek regressiemodel te testen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Deze functie gebruikt de volgende basissyntaxis:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>linearHypothesis(fit, c(\" <span style=\"color: #ff0000;\">var1=0<\/span> \", \" <span style=\"color: #ff0000;\">var2=0<\/span> \"))<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Dit specifieke voorbeeld test of de regressieco\u00ebffici\u00ebnten <strong>var1<\/strong> en <strong>var2<\/strong> in het model dat <strong>fit<\/strong> wordt genoemd gezamenlijk gelijk zijn aan nul.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Het volgende voorbeeld laat zien hoe u deze functie in de praktijk kunt gebruiken.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld: hoe u de functie LinearHypothese() in R gebruikt<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Stel dat we het volgende gegevensframe in R hebben dat het aantal uren aan studeren toont, het aantal afgelegde oefenexamens en de eindexamenscore van 10 studenten in een klas:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create data frame\n<\/span>df &lt;- data.frame(score=c(77, 79, 84, 85, 88, 99, 95, 90, 92, 94),\n                 hours=c(1, 1, 2, 3, 2, 4, 4, 2, 3, 3),\n                 prac_exams=c(2, 4, 4, 2, 4, 5, 4, 3, 2, 1))\n\n<span style=\"color: #008080;\">#view data frame\n<\/span>df\n\n   score hours prac_exams\n1 77 1 2\n2 79 1 4\n3 84 2 4\n4 85 3 2\n5 88 2 4\n6 99 4 5\n7 95 4 4\n8 90 2 3\n9 92 3 2\n10 94 3 1\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Stel nu dat we het volgende meervoudige lineaire regressiemodel in R willen passen:<\/span><\/p>\n<p> <span style=\"color: #000000;\">Examenscore = \u03b2 <sub>0<\/sub> + \u03b2 <sub>1<\/sub> (uren) + \u03b2 <sub>2<\/sub> (praktijkexamens)<\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen de functie <a href=\"https:\/\/statorials.org\/nl\/lm-functie-in-r\/\" target=\"_blank\" rel=\"noopener\">lm()<\/a> gebruiken om dit model aan te passen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#fit multiple linear regression model\n<\/span>fit &lt;- lm(score ~ hours + prac_exams, data=df)\n\n<span style=\"color: #008080;\">#view summary of model\n<\/span>summary(fit)\n\nCall:\nlm(formula = score ~ hours + prac_exams, data = df)\n\nResiduals:\n    Min 1Q Median 3Q Max \n-5.8366 -2.0875 0.1381 2.0652 4.6381 \n\nCoefficients:\n            Estimate Std. Error t value Pr(&gt;|t|)    \n(Intercept) 72.7393 3.9455 18.436 3.42e-07 ***\nhours 5.8093 1.1161 5.205 0.00125 ** \nprac_exams 0.3346 0.9369 0.357 0.73150    \n---\nSignificant. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n\nResidual standard error: 3.59 on 7 degrees of freedom\nMultiple R-squared: 0.8004, Adjusted R-squared: 0.7434 \nF-statistic: 14.03 on 2 and 7 DF, p-value: 0.003553\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Stel nu dat we willen testen of de <strong>urenco\u00ebffici\u00ebnt<\/strong> en <strong>de oefenexamens<\/strong> beide nul zijn.<\/span><\/p>\n<p> <span style=\"color: #000000;\">We kunnen hiervoor de functie <strong>LinearHypothese()<\/strong> gebruiken:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">library<\/span> (car)\n\n<span style=\"color: #008080;\">#perform hypothesis test for hours=0 and prac_exams=0\n<\/span>linearHypothesis(fit, c(\" <span style=\"color: #ff0000;\">hours=0<\/span> \", \" <span style=\"color: #ff0000;\">prac_exams=0<\/span> \"))\n\nLinear hypothesis testing\n\nHypothesis:\nhours = 0\nprac_exams = 0\n\nModel 1: restricted model\nModel 2: score ~ hours + prac_exams\n\n  Res.Df RSS Df Sum of Sq F Pr(&gt;F)   \n1 9 452.10                                \n2 7 90.24 2 361.86 14.035 0.003553 **\n---\nSignificant. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De hypothesetest retourneert de volgende waarden:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>F-teststatistiek<\/strong> : 14.035<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>p-waarde<\/strong> : .003553<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Deze specifieke hypothesetest maakt gebruik van de volgende nul- en alternatieve hypothesen:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>H <sub>0<\/sub><\/strong> : Beide regressieco\u00ebffici\u00ebnten zijn gelijk aan nul.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>H <sub>A<\/sub><\/strong> : Minstens \u00e9\u00e9n regressieco\u00ebffici\u00ebnt is niet gelijk aan nul.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Omdat de p-waarde van de test (0,003553) kleiner is dan 0,05, verwerpen we de nulhypothese.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Met andere woorden: we hebben niet genoeg bewijs om te zeggen dat de regressieco\u00ebffici\u00ebnten voor <strong>uren<\/strong> en <strong>praktijkexamens<\/strong> beide gelijk zijn aan nul.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">De volgende zelfstudies bieden aanvullende informatie over lineaire regressie in R:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/interpreteer-de-regressie-uitvoer-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe regressie-uitvoer in R te interpreteren<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/eenvoudige-lineaire-regressie-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe eenvoudige lineaire regressie uit te voeren in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/meervoudige-lineaire-regressie-r\/\" target=\"_blank\" rel=\"noopener\">Hoe meervoudige lineaire regressie uit te voeren in R<\/a><br \/> Hoe logistische regressie uit te voeren in R<\/p>\n","protected":false},"excerpt":{"rendered":"<p>U kunt de functie LinearHypothese() uit het car- pakket in R gebruiken om lineaire hypothesen in een specifiek regressiemodel te testen. Deze functie gebruikt de volgende basissyntaxis: linearHypothesis(fit, c(&#8220; var1=0 &#8222;, &#8220; var2=0 &#8222;)) Dit specifieke voorbeeld test of de regressieco\u00ebffici\u00ebnten var1 en var2 in het model dat fit wordt genoemd gezamenlijk gelijk zijn aan [&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":[],"class_list":["post-3905","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Hoe u de functie LinearHypothese() gebruikt in R - Statorials<\/title>\n<meta name=\"description\" content=\"In deze zelfstudie wordt uitgelegd hoe u de functie LinearHypothese() in R kunt gebruiken om lineaire hypothesen op regressiemodellen te testen.\" \/>\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\/nl\/lineaire-hypothese-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe u de functie LinearHypothese() gebruikt in R - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze zelfstudie wordt uitgelegd hoe u de functie LinearHypothese() in R kunt gebruiken om lineaire hypothesen op regressiemodellen te testen.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-14T20:50:46+00:00\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/\",\"url\":\"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/\",\"name\":\"Hoe u de functie LinearHypothese() gebruikt in R - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-14T20:50:46+00:00\",\"dateModified\":\"2023-07-14T20:50:46+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze zelfstudie wordt uitgelegd hoe u de functie LinearHypothese() in R kunt gebruiken om lineaire hypothesen op regressiemodellen te testen.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe de linearhypothese()-functie in r te gebruiken\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hoe u de functie LinearHypothese() gebruikt in R - Statorials","description":"In deze zelfstudie wordt uitgelegd hoe u de functie LinearHypothese() in R kunt gebruiken om lineaire hypothesen op regressiemodellen te testen.","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\/nl\/lineaire-hypothese-r\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe u de functie LinearHypothese() gebruikt in R - Statorials","og_description":"In deze zelfstudie wordt uitgelegd hoe u de functie LinearHypothese() in R kunt gebruiken om lineaire hypothesen op regressiemodellen te testen.","og_url":"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/","og_site_name":"Statorials","article_published_time":"2023-07-14T20:50:46+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/","url":"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/","name":"Hoe u de functie LinearHypothese() gebruikt in R - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-14T20:50:46+00:00","dateModified":"2023-07-14T20:50:46+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze zelfstudie wordt uitgelegd hoe u de functie LinearHypothese() in R kunt gebruiken om lineaire hypothesen op regressiemodellen te testen.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/lineaire-hypothese-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe de linearhypothese()-functie in r te gebruiken"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/3905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=3905"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/3905\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=3905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=3905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=3905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}