I am trying to run a multivariate regression to see if certain traits are correlated with certain responses relating to housing preferences and barriers. Stata automatically creates separate variables for "check all that apply"/multiple selection survey questions. Is there a way to create a variable that reflects these responses or another way to do a multivariate analysis aside from mlogit?
I know the following is incorrect because it falls to take into account if an observations has "yes" more than once for LS_*:
gen current_ls="" replace current_ls="near family and friends" if LS_Fam_Friends=="Yes" replace current_ls="close to current job or job opportunities" if LS_Job=="Yes" replace current_ls="within walking distance of necessary stores" if LS_stores=="Yes" replace current_ls="close to health services" if LS_health_services=="Yes" replace current_ls="Safety of the neighborhood" if LS_safe_neighbor=="Yes" replace current_ls="Security in your building" if LS_secure_building=="Yes"
encode current_ls, gen(current_ls2) order current_ls2, after(current_ls) label var current_ls2 "current living situation characteristics destringed" mlogit js_in_past age_bucket physical_dis_ js_ race_cat education_
I know the following is incorrect because it falls to take into account if an observations has "yes" more than once for LS_*:
gen current_ls="" replace current_ls="near family and friends" if LS_Fam_Friends=="Yes" replace current_ls="close to current job or job opportunities" if LS_Job=="Yes" replace current_ls="within walking distance of necessary stores" if LS_stores=="Yes" replace current_ls="close to health services" if LS_health_services=="Yes" replace current_ls="Safety of the neighborhood" if LS_safe_neighbor=="Yes" replace current_ls="Security in your building" if LS_secure_building=="Yes"
encode current_ls, gen(current_ls2) order current_ls2, after(current_ls) label var current_ls2 "current living situation characteristics destringed" mlogit js_in_past age_bucket physical_dis_ js_ race_cat education_
Comment