The survival function for the Weibull distribution is:
$S(t) = exp(-\lambda t^\alpha)$, $\lambda$ = scale parameter, $\alpha$ = shape parameter
If I wanted to calculate the median survival time, I would set $S(t) = 0.5$. Rearranging terms, this means the median survival time would be calculated as follows:
$t_{median} = (\frac{-log(0.5)}{\lambda})^{(1/\alpha)}$
Let's say I set $\lambda = 3$ and $\alpha = 2$. Then the median survival time is clearly:
$t_{median} = (\frac{-log(0.5)}{3})^{(1/2)} = 0.481$
However, when I do a sanity check on this and run this in R, the median survival for a Weibull distribution with scale = 3 and shape = 2 is clearly not 0.481 and is more like 2.5:
Time <- sort(rweibull(1000, shape = 2, scale = 3))
Time[500]
Any time I run this code, I am getting somewhere right around 2.5, +/- 0.1 or so. But definitely nowhere near 0.481.
So what do I have wrong here? Why is the actual median time for simulated data nowhere near the theoretical median time?