get file="y:\spss\data\dietmissing.sav". compute avgwgt = (wgt0 +wgt1+wgt2+wgt3+wgt4)/5. execute. compute avgwgt2 = mean(wgt0,wgt1,wgt2,wgt3,wgt4). execute. compute avgwgt3 = mean(wgt0 to wgt4). execute. compute avgwgt4 = mean.3(wgt0 to wgt4). execute. compute newid2 = string(patid, f2.0) . /* not correct execute. string newid3 (a2). /* correct compute newid3 = string(patid, f2.0) . execute. string newid4 (a3). /* correct compute newid4 = concat("0",ltrim(string(patid, f2.0))) . execute. string newid5 (a3). if (length(ltrim(string(patid, f2.0))) = 1) newid5 = concat("00",ltrim(string(patid, f2.0))) . if (length(ltrim(string(patid, f2.0))) = 2) newid5 = concat("0",ltrim(string(patid, f2.0))) . execute.