Hello, I'm new to stata and need to figure out how to clean an excel dataset using stata. My original dataset looks like this:
and I need to figure out how to align the data and create a yes table of controls using stata like this
I'm confused on how to align the data and substitute the variable names. Any help much appreciated
(1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | |
no ses | sdi | tr_sdi | bg_sdi | tdi | tr_tdi | bg_tdi | adi | tr_adi | bg_adi | |
VARIABLES | gender race charlson | no controls | no controls | no controls | no controls | no controls | no controls | no controls | no controls | no controls |
gender = 1, Male | 0.0230*** | |||||||||
(0.00326) | ||||||||||
RECODE of rti_race (Research Triangle Institute (RTI) Race Code) = 2, Black | 0.1676*** | |||||||||
(0.00683) | ||||||||||
RECODE of rti_race (Research Triangle Institute (RTI) Race Code) = 3, Hispanic | 0.2041*** | |||||||||
(0.00850) | ||||||||||
RECODE of rti_race (Research Triangle Institute (RTI) Race Code) = 4, Asian | 0.1061*** | |||||||||
(0.01413) | ||||||||||
RECODE of rti_race (Research Triangle Institute (RTI) Race Code) = 5, Other | 0.0956*** | |||||||||
(0.01761) | ||||||||||
chronic pulmonary disease | 0.0472*** | |||||||||
(0.00394) | ||||||||||
rheumatic disease | 0.0461*** | |||||||||
(0.00812) | ||||||||||
Any malignacy including lymphoma and lukemia, except malignant neoplasm of skin | 0.0015 | |||||||||
(0.00564) | ||||||||||
metastatic cancer/metastatic solid tumor | -0.0038 | |||||||||
(0.01462) | ||||||||||
hiv/aids | 0.0820 | |||||||||
(0.06783) | ||||||||||
5 quantiles of raw_sdi = 2 | 0.0212*** | |||||||||
(0.00516) | ||||||||||
5 quantiles of raw_sdi = 3 | 0.0232*** | |||||||||
(0.00503) | ||||||||||
5 quantiles of raw_sdi = 4 | 0.0445*** | |||||||||
(0.00486) | ||||||||||
5 quantiles of raw_sdi = 5 | 0.1118*** | |||||||||
(0.00489) | ||||||||||
5 quantiles of raw_sdi = 2 | 0.0223*** | |||||||||
(0.00527) | ||||||||||
5 quantiles of raw_sdi = 3 | 0.0356*** | |||||||||
(0.00540) | ||||||||||
5 quantiles of raw_sdi = 4 | 0.0705*** | |||||||||
(0.00580) | ||||||||||
5 quantiles of raw_sdi = 5 | 0.1656*** | |||||||||
(0.00697) | ||||||||||
5 quantiles of raw_sdi = 2 | 0.0188*** | |||||||||
(0.00548) | ||||||||||
5 quantiles of raw_sdi = 3 | 0.0373*** | |||||||||
(0.00567) | ||||||||||
5 quantiles of raw_sdi = 4 | 0.0719*** | |||||||||
(0.00605) | ||||||||||
5 quantiles of raw_sdi = 5 | 0.1537*** | j |
(1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | |
SES Measure | no ses | no ses | SDI | TDI | ADI | ADI_MOD | SVI | SVI_MOD |
zcta | zcta | zcta | zcta | zcta | zcta | |||
quintile | quintile | quintile | quintile | quintile | quintile | |||
Controls | ||||||||
Age cubic polynomial | ||||||||
Gender | ||||||||
Gender*age cubic polynomial | ||||||||
Race/ethnicity | ||||||||
Gender*race/ethnicity | ||||||||
Reduced Charlson comorbidities | ||||||||
Poverty | ||||||||
SES Quintile | ||||||||
SES Quintile = 2 | 0.0153*** | 0.0148*** | 0.0208*** | 0.0203*** | 0.0053*** | 0.0140*** | ||
SES Quintile = 3 | 0.0318*** | 0.0261*** | 0.0429*** | 0.0422*** | 0.0196*** | 0.0311*** | ||
SES Quintile = 4 | 0.0532*** | 0.0375*** | 0.0620*** | 0.0615*** | 0.0455*** | 0.0534*** | ||
SES Quintile = 5 | 0.0893*** | 0.0658*** | 0.0874*** | 0.0908*** | 0.0831*** | 0.0902*** | ||
Age cubic polynomial | ||||||||
age | 0.0093*** | 0.0081*** | ||||||
Gender | ||||||||
Male | 0.0231*** | 0.0255*** | ||||||
Race/ethnicity | ||||||||
Black | 0.1214*** | 0.1223*** | ||||||
Hispanic | 0.1021*** | 0.1127*** | ||||||
Asian | 0.0943*** | 0.1044*** | ||||||
Other | 0.0795*** | 0.0869*** | ||||||
Reduced Charlson comorbidities | ||||||||
chronic pulmonary disease | 0.1104*** | |||||||
rheumatic disease | 0.0469*** | |||||||
Any malignacy including lymphoma and lukemia, except malignant neoplasm of skin | 0.0451*** | |||||||
metastatic cancer/metastatic solid tumor | 0.0072*** | |||||||
hiv/aids | 0.0961*** | |||||||
Poverty Quintile | ||||||||
Poverty Quintile = 2 | ||||||||
Poverty Quintile = 3 | ||||||||
Poverty Quintile = 4 | ||||||||
Poverty Quintile = 5 |
Comment