Hi all,
I am trying to use the stpm2cr package in order to model the hazard of lung cancer with the competing risk of all-cause mortality. I am trying to estimate a simple single covariate (x1) example whereby I specify the boundary knots and the internals knots for the baseline hazard (using restricted cubic splines). However, when I use the bknots(#) and knots(#) suboptions, Stata kicks back the error that I can only use DF or KNOTS.
When I exclude the bknots and knots suboptions, and only specify the DF for the splines, it estimates and converges with no issues. However, I have meaningful (possibly) knots that I want to place, and I can't seem to get it to run. I have been unable to troubleshoot this error, but it may be a simple coding issue.
Here is a simplified example of the code that runs properly:
Here is a simplified example of the code that will not execute:
Thank you in advance for your help.
Matt
I am trying to use the stpm2cr package in order to model the hazard of lung cancer with the competing risk of all-cause mortality. I am trying to estimate a simple single covariate (x1) example whereby I specify the boundary knots and the internals knots for the baseline hazard (using restricted cubic splines). However, when I use the bknots(#) and knots(#) suboptions, Stata kicks back the error that I can only use DF or KNOTS.
When I exclude the bknots and knots suboptions, and only specify the DF for the splines, it estimates and converges with no issues. However, I have meaningful (possibly) knots that I want to place, and I can't seem to get it to run. I have been unable to troubleshoot this error, but it may be a simple coding issue.
Here is a simplified example of the code that runs properly:
stpm2cr [ lung: x1 , scale(hazard) df(4) ] [ death: x1 , scale(hazard) df(4) ] , events(failure) cause( 1 2 ) cens(0) eform
stpm2cr [ lung: x1 , scale(hazard) bknots(50 70) knots(60 65) ] [ death: x1 , scale(hazard) bknots(50 70) knots(60 65) ] , events(failure) cause( 1 2 ) cens(0) eform
Matt
Comment