Hi, I have a PROC NLMIXED where some parameters are known to take on some values in a pre-specified grids. I want to put this PROC NLMIXED procedure into a FOR LOOP or something similar, where everytime the parameters take the value in the grid, then the PROC NLMIXED is run, then the output (for example, the parameter estimate or the likelihood) are exported. Finally, I want to combine all these outputs together. I tried searching on the internet but it seems there is no useful source for me. Let take an example: I use the data set and the code from the website of UCLA: (Link: http://www.ats.ucla.edu/stat/sas/faq/cens_nlmixed.htm). The code is: proc nlmixed data=Simu XTOL=1E-12 method=GAUSS qpoints=100;
parms beta0=7.3 beta1=-.21 beta2=.96 beta3=3
sigma2_u=.7 sigma2=75;
bounds sigma2_u sigma2 >= 0;
pi = constant('pi');
mu = beta0 + b_0j + beta1*Xc1 + beta2*Xc2 + beta3*Xi1;
if Ycensr < 16 then
ll = (1 / (sqrt(2*pi*sigma2))) * exp( -(Ycensr-mu)**2 / (2*sigma2) );
if Ycensr >= 16 then
ll = 1 - probnorm( (Ycensr - mu) / sqrt(sigma2) );
L=log(ll);
model Ycensr ~ general(L);
random b_0j ~ normal(0, sigma2_u) subject=ID;
run;
quit; The data file is put in the attachment for easy following the question. Suppose now I have known that beta0 is in c(1,2,3,4,5,6,7,8,9,10) and beta1 is in (-2.5, -2.0,-1.5,-0.5,0). I want to put this PROC NLMIXED procedure into a FOR loop and let beta0 and beta1 only receive values from these two sequences. I have tried macro variables but it seemed that PROC NLMIXED considered beta0 and beta1 as parameters need to be estimated and optimized the likelihood function with respect of these two parameters as well. How do I do this? Does any one have a good reference? P/s: I use SAS 9.4 Thank you.
... View more