Hi everyone I want to create a restricted cubic spline graph to represent x axis (continuous variable, glomerular filtration rate) y: hazard ratio of the event. Here I give you dataex and my siyntaxis. I hope somebody can help me with syntaxis, because I dont see where is the mistake. Thank you

Syntaxis:

mkspline sck=CKD_EPI, cubic displayknots
stcox sck1 sck2 sck3 sck4
levelsof CKD_EPI if inrange(CKD_EPI, 0,90)
xblc sck1 sck2 sck3 sck4, covname(CKD_EPI) at(`r(levels)') eform reference(50) generate(agenew hr lb ub)



Dataex: clear input double(CKD_EPI Seg_SM SM) float evento 65.50582484929251 4.120547945205479 0 2 64.62032884646362 5.2684931506849315 0 2 85.43618140526358 5.7972602739726025 0 0 32.619985243192815 3.4438356164383563 0 2 39.70431626034682 .37534246575342467 0 2 . .9424657534246575 0 2 74.33857117702811 5.594520547945206 0 0 53.10333947834772 2.136986301369863 1 1 64.1068098383208 2.8876712328767122 0 2 53.60642506593303 3.197260273972603 0 2 32.30988884010617 1.2904109589041095 0 2 47.3207256907285 2.6301369863013697 1 1 82.59545374707797 5.041095890410959 0 0 59.38419483105697 1.0082191780821919 1 1 50.927073943820886 .9561643835616438 1 1 81.87140067488455 5.528767123287671 0 0 74.63646831742375 2.095890410958904 0 2 86.74921588916176 5.824657534246575 0 0 86.7842831848527 2.336986301369863 1 1 62.03831003987133 5.652054794520548 0 0 16.423222714445327 1.0164383561643835 0 2 82.95595761326112 2.956164383561644 0 2 40.97006606558463 .005479452054794521 1 1 63.13995695244534 5.632876712328767 0 0 34.842766266200414 .06301369863013699 0 0 41.11331006276459 1.2136986301369863 0 2 51.042090237658954 1.6821917808219178 1 1 32.221270062216206 2.863013698630137 1 1 94.55254025513551 2.536986301369863 0 2 64.25479044602412 4.986301369863014 0 0 85.53763941999223 5.884931506849315 0 0 59.82553903662927 4.027397260273973 0 2 47.406342381674285 3.361643835616438 0 2 80.0341790090197 5.2164383561643835 0 0 77.52828930633353 5.506849315068493 0 0 88.72064753567126 5.923287671232877 0 0 69.96110899348741 3.9863013698630136 0 2 29.58498534343226 2.989041095890411 0 2 30.573486762889484 4.6 0 2 87.27689606276033 5.865753424657535 0 0 86.69255336356497 1.126027397260274 1 1 84.44404255202681 1.0136986301369864 0 2 56.718479356451866 4.750684931506849 0 0 52.360618866869956 5.101369863013699 0 0 83.07925812993352 5.638356164383562 0 0 84.78195952400584 5.476712328767123 0 0 60.95565168138794 2.3315068493150686 0 2 71.72568755502907 1.9863013698630136 0 2 86.44971131521613 5.153424657534247 0 0 77.56036642753939 5.2164383561643835 0 0 76.22968949737808 5.441095890410959 0 0 32.34380082165387 4.980821917808219 1 1 72.86264637885468 5.304109589041096 0 0 59.47648360642566 5.336986301369863 0 0 46.746082441122354 .9945205479452055 0 2 63.218005395906154 .9013698630136986 0 2 33.912868021307396 2.2383561643835614 0 2 64.3339826873198 .6246575342465753 0 2 71.78701795529284 5.586301369863014 0 0 63.012042270451374 5.076712328767123 0 0 85.68729721513115 2.2356164383561645 0 2 69.35682549349025 5.47945205479452 0 0 25.550182101702347 5.315068493150685 0 0 81.13746130187278 1.284931506849315 1 1 82.28684917682992 5.641095890410959 0 0 79.3032530624813 5.126027397260274 0 0 54.95532968436881 5.273972602739726 0 0 79.79522914939457 5.67945205479452 0 0 55.70919152132845 5.868493150684931 0 0 58.12894590732193 4.945205479452055 0 0 66.0962670444611 3.9178082191780823 0 2 76.83033571378041 3.747945205479452 0 2 48.327959386470845 5.082191780821918 0 0 89.12964782229204 5.67945205479452 0 0 72.79670966506109 5.389041095890411 0 0 40.85153593166688 4.986301369863014 0 0 52.764917357309216 5.065753424657534 0 0 53.304172069788955 5.260273972602739 0 0 83.04353876124884 5.082191780821918 0 2 68.40997737724557 5.843835616438356 0 0 34.00368836568721 .5287671232876713 0 2 69.23913360547446 5.635616438356164 0 0 83.85066278219877 3.3095890410958906 1 1 70.89498632731916 1.2465753424657535 0 2 24.396859629216046 5.956164383561644 0 0 29.285312206206175 .6 0 2 94.43730121670586 4.358904109589041 0 0 3.6591571452903633 1.8986301369863015 0 2 47.69502434397435 4.175342465753425 0 2 56.3730439308164 .7561643835616438 1 1 61.35744195325357 4.468493150684932 0 2 63.80225374107232 5.315068493150685 0 0 71.32293259054916 5.36986301369863 0 0 34.04231573111613 .5232876712328767 0 2 79.38141707928628 3.243835616438356 0 2 76.91294749362936 1.2712328767123289 0 2 58.43577760474752 5.789041095890411 0 0 46.27941762173601 4.454794520547945 1 1 36.910605982230706 .410958904109589 1 1 56.50787036717749 2.6575342465753424 0 2 end [/CODE]