Closed WetRobot closed 3 years ago
from the code only: this should not happen unless the cvs import fails or the directory is RO:
(could you run with trace on )
if ( strlower(substr("`lifetable'",-4,.)) != ".dta" ) {
import delimited using "`lifetable'" , ///
varnames(1) ///
encoding("UTF-8") ///
delimiter(";") ///
case(preserve) ///
asdouble
capture rename age _age
capture rename year _year
sort _year sex _age
mata : st_local("lifetable", pathrmsuffix("`lifetable'"))
save "`lifetable'" , replace
}
or the dta exists AND IS RO
the fix which will be implemented AFTER the 2. Oct version : from line 30:...
mata : st_local("stub", pathrmsuffix("`lifetable'"))
save "`stub'" , replace
confirm file "`stub'.dta"
local lifetable = "`stub'.dta"
The fix on the R side can be removed, and new code tested.
It appears to only create the .dta version of the life table file and then stop.
This is currently circumvented in nordcanstat_survival by calling survival_statistics twice, but I suppose it's better to fix the the underlying stata implementation.