Is there a way to merge multiple variable valuses into one?

I am doing emmeans analysis for my bachelors thesis. I am analysing households incomes based on different variables like education, number of children, job sector, area ect.

The question is: Is there a way to merge eg. multiple living areas into one, as they have basically the same mmean and then construct the GLM again?

In SAS I would use this code to merge 3 areas into one: ESTIMATE "BB-KE-ZA" intercept 3 REGION 1 1 0 0 0 0 1 /divisor=3;

and I wish to do the same in R.

I wish to create new value of the variable Region where will be merged 3 values of the variable Region that have same least square means.

See the FAQ: How to do a minimal reproducible example reprex for beginners for a way to clearly illustrate the problem. It's unclear which variables, how they are coded and what object (data frame, matrix, S4 object, etc.?)

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.