Hi all,
I am trying to figure out how to create a table in STATA of multiple (over 400) univariate regression results in one table. For example, my dataset involves understanding the association of spirometry results (fev1 and fvc z score) and metabolomics. The list of metabolomics in my dataset is ~400, and I have to write a code that would run a regression of fev1/fvc z score and each individual metabolite first (which I have done using the foreach command).
foreach x of varlist lglucuronicacid lhydroxybutanoicacid lisoleucine lornithine lglycerolalphaphosphate lthreonine lazelaicacid lmalicacid lketoisocaproicacid lmethanolphosphate lmyoinositol lasparticacid lphenylalanine lsucrose lasparagine lcreatinine lglycine lpelargonicacid lmethionine lcapricacid lmaltose ltrehalose ludpglucuronicacid llyxitol larabitol lhistidine lcholesterol lhydroxyglutaricacid lpipecolinicacid lglucose1phosphate lethanolamine linositol4monophosphate lpalmiticacid lglutaricacid laminomalonate lisothreonicacid lhydroxyvalericacid lshikimicacid llysine lsuccinicacid lheptadecanoicacid........{
quietly: regress fev1fvc_z `x' if month==6
quietly: regress fev1fvc_z `x' if month==2
quietly: regress fev1fvc_z `x' if month==0
}
I cannot figure out how to store these estimates and get a table/export the regression outputs for each metabolite. I have tried looking for a solution in the forums, but nothing works. Any help would be much appreciated as I am relatively new to STATA
Thank you
I am trying to figure out how to create a table in STATA of multiple (over 400) univariate regression results in one table. For example, my dataset involves understanding the association of spirometry results (fev1 and fvc z score) and metabolomics. The list of metabolomics in my dataset is ~400, and I have to write a code that would run a regression of fev1/fvc z score and each individual metabolite first (which I have done using the foreach command).
foreach x of varlist lglucuronicacid lhydroxybutanoicacid lisoleucine lornithine lglycerolalphaphosphate lthreonine lazelaicacid lmalicacid lketoisocaproicacid lmethanolphosphate lmyoinositol lasparticacid lphenylalanine lsucrose lasparagine lcreatinine lglycine lpelargonicacid lmethionine lcapricacid lmaltose ltrehalose ludpglucuronicacid llyxitol larabitol lhistidine lcholesterol lhydroxyglutaricacid lpipecolinicacid lglucose1phosphate lethanolamine linositol4monophosphate lpalmiticacid lglutaricacid laminomalonate lisothreonicacid lhydroxyvalericacid lshikimicacid llysine lsuccinicacid lheptadecanoicacid........{
quietly: regress fev1fvc_z `x' if month==6
quietly: regress fev1fvc_z `x' if month==2
quietly: regress fev1fvc_z `x' if month==0
}
I cannot figure out how to store these estimates and get a table/export the regression outputs for each metabolite. I have tried looking for a solution in the forums, but nothing works. Any help would be much appreciated as I am relatively new to STATA
Thank you
Comment