proc nlmixed data=lab3; /*the dataset include two variable: ID, age for death*/ parms mu 1 sigma 1 ; bounds 0 < sigma; G_t=exp ((age- mu)/sigma); g=exp((age-mu)/sigma)/sigma; ll= exp(- G_t)* g; model age~ general(ll); run;
I wrote the code based on the below conditions:
We consider the location-scale-skew transform
G(y)=exp[( y−μ)/σ] with derivative g(y)=exp[( y−μ)/σ]/σ.
We assume that G(Y)∼fE(y)=exp(−y). Then Y follows a generalized extreme value distribution fSE(y)=fE[G(y)]g(y)=exp[−G(y)]g(y)
however, the code does not work well.
NOTE: Convergence criterion (FCONV=2.220446E-13) satisfied. NOTE: At least one element of the gradient is greater than 1e-3. NOTE: Moore-Penrose inverse is used in covariance matrix. WARNING: The final Hessian matrix is full rank but has at least one negative eigenvalue. Second-order optimality condition violated. NOTE: PROCEDURE NLMIXED used (Total process time): real time 1.98 seconds cpu time 1.61 seconds
does anyone know how to do this in SAS?
proc nlmixed data=lab3;
parms mu 80 sigma 5 ;
bounds 0 < sigma;
ll= -exp((age - mu)/sigma) + (age - mu)/sigma - log (sigma);
model age~general(ll);
run;
updating.
The above syntax works well this time. it seems that I need to define the initial value for mu and sigma near the value of parameters. Is there any way to deal with the initial value or do I have to give the initial value artificially?
proc nlmixed data=lab3;
parms mu 80 sigma 5 ;
bounds 0 < sigma;
ll= -exp((age - mu)/sigma) + (age - mu)/sigma - log (sigma);
model age~general(ll);
run;
updating.
The above syntax works well this time. it seems that I need to define the initial value for mu and sigma near the value of parameters. Is there any way to deal with the initial value or do I have to give the initial value artificially?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.