最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

group by - Imputing values based on multiple conditions from other observations within household - Stack Overflow

programmeradmin3浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论