SAS/Maximum Likelihood

From Wikibooks, open books for an open world
< SAS
Jump to navigation Jump to search
  • PROC NLMIXED allows you to specify your likelihood
proc nlmixed data = recidiv ;
parms cst = 0 b_male = 0 b_black = 0 b_release =0 b_age = 0;
xb = cst + b_male*male + b_black*black + b_release*release + b_age*age__days_1000_ ; 
if c = 1 then prob = exp(-exp(xb)*y);
if c = 0 then prob = exp(xb)*exp(-exp(xb)*y);
ll= log(prob);
model y ~ general(ll);
run;
  • parms gives initial values to the parameters
  • xb is an intermediate step which gives the list of covariates
  • then we define the likelihood and we specify the model


  • One can also use the IML language and use one of the built-in optimizer.