Recoding variables and grouping_by the levels of factors

Hi All,
I have a question if would it be possible in R to group_by levels of factors in R not by variable itself ?
This is from a questionnaire:

1.How much do you work a week:
a. less than 20 hours
b. 21-25 hours
c. 26 - 35 hours
d. 36 - 40 hours
e. Over 40 hours

  1. How much do you earn :
    a. 1000-2000 USD
    b. 2100-3000 USD
    c. 3100 - 4100 USD
    d.4200 - 5200 USD
    e. over 5200 USD

How to recode these properly that later if I want group data by eg. 1b(21-25 hours) or 2c ( 3100 - 4100 USD) I could do it in RStudio ?

Thank you in advance.

I am not sure what you mean by grouping by one level of a factor. Do you mean having a dummy variable that is 1 when the level applies to the subject and is zero otherwise? If not, how would this grouping be used?

Thank you for your reply. At this moment I can't clearly state what I would like to do, but apart from these two question presented in my above post I have got more 20 questions based on 5 - grades Likert scale, for example:
1.Highly unsatisfied,
2. Unsatisfied,
3. Neither unsatisfied nor satisfied,
4. Satisfied,
5. Highly Satisfied.

And I am going to figure out good approach to this data analysis, so any hint would be much appreciated.
For example I asked about coding and grouping because I want group-by middle work time (26 - 35 hours per week) and middle (3100 - 4100 USD) or higher income (over 5200 USD) and more working hours (Over 40 hours). Or I want to check if somebody who works rather many hours (like 35 or more per week) gets higher income and gets more satisfaction from the job ? Additionally I want to add that I have got two group to compare:

  1. employees who work less than 5 years
  2. employees who work more than 5 years

Going further I want to compare women and men in these groups.

Thank you for any advice.

I think I understand the kinds of questions that you want to ask of the data and I am sure I should not express an opinion on how to approach the analysis. I have never done an analysis of Likert scale data and there must be a huge literature. I suspect the question you asked in this thread is too narrow. You seem to be planning to manually slice the data in many ways and look for the most important contributors to job satisfaction or income. Isn't the higher level question "How do I find the important effects in Likert-scale survey data?" Asking that in a new thread might get you better advice.
I hope I have understood correctly what you ar trying to do.

Thank you for your advice @FJCC,
Your question:

is good point to start for me.

I found this as well:

I will go through literature and maybe wait a bit here if somebody comes up with an idea.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.