Dear Statalist,
I want to do a Cox regression including lung function measurements as a tvc. I have two measurements for each participant, FEV1FVCRMe_NT2BLM and FEV1FVCR_NT3LuM, both continuous variables. These are measured at _t0 (PartDate_NT2BLQ1) and _t (PartDate_NT3BLQ1). I want to create a new variable, FEV1FVC (the tvc variable). How could I create continuous variables from these two, taking into account the dates of measurement?
Best regards,
Sigrid
I want to do a Cox regression including lung function measurements as a tvc. I have two measurements for each participant, FEV1FVCRMe_NT2BLM and FEV1FVCR_NT3LuM, both continuous variables. These are measured at _t0 (PartDate_NT2BLQ1) and _t (PartDate_NT3BLQ1). I want to create a new variable, FEV1FVC (the tvc variable). How could I create continuous variables from these two, taking into account the dates of measurement?
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long(PartDat_NT2BLQ1 PartDat_NT3BLQ1) double(FEV1FVCRMe_NT2BLM FEV1FVCR_NT3LuM)
13444 17079 . .
13114 17293 . .74
13619 17675 . .746
13040 . . .
13537 . . .
13065 . . .
13300 17289 . .
13661 17640 . .
13522 17538 . .
13116 17342 . .
13468 . . .
13394 . .83 .
13212 17448 . .
13117 17385 .724 .745
13425 . . .
13670 17674 . .
13377 . . .
13403 . . .
13654 17689 . .
13459 17274 . .
13535 17580 .762 .679
13647 . .76 .
13207 17140 .646 .749
. 17651 . .
. 17644 . .
13236 17498 . .
13124 17282 . .
13082 17475 .777 .
. 17324 . .56
13388 17237 . .
. 17336 . .
. 17553 . .
13201 . .654 .
13216 17489 . .
13675 17644 . .
. 17189 . .
13480 17672 . .
13677 17660 . .
13472 17667 . .
13614 . .741 .
13065 17343 . .708
. 17632 . .
. 17623 . .
13403 . . .
13675 17688 . .
13543 17230 .782 .716
13569 . . .
13683 . .735 .
13457 . . .
13440 . .568 .
13293 . . .
13678 17660 . .
13055 17321 . .
13430 17092 .7 .7
13165 17395 . .
13115 . . .
13135 . . .
13293 . .755 .
. 17391 . .
13079 17447 .874 .
. 17707 . .899
13193 . . .
13461 17317 . .
13317 17238 . .
13123 . . .
13206 . . .
13591 17630 .708 .7
13475 17566 . .
. 17491 . .
. 17328 . .
13032 . . .
13152 . . .
13289 17589 . .
13499 17505 . .748
. 17406 . .808
13212 . . .
13130 17205 . .
13191 . .636 .
13310 17283 . .
13221 17447 . .
13234 17492 .774 .766
13038 17407 . .
13565 . . .
. 17660 . .
13255 . . .
13416 . . .
. 17315 . .
. 17632 . .
13212 . . .
13534 . . .
13375 . . .
. 17290 . .
13235 17174 . .
. 17475 . .
13424 17120 . .
13052 . . .
. 17269 . .775
13628 . .514 .
13212 17496 . .778
13289 . . .
end
format %tdD_m_Y PartDat_NT2BLQ1
format %tdD_m_Y PartDat_NT3BLQ1
Sigrid

Comment