/* Fit using SAS macro NLINMIX */ /* This program uses the newest version of the macro availble on the sas web site */ options ps=55 ls=80 nodate; /* include the macro from file nlinmix.sas */ %inc 'nlinmix_macro.sas' / nosource; /* input the data */ data arg; infile 'argconc.dat'; input obsno indiv dose time conc; run; data arg; set arg; tinf=240; t1=1; if time>tinf then t1=0; t2=tinf*(1-t1)+t1*time; run; /* for first order approxiation, use expand=zero, for exansion around empirical Bayes estiamtes, use expand=eblup, */ %nlinmix(data=arg, model=%str( logcl=beta1+b1; logv=beta2+b2; cl=exp(logcl); v=exp(logv); predv=(dose/cl)*(1-exp(-cl*t2/v))*exp(-cl*(1-t1)*(time-tinf)/v); ), derivs=%str( wt=1/predv**(2*0.22); ), parms=%str(beta1=-6.0 beta2=-2.0), stmts=%str( class indiv; model pseudo_conc = d_beta1 d_beta2 / noint notest solution ; random d_b1 d_b2 / subject=indiv type=un solution; weight wt; ), expand=zero, procopt=%str(maxiter=500 method=ml) ) run;