Good day all,

i need to run a hcost command to calculate cost estimate based on censored data [https://www.stata-journal.com/articl...article=st0399]

attached is a part of the data:
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte(case_id castage6) int(treatmentduration days_post1year) byte censurepost1y double(hctotal hctotal_post1y)
 1 2  916  551 0            4899.58 1088.48
 2 2 1465 1100 0           10278.75  6236.8
 3 2  618  253 0             4245.7   889.3
 4 2  727  362 0           5500.966  1500.9
 5 2 1527 1162 0            3763.54  1721.7
 6 1 1197  832 0           48420.82  4053.8
 7 2 2670 2305 0 14814.779999999999  7231.4
 8 2 3909 3544 0           18826.22   14630
 9 1 1827 1462 0           61879.55   15288
10 2  435   70 0            2811.76     240
11 2  471  106 0            3628.82   377.6
12 2 3485 3120 0            5627.92    3683
13 2 4136 3771 0           15821.55 11648.6
14 2  741  375 0            9464.49  1245.5
15 2 1220  855 0            4998.21  1815.1
16 2  962  597 0               8375  1375.6
17 2  588  223 0            4292.17   874.5
18 1  544  179 0           53026.91  3578.5
19 2 2001 1636 0            7544.65    2450
20 2  438   73 0            3730.01     240
end
i managed to run the analysis for the first time. however, I am not able to rerun the test or on different variable using hcost again as it continues to show error

my command:
Code:
stset days_post1year , id(case_id) failure(censurepost1y)
hcost case_id hctotal_post1y , l(365) method(0) group(castage6)
it shows:
Code:
_sum_table() already in library
(1 line skipped)
(error occurred while loading hcost.ado)
r(110)
I believe this is because the calculation is stored in a temporary file and is preventing me from running a similar analysis.

if I try to repeat the test by saving with a different file to run the analysis, it still shows a similar error

command:
Code:
sjlog using hcost10, replace
stset days_post1year , id(case_id) failure(censurepost1y)
hcost case_id hctotal_post1y , l(365) method(0) group(castage6)
i still get the error:
Code:
_sum_table() already in library
(1 line skipped)
(error occurred while loading hcost.ado)
r(110);
is there a way for me to clear this temporary file or to save it under a different temporary file for analysis? or any solutions to resolve the problem. any help is much appreciated.

regards.