Programming Homework Help

Numerical Data in R Multiple Choice Question

 

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?

Here is my R code and I have attached my data file

library(ggplot2)

library(ggpubr)

library(tidyverse)

library(broom)

library(AICcmodavg)

install.packages(“Hmisc”)

library(“Hmisc”)

library(readxl)

results_survey_R_ <- read_excel(“results-survey(R).xls”)

df <- results_survey_R_

mydata <- df[,c(“165”, “166”,”167″, “168”,”169″, “170”,”171″, “172”,”173″, “174”,”175″, “176”,”177″, “178”,”179″, “180”,”181″, “182”,”183″)]

mydata.cor = cor(mydata)

mydata.cor = cor(mydata, method = c(“spearman”))

mydata.rcorr = rcorr(as.matrix(mydata))

mydata.rcorr

mydata.coeff = mydata.rcorr$r

mydata.p = mydata.rcorr$P

install.packages(“corrplot”)

library(corrplot)

corrplot(mydata.cor)

mydata2 <- df[,c(“165”, “11”,”167″, “14”,”10″)]

mydata3 <- df[,c(“14”, “169”)]

summary(mydata3)