Link to Table
This is a recreation of the data I am working on. I would like to be able to fill in the 'occupation' variable for MALEs, with the value 'partner's occupation' from other observations in the household, however who is partners with whom is not defined, but needs to be interpreted by checking if 'partner's age' matches 'age' and 'partners education' matches 'education' of individuals within the same household.
I tried creating a new variable based on these values using group_by() and case_when() but am having trouble with it. Any help would be greatly appreciated.