{"id":67807,"date":"2021-10-30T01:36:30","date_gmt":"2021-10-30T01:36:30","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/10\/30\/need-help-comparing-a-multiple-choice-question-with-numerical-data-in-r\/"},"modified":"2021-10-30T01:36:30","modified_gmt":"2021-10-30T01:36:30","slug":"need-help-comparing-a-multiple-choice-question-with-numerical-data-in-r","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/10\/30\/need-help-comparing-a-multiple-choice-question-with-numerical-data-in-r\/","title":{"rendered":"Need help comparing a multiple choice question with numerical data in R"},"content":{"rendered":"<p>I have some R code and a data file attached. In the R code, I have a date frame with two columns. One of the columns is a multiple choice question from a survey that had 5 options. The other is a numerical value from a survey that had a Likert scale. I am trying to compare these to determine whether one affects the other. How can I do this? <br \/>Here is my R code and I have attached my data file <br \/>library(ggplot2) <br \/>library(ggpubr) <br \/>library(tidyverse) <br \/>library(broom) <br \/>library(AICcmodavg) <br \/>install.packages(&#8220;Hmisc&#8221;) <br \/>library(&#8220;Hmisc&#8221;) <br \/>library(readxl) <br \/>results_survey_R_ &lt;- read_excel(&quot;results-survey(R).xls&quot;) <br \/>df &lt;- results_survey_R_ <br \/>mydata &lt;- df[,c(&quot;165&quot;, &quot;166&quot;,&quot;167&quot;, &quot;168&quot;,&quot;169&quot;, &quot;170&quot;,&quot;171&quot;, &quot;172&quot;,&quot;173&quot;, &quot;174&quot;,&quot;175&quot;, &quot;176&quot;,&quot;177&quot;, &quot;178&quot;,&quot;179&quot;, &quot;180&quot;,&quot;181&quot;, &quot;182&quot;,&quot;183&quot;)] <br \/>mydata.cor = cor(mydata) <br \/>mydata.cor = cor(mydata, method = c(&#8220;spearman&#8221;)) <br \/>mydata.rcorr = rcorr(as.matrix(mydata)) <br \/>mydata.rcorr <br \/>mydata.coeff = mydata.rcorr$r <br \/>mydata.p = mydata.rcorr$P <br \/>install.packages(&#8220;corrplot&#8221;) <br \/>library(corrplot) <br \/>corrplot(mydata.cor) <br \/>mydata2 &lt;- df[,c(&quot;165&quot;, &quot;11&quot;,&quot;167&quot;, &quot;14&quot;,&quot;10&quot;)] <br \/>mydata3 &lt;- df[,c(&quot;14&quot;, &quot;169&quot;)] <br \/>summary(mydata3) <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have some R code and a data file attached. In the R code, I have a date frame with two columns. One of the columns is a multiple choice question from a survey that had 5 options. The other is a numerical value from a survey that had a Likert scale. I am trying [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10],"class_list":["post-67807","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-writing"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/67807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=67807"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/67807\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=67807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=67807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=67807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}