Hi andresrcs,
I have tried to prepare a reprex below.
Again my beginner level may mean that my reprex is not great.
Also I didn't include any R code in the reprex as this is part of my problem i.e. I don't know what R package or function to use to get the mean average rank for my 2 ranking questions below.
#This is an example of my data set i.e 1st 5 respondents for whole data set:
head (mydata)
#> Error in head(mydata): object 'mydata' not found
data.frame(
Progress = c(100L, 100L, 100L, 100L, 100L),
Duration..in.seconds. = c(1770L, 1030L, 644L, 3988L, 1292L),
Id = c(1L, 2L, 3L, 4L, 5L),
model = c(4L, 2L, 1L, 3L, 2L),
location = c(1L, 3L, 2L, 2L, 3L),
education = c(3L, 1L, 3L, 1L, 1L),
fee = c(2L, 5L, 4L, 5L, 4L),
income = c(5L, 4L, 5L, 4L, 5L),
red = c(4L, 1L, 2L, 2L, 4L),
blue = c(3L, 2L, 1L, 1L, 3L),
green = c(1L, 4L, 4L, 3L, 2L),
yellow = c(2L, 5L, 3L, 4L, 1L),
black = c(5L, 3L, 5L, 5L, 5L),
Age = c(47L, 47L, 51L, 50L, 38L),
Recorded.Date = as.factor(c("15/06/2018 21:29",
"16/06/2018 15:47",
"18/06/2018 19:07", "19/06/2018 20:29",
"20/06/2018 13:59")),
RID = as.factor(c("R_Djkev4OH9F3RuIp",
"R_2vY3qfyS8vNWvCH",
"R_1Rr1Eh9iCI3wznj", "R_T1rPDENUBBntTCF",
"R_3inja17CkIpsjHr")),
Distribution = as.factor(c("anonymous", "anonymous",
"anonymous", "anonymous",
"anonymous")),
Block = as.factor(c("A", "C", "A", "C", "B")),
Difficulty.of.choice.questions = as.factor(c("Moderately easy",
"Moderately easy",
"Extremely difficult", "Extremely difficult",
"Extremely difficult")),
Gender = as.factor(c("Female", "Male", "Female",
"Female", "Female")),
Ethnicity = as.factor(c("Other", "European",
"European", "Other",
"European")),
Current.job.satisfaction4 = as.factor(c("Somewhat dissatisfied",
"Extremely satisfied",
"Somewhat satisfied",
"Somewhat satisfied", "Somewhat satisfied")),
Current.job.satisfaction2 = as.factor(c("Dissatisfied", "Satisfied",
"Satisfied", "Satisfied",
"Satisfied"))
)
#> Progress Duration..in.seconds. Id model location education fee income
#> 1 100 1770 1 4 1 3 2 5
#> 2 100 1030 2 2 3 1 5 4
#> 3 100 644 3 1 2 3 4 5
#> 4 100 3988 4 3 2 1 5 4
#> 5 100 1292 5 2 3 1 4 5
#> red blue green yellow black Age Recorded.Date RID
#> 1 4 3 1 2 5 47 15/06/2018 21:29 R_Djkev4OH9F3RuIp
#> 2 1 2 4 5 3 47 16/06/2018 15:47 R_2vY3qfyS8vNWvCH
#> 3 2 1 4 3 5 51 18/06/2018 19:07 R_1Rr1Eh9iCI3wznj
#> 4 2 1 3 4 5 50 19/06/2018 20:29 R_T1rPDENUBBntTCF
#> 5 4 3 2 1 5 38 20/06/2018 13:59 R_3inja17CkIpsjHr
#> Distribution Block Difficulty.of.choice.questions Gender Ethnicity
#> 1 anonymous A Moderately easy Female Other
#> 2 anonymous C Moderately easy Male European
#> 3 anonymous A Extremely difficult Female European
#> 4 anonymous C Extremely difficult Female Other
#> 5 anonymous B Extremely difficult Female European
#> Current.job.satisfaction4 Current.job.satisfaction2
#> 1 Somewhat dissatisfied Dissatisfied
#> 2 Extremely satisfied Satisfied
#> 3 Somewhat satisfied Satisfied
#> 4 Somewhat satisfied Satisfied
#> 5 Somewhat satisfied Satisfied
#This is the subset that I want to use to work out my first ranking question i.e. ranking of the 5 variables: model,
#location, education, fee, income (with 1 being most important to 5 being least important)
#I don't know how to get this subset from my whole data set to work out the ranking question here:
head (mydata, 5)[, c('Id', 'model', 'location', 'education', 'fee', 'income')]
#> Error in head(mydata, 5): object 'mydata' not found
data.frame(
Id = c(1L, 2L, 3L, 4L, 5L),
model = c(4L, 2L, 1L, 3L, 2L),
location = c(1L, 3L, 2L, 2L, 3L),
education = c(3L, 1L, 3L, 1L, 1L),
fee = c(2L, 5L, 4L, 5L, 4L),
income = c(5L, 4L, 5L, 4L, 5L)
)
#> Id model location education fee income
#> 1 1 4 1 3 2 5
#> 2 2 2 3 1 5 4
#> 3 3 1 2 3 4 5
#> 4 4 3 2 1 5 4
#> 5 5 2 3 1 4 5
#This is the subset that I want to use to work out my second ranking question i.e. ranking of the 5 colour variables:
#red, blue, green, yellow, black (with 1 being most preferred to 5 being least preferred).
#Again, I don't know how to get this subset from my whole data set to work out the ranking question here:
head (mydata, 5)[, c('Id', 'red', 'blue', 'green', 'yellow', 'black')]
#> Error in head(mydata, 5): object 'mydata' not found
data.frame(
Id = c(1L, 2L, 3L, 4L, 5L),
red = c(4L, 1L, 2L, 2L, 4L),
blue = c(3L, 2L, 1L, 1L, 3L),
green = c(1L, 4L, 4L, 3L, 2L),
yellow = c(2L, 5L, 3L, 4L, 1L),
black = c(5L, 3L, 5L, 5L, 5L)
)
#> Id red blue green yellow black
#> 1 1 4 3 1 2 5
#> 2 2 1 2 4 5 3
#> 3 3 2 1 4 3 5
#> 4 4 2 1 3 4 5
#> 5 5 4 3 2 1 5
# I would like to use mean average ranking i.e. the sum of (the ranking numbers times their respective count frequency/proportions) for these 2 ranking questions.
#1). Firstly, I don't know how to isolate the required variables to work out each of my 2 ranking questions from my whole data set.
#Secondly, I don't know what R package or function to use to work out the mean average ranking for these 2 ranking questions.
#Thank you