I am currently having some trouble combining two variables into one. The reason for this is my data set has a high non-response on the father's education's variable, and using both mother and father in analyses makes a drop in observations. The aim is to increase N by combining the two variables.
My dataset has N=208. The mom variable has n=161 recorded obs, while dad n=114.
The two variables (momeducation, dadeducation) is divided like this:
Mom (morutd) | Dad (farutd) | |
Short education (1) | 17 | 26 |
Upper Secondary (2) | 93 | 56 |
Long education (3) | 51 | 32 |
missing | 47 | 64 |
Code:
g edu=. replace edu=farutd_spes if morutd_spes==. replaceedu=morutd_spes if farutd_spes==. replace edu=morutd_spes if morutd_spes>farutd_spes & morutd_spes<. replace edu=farutd_spes if farutd_spes>morutd_spes & farutd_spes <.
The other code I tried is
Code:
g edu=. replace edu=farsutd if morsutd==. replace edu=morsutd if farsutd==. replace edu=morsutd if morsutd>farsutd & farsutd <. & morsutd<. replace edu=morsutd if morsutd>farsutd & farsutd <. & morsutd<.
Any ideas or thoughts on how to increase N by combining the two variables?
Thanks in advance.
0 Response to Combining two parents education variables to one variable for both
Post a Comment