I have a continuous variable to which I want to fit a Weibull distribution. The variable is right censored. My objective is to estimate the shape and scale parameters. Because I’m failing with my data, I created a hypothetical example:

set obs 5000
generate x = rweibull(6.183, 12.23)

generate xCensor = 0
replace xCensor = 1 if runiform() < 0.01

stset x, failure(xCensor)
streg x, distribution(weibull)




_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | .0069157 .0043201 -7.96 0.000 .0020329 .0235266
_cons | 9.62e-39 1.00e-37 -8.41 0.000 1.34e-47 6.93e-30
-------------+----------------------------------------------------------------
/ln_p | 4.054029 .1238296 32.74 0.000 3.811327 4.29673
-------------+----------------------------------------------------------------
p | 57.62916 7.136195 45.2104 73.4592
1/p | .0173523 .0021487 .013613 .0221188
------------------------------------------------------------------------------


The estimated shape parameter 4.054 differs considerably from 6.183. In addition, the estimated scale parameter, exp(0.0069157) = 1.

I’d appreciate assistance in understanding what I’m clearly doing incorrectly to estimate the 6.183 and 12.23.