so I have a variable that is split into multiple categories (eight columns/categories in total). I am trying to combine these eight variables into one and then compare the lowest values to the highest values in regression. I apologize for the bad formatting. In other words, if the person had exam type 1, in the exam type column if someone had exam 1, it would be listed as 1, someone had exam 2, it would be listed as 2, etc...
Here is an example of how the data looks like (only listing three columns for the sake of simplicity and they are coded as 0,1:
Is there a way to do this without dummy coding it?
I am thinking of something like but am not sure how to proceed with the 0,1 coding above:
clean_df <- df %>% mutate(exam_type = c("examtype_1","examtype_2","examtype_3","examtype_4","examtype_5","examtype_6","examtype_7","examtype_8"))
#I know that this will not work
I don't completely understand your goal. Here is transformation of a data frame similar to the one you posted. Do you want to filter out all the rows in the final data frame where the value column is zero?
I also do not understand how you will compare the highest and lowest values (in regression??). Do you want a count for each exam type? Finally, what do you mean by "without dummy coding"?