{"id":2253,"date":"2018-03-01T15:44:59","date_gmt":"2018-03-01T10:14:59","guid":{"rendered":"http:\/\/stepbystepschools.net\/?p=2253"},"modified":"2018-03-01T15:44:59","modified_gmt":"2018-03-01T10:14:59","slug":"data-science-training-in-mumbai-using-poisson-regression-with-r-programming-in-visual-studio","status":"publish","type":"post","link":"https:\/\/www.stepbystepschools.net\/?p=2253","title":{"rendered":"Data Science Training in Mumbai : &#8211; Using Poisson Regression with R Programming in Visual Studio."},"content":{"rendered":"<p>Poisson regression in statistics is a generalized linear model which forms of regression analysis used to model count data and contingency tables.<\/p>\n<p>The response variable Y being a Poisson distribution is assumed by Poisson regression hence assumes the logarithm of its expected value can be modelled by a general linear combination with unknown parameters.<\/p>\n<p>The Poisson regression model which may sometimes also be known as a log-linear model and specially when it is used to model contingency tables.<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png\" rel=\"attachment wp-att-2256\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png\" alt=\"1\" width=\"602\" height=\"323\" class=\"aligncenter size-full wp-image-2256\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-300x161.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<p>The Poisson Regression in mathematics involves regression models in which the response variable is in the form of counts but not fractional numbers.<\/p>\n<p>For a simple example we can count the number of births or number of wins in a cricket or any other game series.<\/p>\n<p>The equation for Poisson regression in mathematics can be given as:<\/p>\n<p><span style=\"background-color: #C0C0C0\">log(y) = a + b1x1 + b2x2 + bnxn&#8230;..<\/span><\/p>\n<p>Where<\/p>\n<p><b>y :<\/b>It is the response variable.<\/p>\n<p><b>a ,b :<\/b>They are the numeric coefficients.<\/p>\n<p><b>x :<\/b>It is the predictor variable.<\/p>\n<p>The Poisson regression model is created using the glm() function.<\/p>\n<p>The glm() function is the basic syntax for Poisson regression is &#8722;<br \/>\n<span style=\"background-color: #C0C0C0\">glm(formula,data,family)<\/span>\n<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/2.png\" rel=\"attachment wp-att-2257\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/2.png\" alt=\"2\" width=\"627\" height=\"207\" class=\"alignleft size-full wp-image-2257\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/2.png 627w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/2-300x99.png 300w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><\/a><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p>To create and run our R program in Visual Studio we must first install some tools.<\/p>\n<p>Now open Visual Studio on your pc and then click on Get Tools and features&#8230; inside Tools.<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/3.png\" rel=\"attachment wp-att-2258\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/3.png\" alt=\"3\" width=\"602\" height=\"61\" class=\"alignleft size-full wp-image-2258\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/3.png 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/3-300x30.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><br \/>\n<\/br><\/p>\n<p>Now in the feature installation window check and install the following features<\/p>\n<p>For Visual Studio 2017<\/p>\n<p>Contains Tools for Data Science<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/4.png\" rel=\"attachment wp-att-2259\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/4.png\" alt=\"4\" width=\"403\" height=\"86\" class=\"alignleft size-full wp-image-2259\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/4.png 403w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/4-300x64.png 300w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/a><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p>After this please install R tools from the following link if the above package is not installed properly from the following link<\/p>\n<p>But it is not necessary<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/rtvs\/installing-r-tools-for-visual-studio\">https:\/\/docs.microsoft.com\/en-us\/visualstudio\/rtvs\/installing-r-tools-for-visual-studio<\/a><\/p>\n<p>You can also install R programming tool go to the following link for better support and download the software and install it<\/p>\n<p><b>For Windows Users:<\/b><\/p>\n<p><a target=\"_blank\" href=\"https:\/\/ftp.iitm.ac.in\/cran\/\">https:\/\/ftp.iitm.ac.in\/cran\/<\/a><\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/5.png\" rel=\"attachment wp-att-2260\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/5.png\" alt=\"5\" width=\"602\" height=\"118\" class=\"alignleft size-full wp-image-2260\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/5.png 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/5-300x59.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p><b>For Linux Users:<\/b><\/p>\n<p>If you are on Linux platform then you can use this fast and easy command used in Linux which can be used to install R. The yum command is used for installing like this:<\/p>\n<p><span style=\"background-color: #C0C0C0\">$ yum install R<\/span><\/p>\n<p>For Ubuntu Linux or other Debian-related OSs, a more direct method is:<\/p>\n<p><span style=\"background-color: #C0C0C0\">$ apt-get install r-base<\/span><\/p>\n<p>Now let us start creating our R application in visual studio<\/p>\n<p>Go to Files ->Project and add a new R project<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/6.png\" rel=\"attachment wp-att-2261\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/6.png\" alt=\"6\" width=\"665\" height=\"407\" class=\"aligncenter size-full wp-image-2261\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/6.png 665w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/6-300x184.png 300w\" sizes=\"(max-width: 665px) 100vw, 665px\" \/><\/a><\/p>\n<p>This is our project structure:<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/7.png\" rel=\"attachment wp-att-2262\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/7.png\" alt=\"7\" width=\"319\" height=\"181\" class=\"alignleft size-full wp-image-2262\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/7.png 319w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/7-300x170.png 300w\" sizes=\"(max-width: 319px) 100vw, 319px\" \/><\/a><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p>Now on the top left side is a new R file (script.R) where we can edit source code with all of Visual Studio Ide editing features.<\/p>\n<p>Also on the bottom left of Visual Studio is where you can find an R Interactive window in which you can interactively develop and test code.<\/p>\n<p>We can directly use R Interactive without the need of opening any new project.<\/p>\n<p>Now let us see a demonstration of Poisson regression:<\/p>\n<p>The pre-existing dataset &#8220;mtcars&#8221; describes different models of a car with their various engine specifications.<\/p>\n<p>#Inserting data into the dataframe<br \/>\n<span style=\"background-color: #C0C0C0\">input <- mtcars[,c(\"am\",\"cyl\",\"hp\",\"wt\")]<\/span>\n<\/p>\n<p><p>#Applying Poison Regression to the dataframe<br \/>\n<span style=\"background-color: #C0C0C0\">am.data = glm(formula = am ~ cyl + hp + wt, data = input, family = binomial)<br \/>\n<\/span><span style=\"background-color: #C0C0C0\">print(am.data)<br \/>\n<\/span>\n<\/p>\n<p><span style=\"background-color: #C0C0C0\">print(summary(am.data))<\/span><\/p>\n<p><b>Output:<\/b><\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/8.png\" rel=\"attachment wp-att-2263\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/8.png\" alt=\"8\" width=\"623\" height=\"630\" class=\"aligncenter size-full wp-image-2263\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/8.png 623w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/8-297x300.png 297w\" sizes=\"(max-width: 623px) 100vw, 623px\" \/><\/a><\/p>\n<p>The p-value in the above output in the last column should be less than 0.05 to have any impact on the predictor variable of the response variable.<\/p>\n<p><a target=\"_blank\" href=\"http:\/\/stepbystepschools.net\/?page_id=1842\">Syllabus of Data Science training in Mumbai<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Poisson regression in statistics is a generalized linear model which forms of regression analysis used to model count data and contingency tables. The response variable Y being a Poisson distribution is assumed by Poisson regression hence assumes the logarithm of &hellip; <a href=\"https:\/\/www.stepbystepschools.net\/?p=2253\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1],"tags":[198,199,226,214,202,215],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Data Science Training in Mumbai : - Using Poisson Regression with R Programming in Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.stepbystepschools.net\/?p=2253\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Science Training in Mumbai : - Using Poisson Regression with R Programming in Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"og:description\" content=\"Poisson regression in statistics is a generalized linear model which forms of regression analysis used to model count data and contingency tables. The response variable Y being a Poisson distribution is assumed by Poisson regression hence assumes the logarithm of &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stepbystepschools.net\/?p=2253\" \/>\n<meta property=\"og:site_name\" content=\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-01T10:14:59+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"StepByStepSchoolsSupport\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\",\"url\":\"https:\/\/www.stepbystepschools.net\/\",\"name\":\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"description\":\"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stepbystepschools.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2253#primaryimage\",\"url\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png\",\"contentUrl\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2253#webpage\",\"url\":\"https:\/\/www.stepbystepschools.net\/?p=2253\",\"name\":\"Data Science Training in Mumbai : - Using Poisson Regression with R Programming in Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"isPartOf\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2253#primaryimage\"},\"datePublished\":\"2018-03-01T10:14:59+00:00\",\"dateModified\":\"2018-03-01T10:14:59+00:00\",\"author\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2253#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stepbystepschools.net\/?p=2253\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2253#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stepbystepschools.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Science Training in Mumbai : &#8211; Using Poisson Regression with R Programming in Visual Studio.\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655\",\"name\":\"StepByStepSchoolsSupport\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g\",\"caption\":\"StepByStepSchoolsSupport\"},\"url\":\"https:\/\/www.stepbystepschools.net\/?author=40\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Science Training in Mumbai : - Using Poisson Regression with R Programming in Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","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:\/\/www.stepbystepschools.net\/?p=2253","og_locale":"en_US","og_type":"article","og_title":"Data Science Training in Mumbai : - Using Poisson Regression with R Programming in Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","og_description":"Poisson regression in statistics is a generalized linear model which forms of regression analysis used to model count data and contingency tables. The response variable Y being a Poisson distribution is assumed by Poisson regression hence assumes the logarithm of &hellip; Continue reading &rarr;","og_url":"https:\/\/www.stepbystepschools.net\/?p=2253","og_site_name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","article_published_time":"2018-03-01T10:14:59+00:00","og_image":[{"url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"StepByStepSchoolsSupport","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.stepbystepschools.net\/#website","url":"https:\/\/www.stepbystepschools.net\/","name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","description":"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stepbystepschools.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/?p=2253#primaryimage","url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png","contentUrl":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1.png"},{"@type":"WebPage","@id":"https:\/\/www.stepbystepschools.net\/?p=2253#webpage","url":"https:\/\/www.stepbystepschools.net\/?p=2253","name":"Data Science Training in Mumbai : - Using Poisson Regression with R Programming in Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","isPartOf":{"@id":"https:\/\/www.stepbystepschools.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stepbystepschools.net\/?p=2253#primaryimage"},"datePublished":"2018-03-01T10:14:59+00:00","dateModified":"2018-03-01T10:14:59+00:00","author":{"@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655"},"breadcrumb":{"@id":"https:\/\/www.stepbystepschools.net\/?p=2253#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stepbystepschools.net\/?p=2253"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.stepbystepschools.net\/?p=2253#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stepbystepschools.net\/"},{"@type":"ListItem","position":2,"name":"Data Science Training in Mumbai : &#8211; Using Poisson Regression with R Programming in Visual Studio."}]},{"@type":"Person","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655","name":"StepByStepSchoolsSupport","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g","caption":"StepByStepSchoolsSupport"},"url":"https:\/\/www.stepbystepschools.net\/?author=40"}]}},"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2253"}],"collection":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2253"}],"version-history":[{"count":4,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2253\/revisions"}],"predecessor-version":[{"id":2267,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2253\/revisions\/2267"}],"wp:attachment":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}