/* The following will fit a Weibull or exponential model with multiplicative heteroskedasticity. The model is that in the LIMDEP manual on page 732 with the modification p = exp(-c'z) z is a vector of covariates that must NOT contain ONE. c is the new set of variance parameters to be estimated. Note that the variance term, sigma, is the same as in LIMDEP's other multiplicative heteroskedasticity models. The setup used here is for version 7.0 of LIMDEP, but a simple modification will make it compatible with version 6.0. In the routine, X and Z must be namelists. Y is the log of the TIME (duration) variable. D is the censoring status indicator. Usage is illustrated below. If your data are not censored, change 'd' to '1' in the Execute command. */ ? Define Procedure Proc = WeiblHet(y,d,X,Z) $ ? Dimensions of X and Z matrices Calc ; K = Col(X) ; L = Col(Z) $ ? Starting values from Weibull model without heteroskedasticity ? b is slope vector. Scalar s is sigma = 1/p/ Surv ; Lhs = y ; Rhs = X ; Model = Weibull $ ? MLE for model with heteroskedasticity. Function is that given ? in the manual, plus the additional term for the hetero. Maximize ; fcn = w=(y - b1'X)/(sw*exp(t1'Z)) | d*(w - log(sw)-t1'Z) - exp(w) ; start=b,s,L_0 ; labels=K_b,Sw,L_t $ EndProc /* This is a small test application. */ Sample ; 1 - 100$ Create ; xtest = rnn(0,1) ; ytest = xtest+rnn(0,1) ; ztest = rnn(0,1)>0 ; dtest = rnn(0,1) > -1$ Name ; XT = one,xtest ; ZT = ztest $ Exec ; Proc=WeiblHet(ytest,dtest,XT,ZT) $