options ls=120 ps=60; ods graphics on; PROC IMPORT OUT=simsig_all FILE="/export/home/llifshit/raz/sas_multsim3_data.txt" DBMS=DLM REPLACE; DELIMITER='20'x; GETNAMES=YES; DATAROW=3; GUESSINGROWS=10; RUN; * pull out 4 data pts similar to those we might use in the grant ; data simsig; set simsig_all; * where (time=8) OR (time=18) OR (time=30) OR (time=48); where (simnum<3); * for testing: simnum<3 so only read two simulations for testing purposes . and use ALL time pts; run; ods output ParameterEstimates=igfbp_param_estimates; proc nlmixed data=simsig cov corr ecov ecorr method=firo tech=congra maxit=1000; parms midpt = 18; random maxconc minconc steep tshift ~ normal([100,0,6,2],[25,0,25,0,0,1,0,0,0,2]) subject=patient out=igfbp_random_effects; if (time-tshift) <= 0 then do; predconc = minconc; end; else do; predconc = minconc + (maxconc-minconc)*((time-tshift)**steep)/((time-tshift)**steep + midpt**steep); end; model igfbp ~ normal(predconc,100); by simnum; predict predconc out=predicted_igfbp_concs; run; * this adds a new variable called "the_igfbp_resids" and puts it (and the old ones) into a dataset called igfbp_resids; data igfbp_resids; set predicted_igfbp_concs; the_igfbp_resids = Pred - igfbp; run;