I can't figure out how to make a really simple graph, and I hope someone is able to help me out.
I have BMI measured at three time points (t1-3) for a sample (identified by PID_109925). The data are in wide format, and the BMI measurements are therefore stored in three different variables (Bmi_NT2BLM, Bmi_NT3BLM and Bmi_NT4BLM). The sample is classified into several groups (variable _traj_Group).
How can I make a graph with BMI measured at t1-3 on the x-axis, kg/m2 (the unit) at the y axis, as a multiple overlaid line graph by _traj_Group?
First I thought about converting my data to long format, but I'm not sure if that will be necessary.
Thank you in advance,
Sigrid V
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str13 PID_109925 float(_traj_Group t1 t2 t3) double(Bmi_NT2BLM Bmi_NT3BLM Bmi_NT4BLM) "1099250000075" 6 -.13415469 11.901438 22.13826 . 26.9 27 "1099250000440" 6 1.303217 12.271048 21.979465 26.3 26.7 25.8 "1099250001751" 5 1.1143053 11.600274 22.696783 27 29.5 28.3 "1099250002307" 5 1.5167693 12.6872 23.868584 23.5 26.5 27.2 "1099250004035" 5 .3832991 11.334702 23.931553 27.8 31.6 31.1 "1099250004073" 4 1.0212183 11.04449 24.75017 22.4 23.9 21.6 "1099250004141" 1 .3039014 12.021903 22.669405 28.2 26.4 26.4 "1099250004516" 5 .3531828 11.97536 22.288843 25.8 25.8 28.7 "1099250005988" 4 .4079398 12.035592 22.54346 31.3 32.5 31.4 "1099250011644" 3 1.0759754 11.66872 24.26557 19.6 21.1 23.7 "1099250014188" 4 1.3442848 11.444217 23.36482 30 31.3 35.2 "1099250014218" 4 .3148528 11.97536 22.63381 18.7 20 22.9 "1099250014393" 6 -.06844627 11.709787 22.173853 20 19.9 20.4 "1099250015659" 3 .07392197 11.865846 22.15195 28.1 33.3 37 "1099250017288" 4 .5229295 12.34497 22.0397 25.1 25.9 27 "1099250017400" 5 1.6947297 12.443532 23.93429 24.4 27.2 26.6 "1099250017653" 4 .03832991 11.868583 22.29158 22.8 24.2 24 "1099250021582" 3 1.0540725 11.017112 22.65024 32.9 32.1 26.1 "1099250023227" 4 .13415469 11.901438 22.07529 25.1 27.8 28.5 "1099250026013" 4 1.4017797 12.396988 22.34634 20.1 21.1 23.4 "1099250030621" 7 1.3497604 12.33128 23.98357 23 25.5 26.5 "1099250032854" 5 1.3305955 12.271048 22.324436 27.2 28.3 28.3 "1099250033110" 4 -.06844627 11.712525 23.28816 35.2 40.7 36.2 "1099250033721" 5 1.0540725 12.079397 22.466805 24.9 28 30.7 "1099250037927" 4 .4188912 12.016427 22.7269 30.7 32 32 "1099250038566" 4 .9555099 11.446954 22.694046 31.6 32.5 31.9 "1099250038917" 6 .9993156 11.074607 23.307323 26.4 27.1 26.6 "1099250039419" 5 1.4072553 12.208076 22.275154 30.5 32 30.2 "1099250045595" 4 .8651608 11.334702 23.868584 29 29.1 34 "1099250048015" 4 1.281314 12.19165 22.13552 25.3 25 25.2 "1099250049265" 3 .5995893 11.545517 23.78645 22 23.8 23.9 "1099250049470" 4 .6707734 11.310061 22.68857 24.7 26.4 25.9 "1099250049982" 3 .52019167 12.136892 23.9206 31.1 34.5 37.5 "1099250050711" 4 -.06023272 11.698836 22.17659 22.2 23.1 23.8 "1099250050988" 5 .9664613 11.08282 23.32923 21.1 22.1 21.1 "1099250051152" 4 .29568788 12.117727 22.63929 28.1 25.5 26.3 "1099250051183" 2 1.4976044 12.443532 22.06434 27 28 28.9 "1099250051756" 5 1.5687885 12.646132 23.268993 23.5 23.1 23.2 "1099250053149" 4 -.09034908 11.863108 22.50513 26.4 27.2 26.5 "1099250053194" 6 1.4154688 12.514716 22.020535 26.5 34.7 33.5 "1099250053477" 4 .3641342 12.668036 22.91855 24.5 29.2 28.9 "1099250054344" 5 .29295003 11.290896 22.95962 22.8 24.4 29 "1099250055679" 5 .6543463 11.520876 23.79466 24.7 24.7 24.1 "1099250057062" 6 .3230664 11.28542 23.915127 25.4 28.1 27.8 "1099250057598" 5 1.0403833 11.35113 22.365503 23.5 25.9 29.6 "1099250059783" 5 1.5687885 12.53662 23.20876 22.4 24.8 26.5 "1099250059806" 5 .9938399 11.112936 23.342916 23.8 27.9 28.8 "1099250060260" 5 .9746749 11.101985 23.34839 26.9 29.8 32.9 "1099250061007" 6 .881588 11.3128 22.40657 23.4 24.6 25.4 "1099250062462" 4 .9582478 11.137577 23.367556 26.5 24.4 33.8 "1099250063414" 4 .386037 12.093087 22.502396 23.3 26.2 27.4 "1099250064596" 4 1.1088296 11.353868 22.275154 40.5 40.6 40.6 "1099250067702" 4 1.574264 12.616016 23.20876 27.5 29.5 29.3 "1099250070771" 5 1.54141 12.673512 23.2909 29.2 31.9 31.9 "1099250071365" 5 .3915127 11.35113 23.022587 27.6 29.4 30.1 "1099250072850" 4 .5722108 11.534565 22.617386 25.9 25.9 27.4 "1099250073000" 6 .07665982 11.87132 22.06434 37.5 31.8 33.1 "1099250076094" 4 .9281314 11.44148 22.71321 30.5 33.1 28.9 "1099250077138" 5 1.5934292 12.6872 23.151266 27.5 26.2 27.7 "1099250077442" 4 1.357974 12.492813 22.080767 19.9 22.5 19.6 "1099250077657" 5 .3805613 11.47707 22.694046 24.9 26.8 31.1 "1099250077985" 3 1.1581109 12.34497 22.141 25.2 25.8 25.5 "1099250078555" 4 .9390828 11.342916 22.327173 24.4 27.5 29.1 "1099250079279" 4 .11498974 11.827516 21.98768 22.4 26.6 30.7 "1099250080596" 5 .2108145 11.8987 22.042437 30.3 32.8 31.7 "1099250081227" 5 1.5496235 12.706366 24.21355 31.8 33.7 33.5 "1099250081708" 5 .421629 11.189596 23.35934 24.7 25.9 26.4 "1099250081951" 5 .25735798 12.64887 23.115675 22.4 26.3 26.8 "1099250082330" 5 1.357974 11.47707 22.691307 . 26.2 28.9 "1099250082781" 6 .4052019 11.154004 23.31006 23.2 25.4 25.3 "1099250082804" 5 1.1663244 12.284737 22.19302 21.5 25.9 28.8 "1099250082866" 5 .421629 12.002738 22.614647 26.5 28.4 29 "1099250083375" 1 1.57974 12.670774 23.30185 26.5 32.6 29.7 "1099250084075" 4 1.3278576 11.430527 23.32375 35 38.2 31.1 "1099250084358" 5 .06023272 11.696098 22.275154 25.6 26 26.6 "1099250084594" 5 1.560575 12.64887 23.15674 25.7 28.3 31.4 "1099250088820" 4 1.0020534 11.112936 23.367556 28.2 29.7 29.1 "1099250093923" 5 1.0924025 11.657768 22.4449 25.2 25.7 30 "1099250094715" 5 1.3634497 12.188911 22.11636 24.9 24.9 24.2 "1099250096061" 5 .13963039 11.613963 22.962355 25.8 34.1 33.2 "1099250096597" 3 .7173169 11.326488 24.350445 23.3 24.6 24.6 "1099250096658" 5 .4243669 11.468857 23.8193 20.7 . 24.5 "1099250097358" 5 1.6481862 12.616016 23.32101 30 33.5 33.4 "1099250097433" 3 1.0924025 11.383984 22.36824 24.3 28.2 26.6 "1099250099536" 4 1.6372348 12.53662 23.915127 22.8 25 24 "1099250099567" 5 1.1663244 12.175222 22.15195 26.9 28.7 31.2 "1099250100966" 5 1.3086927 12.454483 22.37098 18.9 22 19.5 "1099250101130" 4 .26557153 11.408625 23.077345 24.3 27 27.6 "1099250101697" 4 1.1115674 11.59206 22.428474 25.5 27.5 29.2 "1099250102250" 3 .6132786 11.70705 23.791924 26.1 25 29.5 "1099250102267" 5 .3230664 12.72553 23.09651 21.5 23 22.3 "1099250103417" 6 1.3305955 12.34497 22.351814 23.7 24.7 26.3 "1099250104629" 1 1.0212183 11.039015 22.59548 24.2 25.4 24 "1099250106296" 4 .11498974 11.865846 22.10267 24.8 26.3 26.8 "1099250106364" 5 .12046544 11.613963 22.97878 20.4 26.4 29.2 "1099250106524" 3 .4243669 12.156057 22.63655 26.4 30.7 31.9 "1099250106784" 1 .9062286 11.405887 24.75017 29.7 39.7 15 "1099250107668" 5 .08487337 11.728952 22.17933 26.4 28.6 26.7 "1099250109969" 4 1.3470225 12.251883 22.327173 23.2 25.7 25.5 "1099250114284" 4 1.1772759 12.175222 22.13826 24.3 27 24.1 end
0 Response to Creating a graph by group
Post a Comment