---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/RJCC/Documents/rjcc3/pwin/pwin.smcl
  log type:  smcl
 opened on:   3 Mar 2016, 08:41:16


. * insheet using dddd.csv, delimiter(";") clear . import excel "`dirname'/pwin_lungca.xlsx", sheet("pce_pri") firstrow case(lower) clear

. * Hypothesis: PCE window had better survival if lung ca=0 . * Variables: . * id age dob d_adm d_mbd F die_mbd op d_op lca lungca die2 d_last dxi . * Plans: . * Baseline (overall, lungca=0,1): age sex(F) dxi . * Outcome die_mbd die2 los fu_die . * K-M curve (die_mbd, los) for lungca=0 vs 1, log-rank test . * K-M curve (die2, fu_die) for lungca=0 vs 1, log-rank test . . co lungca age

Summary for variables: age by categories of: lungca (lungca)

lungca | N mean sd p50 iqr min max -------+---------------------------------------------------------------------- N | 22 59.97727 10.07515 60.875 14.91667 43.16667 77.08333 Y | 30 63.06944 13.50023 62.95833 15.83333 31.16667 86.5 -------+---------------------------------------------------------------------- Total | 52 61.76122 12.15784 62.45833 18.33333 31.16667 86.5 ------------------------------------------------------------------------------

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

lungca | obs rank sum expected -------------+--------------------------------- N | 22 526 583 Y | 30 852 795 -------------+--------------------------------- combined | 52 1378 1378

unadjusted variance 2915.00 adjustment for ties -0.25 ---------- adjusted variance 2914.75

Ho: age(lungca==N) = age(lungca==Y) z = -1.056 Prob > |z| = 0.2911

. ca lungca f

+-------------------+ | Key | |-------------------| | frequency | | row percentage | | column percentage | +-------------------+

| f lungca | 0 1 | Total -----------+----------------------+---------- N | 11 11 | 22 | 50.00 50.00 | 100.00 | 34.38 55.00 | 42.31 -----------+----------------------+---------- Y | 21 9 | 30 | 70.00 30.00 | 100.00 | 65.62 45.00 | 57.69 -----------+----------------------+---------- Total | 32 20 | 52 | 61.54 38.46 | 100.00 | 100.00 100.00 | 100.00

Fisher's exact = 0.162 1-sided Fisher's exact = 0.120

. forvalues i = 1(1)12 { 2. icd9 gen dx`i'a = dx`i', des 3. }

. list dx1a dx2a dx3a dx4a

+------------------------------------------------------------------------------------------------------------+ | dx1a dx2a dx3a dx4a | |------------------------------------------------------------------------------------------------------------| 1. | mal neo middle lobe lung enlargement lymph nodes sciatica pleural effusion nos | 2. | cardiogenic shock mal neo upper lobe lung | 3. | mal neo nasopharynx nos pericardial disease nos secondary malig neo lung mal neo lymph-axilla/arm | 4. | mal neo upper lobe lung empyema w/o fistula pericardial disease nos acute kidney failure nos | 5. | secondary malig neo nec pericardial disease nos cardiogenic shock | |------------------------------------------------------------------------------------------------------------| 6. | post-proc states nec hepatitis b carrier | 7. | mal neo soft tissue leg | 8. | second malig neo adrenal pericardial disease nos hypopotassemia | 9. | cardiogenic shock mal neo bronch/lung nos hypertension nos | 10. | shock nos pericardial disease nos chr airway obstruct nec cachexia | |------------------------------------------------------------------------------------------------------------| 11. | mal neo lymph-axilla/arm second malig neo pleura pericardial disease nos cachexia | 12. | accidental op laceration ventricular flutter vocal paral unilat part mononeuritis arm nec | 13. | mal neo lower lobe lung secondary malig neo bone acute respiratry failure | 14. | pericardial disease nos obs chr bronc w(ac) exac pleural effusion nos esophageal reflux | 15. | malign neopl breast nos secondary malig neo bone secondary malig neo lung cachexia | |------------------------------------------------------------------------------------------------------------| 16. | acute respiratry failure pneumonia, organism nos pleural effusion nos pericardial disease nos | 17. | mal neo cervix uteri nos secondary malig neo lung insomnia nos constipation* | 18. | secondary malig neo bone second malig neo liver secondary malig neo nec pericardial disease nos | 19. | mal neo lymph-head/neck pericardial disease nos pleural effusion nos | 20. | pleural effusion nos malig neopl stomach nos sec mal neo peritoneum hx of breast malignancy | |------------------------------------------------------------------------------------------------------------| 21. | pleural effusion nos | 22. | pleural effusion nos react-oth vasc dev/graft mal neo lower lobe lung | 23. | secondary malig neo nec septicemia nos second malig neo pleura thrush | 24. | mal neo upper lobe lung second malig neo pleura chr airway obstruct nec allergic rhinitis nos | 25. | mal neo lymph-intrathor secondary malig neo nec pericardial disease nos pleural effusion nos | |------------------------------------------------------------------------------------------------------------| 26. | mal neo lower lobe lung k. pneumoniae pneumonia secondary malig neo nec second malig neo pleura | 27. | pleural effusion nos chf nos atrial fibrillation mal neo esophagus nos | 28. | secondary malig neo nec dmii wo cmp nt st uncntr | 29. | myasthenia gravis# atrial fibrillation mononeuritis arm nec traum subcutan emphysema | 30. | sec mal neo brain/spine pericardial disease nos neurofibromatosis type i endocarditis nos | |------------------------------------------------------------------------------------------------------------| 31. | pericardial disease nos pleural effus nec not tb# chr peptic ulcer w hem hyperpotassemia | 32. | secondary malig neo lung secondary malig neo bone pericardial disease nos | 33. | pleural effusion nos acute kidney failure nos renal & ureteral dis nos | 34. | pericardial disease nos | 35. | pleural effusion nos benign neo esophagus | |------------------------------------------------------------------------------------------------------------| 36. | pericardial disease nos | 37. | radiotherapy encounter mal neo middle 3rd esoph pericardial disease nos pleural effusion nos | 38. | secondary malig neo lung pericardial disease nos pleural effusion nos pneumonia, organism nos | 39. | secondary malig neo nec secondary malig neo lung pericardial disease nos mal neo nasopharynx nos | 40. | mal neo cervix uteri nos mal neo lymph-head/neck mal neo lymph-inguin/leg pericardial disease nos | |------------------------------------------------------------------------------------------------------------| 41. | secondary malig neo nec secondary malig neo bone asthma nos hx-oral/pharynx malg nec | 42. | pericardial disease nos pleural effusion nos | 43. | | 44. | benign neoplasm heart cirrhosis of liver nos ascites# pleural effusion nos | 45. | chf nos hyperlipidemia nec/nos hypertrophy of prostate# chr airway obstruct nec | |------------------------------------------------------------------------------------------------------------| 46. | chronic sinusitis nos | 47. | mal neo lower lobe lung pericardial disease nos atrial fibrillation | 48. | asthma nos w (ac) exac mal neo bronch/lung nos | 49. | secondary malig neo bone pericardial disease nos | 50. | secondary malig neo nec secondary malig neo bone stomach ulcer nos vocal cord paralysis nos | |------------------------------------------------------------------------------------------------------------| 51. | malignant neoplasm nos pericardial disease nos hypertension nos | 52. | pericardial disease nos pneumonia, organism nos mal neo upper lobe lung secondary malig neo bone | +------------------------------------------------------------------------------------------------------------+

. list dx5a dx6a dx7a dx8a

+----------------------------------------------------------------------------------------------------------+ | dx5a dx6a dx7a dx8a | |----------------------------------------------------------------------------------------------------------| 1. | dis plas protein met nec dis urea cycle metabol anemia nos dmii wo cmp nt st uncntr | 2. | | 3. | | 4. | oliguria & anuria other dsrders esophagus ulcer of esophagus# oth spf gstrt w/o hmrhg | 5. | | |----------------------------------------------------------------------------------------------------------| 6. | | 7. | | 8. | | 9. | | 10. | dmii wo cmp nt st uncntr | |----------------------------------------------------------------------------------------------------------| 11. | | 12. | | 13. | | 14. | | 15. | | |----------------------------------------------------------------------------------------------------------| 16. | septicemia nos hyperosmolality hypopotassemia hypovolemia# | 17. | heart failure nos | 18. | | 19. | | 20. | | |----------------------------------------------------------------------------------------------------------| 21. | | 22. | | 23. | | 24. | constipation* hypertension nos hepatitis b carrier | 25. | | |----------------------------------------------------------------------------------------------------------| 26. | | 27. | | 28. | | 29. | | 30. | hepatitis b carrier | |----------------------------------------------------------------------------------------------------------| 31. | hyposmolality | 32. | | 33. | | 34. | | 35. | | |----------------------------------------------------------------------------------------------------------| 36. | | 37. | | 38. | | 39. | | 40. | gram-neg septicemia nec cardiomegaly anemia nos dis plas protein met nec | |----------------------------------------------------------------------------------------------------------| 41. | | 42. | | 43. | | 44. | | 45. | mal neo lower lobe lung mal neo lymph-intrathor dmii wo cmp nt st uncntr secondary malig neo nec | |----------------------------------------------------------------------------------------------------------| 46. | | 47. | | 48. | | 49. | | 50. | | |----------------------------------------------------------------------------------------------------------| 51. | | 52. | secondary malig neo lung chf nos panhypopituitarism diabetes insipidus | +----------------------------------------------------------------------------------------------------------+

. list dx9a dx10a dx11a dx12a

+-----------------------------------------------------------------------------------------------------------+ | dx9a dx10a dx11a dx12a | |-----------------------------------------------------------------------------------------------------------| 1. | hypertrophy of prostate# diarrhea | 2. | | 3. | | 4. | vocal paral unilat part alcoh dep nec/nos-unspec | 5. | | |-----------------------------------------------------------------------------------------------------------| 6. | | 7. | | 8. | | 9. | | 10. | | |-----------------------------------------------------------------------------------------------------------| 11. | | 12. | | 13. | | 14. | | 15. | | |-----------------------------------------------------------------------------------------------------------| 16. | obs chr bronc w(ac) exac constipation* | 17. | | 18. | | 19. | | 20. | | |-----------------------------------------------------------------------------------------------------------| 21. | | 22. | | 23. | | 24. | | 25. | | |-----------------------------------------------------------------------------------------------------------| 26. | | 27. | | 28. | | 29. | | 30. | | |-----------------------------------------------------------------------------------------------------------| 31. | | 32. | | 33. | | 34. | | 35. | | |-----------------------------------------------------------------------------------------------------------| 36. | | 37. | | 38. | | 39. | | 40. | pleural effusion nos | |-----------------------------------------------------------------------------------------------------------| 41. | | 42. | | 43. | | 44. | | 45. | malig neo parotid hx of colonic malignancy | |-----------------------------------------------------------------------------------------------------------| 46. | | 47. | | 48. | | 49. | | 50. | | |-----------------------------------------------------------------------------------------------------------| 51. | | 52. | hypothyroidism nos endocrine/nerv neo nos corticoadrenal insuffic# dis plas protein met nec | +-----------------------------------------------------------------------------------------------------------+

. . ca lungca die_mbd

+-------------------+ | Key | |-------------------| | frequency | | row percentage | | column percentage | +-------------------+

| die_mbd lungca | 0 1 | Total -----------+----------------------+---------- N | 19 3 | 22 | 86.36 13.64 | 100.00 | 44.19 33.33 | 42.31 -----------+----------------------+---------- Y | 24 6 | 30 | 80.00 20.00 | 100.00 | 55.81 66.67 | 57.69 -----------+----------------------+---------- Total | 43 9 | 52 | 82.69 17.31 | 100.00 | 100.00 100.00 | 100.00

Fisher's exact = 0.717 1-sided Fisher's exact = 0.415

. ca lungca die2

+-------------------+ | Key | |-------------------| | frequency | | row percentage | | column percentage | +-------------------+

| die2 lungca | 0 1 | Total -----------+----------------------+---------- N | 16 6 | 22 | 72.73 27.27 | 100.00 | 72.73 20.00 | 42.31 -----------+----------------------+---------- Y | 6 24 | 30 | 20.00 80.00 | 100.00 | 27.27 80.00 | 57.69 -----------+----------------------+---------- Total | 22 30 | 52 | 42.31 57.69 | 100.00 | 100.00 100.00 | 100.00

Fisher's exact = 0.000 1-sided Fisher's exact = 0.000

. co lungca los

Summary for variables: los by categories of: lungca (lungca)

lungca | N mean sd p50 iqr min max -------+---------------------------------------------------------------------- N | 22 10.95455 7.319103 8.5 10 1 27 Y | 30 13.93333 12.61617 10 8 2 65 -------+---------------------------------------------------------------------- Total | 52 12.67308 10.71323 10 8 1 65 ------------------------------------------------------------------------------

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

lungca | obs rank sum expected -------------+--------------------------------- N | 22 535.5 583 Y | 30 842.5 795 -------------+--------------------------------- combined | 52 1378 1378

unadjusted variance 2915.00 adjustment for ties -13.19 ---------- adjusted variance 2901.81

Ho: los(lungca==N) = los(lungca==Y) z = -0.882 Prob > |z| = 0.3779

. co lungca fu_die

Summary for variables: fu_die by categories of: lungca (lungca)

lungca | N mean sd p50 iqr min max -------+---------------------------------------------------------------------- N | 22 1750.727 1527.314 1427.5 3102 3 4078 Y | 30 627.1 1086.225 83 549 2 3741 -------+---------------------------------------------------------------------- Total | 52 1102.481 1394.862 382 2224 2 4078 ------------------------------------------------------------------------------

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

lungca | obs rank sum expected -------------+--------------------------------- N | 22 756 583 Y | 30 622 795 -------------+--------------------------------- combined | 52 1378 1378

unadjusted variance 2915.00 adjustment for ties -0.25 ---------- adjusted variance 2914.75

Ho: fu_die(lungca==N) = fu_die(lungca==Y) z = 3.204 Prob > |z| = 0.0014

. . stset los, failure(die_mbd) scale(7)

failure event: die_mbd != 0 & die_mbd < . obs. time interval: (0, los] exit on or before: failure t for analysis: time/7

------------------------------------------------------------------------------ 52 total observations 0 exclusions ------------------------------------------------------------------------------ 52 observations remaining, representing 9 failures in single-record/single-failure data 94.14286 total analysis time at risk and under observation at risk from t = 0 earliest observed entry t = 0 last observed exit t = 9.285714

. sts graph, ytitle(Proportion of Survival) /// > ylabel(, angle(horizontal)) /// > risktable censored(single) /// > by(lungca) title(Kaplan-Meier Curves (Survival on Discharge)) /// > xtitle(Week) xlabel(0(1)10) caption(Log-rank test p=0.9736)

failure _d: die_mbd analysis time _t: los/7

. sts test lungca

failure _d: die_mbd analysis time _t: los/7



Log-rank test for equality of survivor functions

| Events Events lungca | observed expected -------+------------------------- N | 3 3.05 Y | 6 5.95 -------+------------------------- Total | 9 9.00

chi2(1) = 0.00 Pr>chi2 = 0.9736

. graph export km_die_mbd.pdf, replace (file /Users/RJCC/Documents/rjcc3/pwin/km_die_mbd.pdf written in PDF format)

. . stset fu_die, failure(die2) scale(30.5)

failure event: die2 != 0 & die2 < . obs. time interval: (0, fu_die] exit on or before: failure t for analysis: time/30.5

------------------------------------------------------------------------------ 52 total observations 0 exclusions ------------------------------------------------------------------------------ 52 observations remaining, representing 30 failures in single-record/single-failure data 1879.639 total analysis time at risk and under observation at risk from t = 0 earliest observed entry t = 0 last observed exit t = 133.7049

. sts graph, ytitle(Proportion of Survival) /// > ylabel(, angle(horizontal)) /// > risktable censored(single) /// > by(lungca) title(Kaplan-Meier Curves (Overall Survival)) /// > xlabel(0(12)134) xtitle(Month) caption(Log-rank test p=0.0002)

failure _d: die2 analysis time _t: fu_die/30.5

. sts test lungca

failure _d: die2 analysis time _t: fu_die/30.5



Log-rank test for equality of survivor functions

| Events Events lungca | observed expected -------+------------------------- N | 6 15.96 Y | 24 14.04 -------+------------------------- Total | 30 30.00

chi2(1) = 13.66 Pr>chi2 = 0.0002

. graph export km_die2.pdf, replace (file /Users/RJCC/Documents/rjcc3/pwin/km_die2.pdf written in PDF format)

. . log close name: <unnamed> log: /Users/RJCC/Documents/rjcc3/pwin/pwin.smcl log type: smcl closed on: 3 Mar 2016, 08:41:20 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------