Hi everyone,
I am conducting a study on free sugar intake at 2 years ('freesugarsg_av3dayst2' , continuous variable) and BMI growth over a 14.1 year follow up period. Data are in long format. I have estimated marginal means for if intake was 11 g/d and for if it were 43 g/d. I used this code:
The results I am interested in for this question are:
I want to add code to produce a table with the calculated differences in the estimated mean BMI measures between consuming 11 g/d and 43 g/d, with 95% CI. I am imagining there will only be 15 timepoints in this subsequent table (the intercept timepoint and 14 follow up years, instead of 30). Is there a way to do this? Thank you very much for any help you can give me.
To add, I have tried individually adding the below to the code:
Both result in a table with 30 timepoints and do not seem to account for the estimations for 11 g/d vs 43 g/d intake. Thanks again.
I am conducting a study on free sugar intake at 2 years ('freesugarsg_av3dayst2' , continuous variable) and BMI growth over a 14.1 year follow up period. Data are in long format. I have estimated marginal means for if intake was 11 g/d and for if it were 43 g/d. I used this code:
Code:
* Model 0 with Quadratic Terms mixed bmi ageyt2 c.ageyt2#c.ageyt2 c.ageyt2#c.ageyt2#c.ageyt2 freesugarsg_av3dayst2 c.ageyt2#c.freesugarsg_av3dayst2 c.ageyt2#c.ageyt2#c.freesugarsg_av3dayst2 c.ageyt2#c.ageyt2#c.ageyt2#c.freesugarsg_av3dayst2 || famid: || twinid: ageyt2, cov(un) * Graph to show curves for 10th and 90th percentile of intake at t2 margins, at(ageyt2=(0(1)14.1) freesugarsg_av3dayst2=(11 43)) marginsplot, legend(pos(3) col(3) rows(2)) xlabel(0(1)14.1) xscale(range(0 14.1)) /// title (" ", size(small)) /// ytitle(BMI (kg/m{sup:2})) /// ylabel (, ticks tposition(inside)) /// xtitle(Follow up (years)) /// xlabel(, tposition(inside) nogrid) /// legend(order(1 "11 g/d" 2 "43 g/d") size(small) title("FS intake", size(small)) region(lstyle(none))) /// text(12 25 "FS intake", size(small) placement(north) justification(center)) /// graphregion(color(white) lwidth(none) lpattern(none) fcolor(white)) // graph export "deleted name of location", replace margins, at(ageyt2=(0(1)14.1) freesugarsg_av3dayst2=(11 43))
Code:
------------------------------------------------------------------------------ | Delta-method | Margin std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- _at | 1 | 17.21046 .0575406 299.10 0.000 17.09768 17.32324 2 | 17.10447 .0632919 270.25 0.000 16.98042 17.22852 3 | 16.35555 .0534842 305.80 0.000 16.25073 16.46038 4 | 16.28873 .0589246 276.43 0.000 16.17324 16.40422 5 | 15.75475 .0539382 292.09 0.000 15.64903 15.86047 6 | 15.74549 .0598335 263.16 0.000 15.62822 15.86276 7 | 15.38717 .0566486 271.62 0.000 15.27614 15.4982 8 | 15.44858 .063258 244.22 0.000 15.3246 15.57257 9 | 15.23192 .0609106 250.07 0.000 15.11254 15.3513 10 | 15.37184 .0684589 224.54 0.000 15.23767 15.50602 11 | 15.26811 .0667524 228.73 0.000 15.13728 15.39895 12 | 15.48909 .0755538 205.01 0.000 15.34101 15.63717 13 | 15.47487 .074205 208.54 0.000 15.32943 15.62031 14 | 15.77416 .0845749 186.51 0.000 15.60839 15.93992 15 | 15.83129 .08301 190.72 0.000 15.6686 15.99399 16 | 16.20086 .0951491 170.27 0.000 16.01438 16.38735 17 | 16.31651 .0926729 176.07 0.000 16.13487 16.49814 18 | 16.74304 .1066227 157.03 0.000 16.53407 16.95202 19 | 16.90961 .102663 164.71 0.000 16.7084 17.11083 20 | 17.37452 .118344 146.81 0.000 17.14257 17.60647 21 | 17.58973 .1126312 156.17 0.000 17.36898 17.81049 22 | 18.06912 .1299511 139.05 0.000 17.81442 18.32382 23 | 18.33598 .1226217 149.53 0.000 18.09564 18.57631 24 | 18.80067 .1416524 132.72 0.000 18.52303 19.0783 25 | 19.12745 .13329 143.50 0.000 18.86621 19.3887 26 | 19.543 .1545147 126.48 0.000 19.24015 19.84584 27 | 19.94328 .1460968 136.51 0.000 19.65694 20.22963 28 | 20.26993 .1706911 118.75 0.000 19.93538 20.60448 29 | 20.76258 .1633585 127.10 0.000 20.4424 21.08275 30 | 20.95529 .1933842 108.36 0.000 20.57627 21.33432 ------------------------------------------------------------------------------
To add, I have tried individually adding the below to the code:
Code:
margins, dydx(ageyt2) at(ageyt2=(0(1)14.1) freesugarsg_av3dayst2=(11 43))
Code:
margins, dydx(freesugarsg_av3dayst2) at(ageyt2=(0(1)14.1))
Comment