post: above message corresponds to expression 2, variable ratio
I am using v16.1. Below are my sample data and code.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int subjectid byte(timepoint sex age) float(aibwkg ratio xylose xylitol valine) 20001 3 1 39 74.58166 .09547353 -.7932054 -1.0131693 4.88012 20001 2 1 39 74.58166 .09547353 .57306993 -.8202816 4.3152866 20001 1 1 39 74.58166 .09547353 -.50978696 -1.1714463 4.004311 20002 3 1 35 74.30232 .06258648 1.187921 -1.0057454 4.0414968 20002 2 1 35 74.30232 .06258648 -.57098293 -.9478416 3.50136 20002 1 1 35 74.30232 .06258648 -.54130113 -.7070154 4.680255 20003 3 0 42 71.09388 .028846 -.87649 .57306993 5.20874 20003 2 0 42 71.09388 .028846 .29774 .27476 4.66839 20003 1 0 42 71.09388 .028846 -.39757 -.36489 4.004348 20004 3 0 36 59.1862 .04826844 -.4515804 -.06558012 5.631982 20004 2 0 36 59.1862 .04826844 -.50320864 -.7149013 4.967944 20004 1 0 36 59.1862 .04826844 -.588939 -.788257 5.110322 20005 3 1 51 58.46099 .04752519 -.9756348 -1.1163021 5.163349 20005 2 1 51 58.46099 .04752519 -.6698709 -.8362016 4.571539 20005 1 1 51 58.46099 .04752519 -.8011949 -1.2734073 5.349926 20006 3 1 19 76.56038 .05422749 -.1484685 -1.1551343 3.649079 20006 2 1 19 76.56038 .05422749 -.7596757 -1.080953 5.256241 20006 1 1 19 76.56038 .05422749 -.002501656 -1.0889778 3.596983 end
Code:
capture postutil clear tempfile metabolitebresults postfile handle str32 Metabolite float ratio se_ratio /// age se_age sex se_sex aibwkg se_aibwkg using `metabolitebresults' foreach var of varlist xylose - valine { reg `var' ratio age sex aibwkg if timepoint==1 local topost ("`var'") foreach x in ratio age sex aibwkg { local topost `topost' (_b[`var':`x']) (_se[`var':`x']) } // POST IT post handle `topost' } postclose handle use `metaboliteresults', clear foreach v of varlist ratio age sex aibwkg { gen t_`v' = `v'/se_`v' gen p_`v' = 2*normal(-abs(t_`v')) order t_`v' p_`v', after(se_`v') } export delimited using my_metaboliteresults, replace
0 Response to post and postfile help after regression
Post a Comment