{"id":15280,"date":"2020-11-24T09:11:21","date_gmt":"2020-11-24T09:11:21","guid":{"rendered":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/"},"modified":"2020-11-24T09:11:21","modified_gmt":"2020-11-24T09:11:21","slug":"using-logistic-regression-to-handle-a-binary-outcome","status":"publish","type":"post","link":"https:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/","title":{"rendered":"using logistic regression to handle a binary outcome"},"content":{"rendered":"<style type=\"text\/css\"><\/style><p>Q1: In assessing the predictive power of categorical predictors of a binary outcome,<\/p>\n<p>should logistic regression be used?<\/p>\n<p>Q2: Objective: Using Logistic Regression to handle a binary outcome.<\/p>\n<p>Given the prostate cancer dataset, in which biopsy results are given for 97 men:<\/p>\n<p>\u00e2\u20ac\u00a2 You are to predict tumor spread in this dataset of 97 men who had undergone a biopsy.<\/p>\n<p>\u00e2\u20ac\u00a2 The measures to be used for prediction are: age, lbph, lcp, gleason, and lpsa. This implies that binary dependent variable of lcavol will be the outcome variable.<\/p>\n<p>We start by loading the appropriate libraries in R: ROCR, ggplot2, and aod packages as follows:<\/p>\n<p>&gt; install.packages(\u201cROCR\u201d)<\/p>\n<p>&gt; install.packages(\u201cggplot2\u201d)<\/p>\n<p>&gt; install.packages(\u201caod\u201d)<\/p>\n<p>&gt; library(ROCR)<\/p>\n<p>&gt; library(ggplot2)<\/p>\n<p>&gt; library(aod)<\/p>\n<p>Next, we load the csv file and check the statistical properties of the csv File as follow:<\/p>\n<p>&gt; setwd(\u201cC:\/RData\u00e2\u20ac\u009d) # your working directory<\/p>\n<p>&gt; tumor &lt;- read.csv(\u201cprostate.csv\u201d) # loading the file<\/p>\n<p>&gt; str(tumor) # check the properties of the file<\/p>\n<p>&nbsp;<\/p>\n<p>. . . continue from here!<\/p>\n<p>&nbsp;<\/p>\n<p>Reference<\/p>\n<p>R Documentation (2016). Prostate cancer data. Retrieved from<\/p>\n<p><a href=\"http:\/\/rafalab.github.io\/pages\/649\/prostate.html\">http:\/\/rafalab.github.io\/pages\/649\/prostate.html<\/a><span class=\"redactor-invisible-space\"><br \/>\n<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><center><a href=\"http:\/\/onlineclassesguru.com\/orders\/ordernow\"><img decoding=\"async\" src=\"https:\/\/encrypted-tbn0.gstatic.com\/images?q=tbn:ANd9GcTyj99p60XCLyLk1htB7-1neRt8-2QdnenNlQ&usqp=CAU\"target=\"_http:\/\/onlineclassesguru.com\/orders\/ordernow\"\/><\/center><p>","protected":false},"excerpt":{"rendered":"<p>Q1: In assessing the predictive power of categorical predictors of a binary outcome, should logistic regression be used? Q2: Objective: Using Logistic Regression to handle a binary outcome. Given the prostate cancer dataset, in which biopsy results are given for 97 men: \u00e2\u20ac\u00a2 You are to predict tumor spread in this dataset of 97 men&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-15280","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>using logistic regression to handle a binary outcome - onlineclassesguru<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"using logistic regression to handle a binary outcome - onlineclassesguru\" \/>\n<meta property=\"og:description\" content=\"Q1: In assessing the predictive power of categorical predictors of a binary outcome, should logistic regression be used? Q2: Objective: Using Logistic Regression to handle a binary outcome. Given the prostate cancer dataset, in which biopsy results are given for 97 men: \u00e2\u20ac\u00a2 You are to predict tumor spread in this dataset of 97 men...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/\" \/>\n<meta property=\"og:site_name\" content=\"onlineclassesguru\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-24T09:11:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin_admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/onlineclassesguru.com\/#website\",\"url\":\"https:\/\/onlineclassesguru.com\/\",\"name\":\"onlineclassesguru\",\"description\":\"Cheap Professional coursework and reaction papers help\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/onlineclassesguru.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/#webpage\",\"url\":\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/\",\"name\":\"using logistic regression to handle a binary outcome - onlineclassesguru\",\"isPartOf\":{\"@id\":\"https:\/\/onlineclassesguru.com\/#website\"},\"datePublished\":\"2020-11-24T09:11:21+00:00\",\"dateModified\":\"2020-11-24T09:11:21+00:00\",\"author\":{\"@id\":\"https:\/\/onlineclassesguru.com\/#\/schema\/person\/1831fa4d28e47b468621cf27932f5742\"},\"breadcrumb\":{\"@id\":\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/onlineclassesguru.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"using logistic regression to handle a binary outcome\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/onlineclassesguru.com\/#\/schema\/person\/1831fa4d28e47b468621cf27932f5742\",\"name\":\"admin_admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/onlineclassesguru.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429c8d043f7a770af242b0031e8b9f2b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429c8d043f7a770af242b0031e8b9f2b?s=96&d=mm&r=g\",\"caption\":\"admin_admin\"},\"url\":\"https:\/\/onlineclassesguru.com\/index.php\/author\/admin_admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"using logistic regression to handle a binary outcome - onlineclassesguru","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":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/","og_locale":"en_US","og_type":"article","og_title":"using logistic regression to handle a binary outcome - onlineclassesguru","og_description":"Q1: In assessing the predictive power of categorical predictors of a binary outcome, should logistic regression be used? Q2: Objective: Using Logistic Regression to handle a binary outcome. Given the prostate cancer dataset, in which biopsy results are given for 97 men: \u00e2\u20ac\u00a2 You are to predict tumor spread in this dataset of 97 men...","og_url":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/","og_site_name":"onlineclassesguru","article_published_time":"2020-11-24T09:11:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin_admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/onlineclassesguru.com\/#website","url":"https:\/\/onlineclassesguru.com\/","name":"onlineclassesguru","description":"Cheap Professional coursework and reaction papers help","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/onlineclassesguru.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/#webpage","url":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/","name":"using logistic regression to handle a binary outcome - onlineclassesguru","isPartOf":{"@id":"https:\/\/onlineclassesguru.com\/#website"},"datePublished":"2020-11-24T09:11:21+00:00","dateModified":"2020-11-24T09:11:21+00:00","author":{"@id":"https:\/\/onlineclassesguru.com\/#\/schema\/person\/1831fa4d28e47b468621cf27932f5742"},"breadcrumb":{"@id":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/using-logistic-regression-to-handle-a-binary-outcome\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/onlineclassesguru.com\/"},{"@type":"ListItem","position":2,"name":"using logistic regression to handle a binary outcome"}]},{"@type":"Person","@id":"https:\/\/onlineclassesguru.com\/#\/schema\/person\/1831fa4d28e47b468621cf27932f5742","name":"admin_admin","image":{"@type":"ImageObject","@id":"https:\/\/onlineclassesguru.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/429c8d043f7a770af242b0031e8b9f2b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429c8d043f7a770af242b0031e8b9f2b?s=96&d=mm&r=g","caption":"admin_admin"},"url":"https:\/\/onlineclassesguru.com\/index.php\/author\/admin_admin\/"}]}},"_links":{"self":[{"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/posts\/15280"}],"collection":[{"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/comments?post=15280"}],"version-history":[{"count":0,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/posts\/15280\/revisions"}],"wp:attachment":[{"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/media?parent=15280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/categories?post=15280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/tags?post=15280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}