/* fit the HCV data using the nlinmix macro */ options ps=59 ls=80 nodate; run; /* include the macro from file nlinmix.sas */ %inc 'nlinmix_macro.sas' / nosource; data hcv; infile "hcvmix.dat"; input id days vl; run; %nlinmix(data=hcv, model=%str( v0=exp(beta1+b1); cc=exp(beta2+b2); e=exp(beta3+b3); t0=0.2; dd=0; if days>t0 then dd=1; tt = dd*(days-t0); predv = v0*(1-e+e*exp(-cc*tt)); ), derivs=%str( d_beta1 = predv; d_beta2 = -v0*e*exp(-cc*tt)*cc*tt; d_beta3 = v0*e*(exp(-cc*tt)-1); wt=1/(predv*predv); ), parms=%str(beta1=1.5 beta2=1.5 beta3=-0.15), stmts=%str( class id; model psuedo_vl = d_beta1 d_beta2 d_beta3 / noint notest solution; random d_b1 d_b2 d_b3 / subject=id type=un solution; weight wt; ), expand=eblup, procopt=%str(empirical method=ml) )