data WORK.SCHUETZ ;350 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */351 infile 'd:\myfile\schuetz.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ;352 informat Test $4. ;353 informat Study_ID $18. ;354 informat tp best32. ;355 informat fp best32. ;356 informat fn best32. ;357 informat tn best32. ;358 informat Indirect best32. ;359 format Test $4. ;360 format Study_ID $18. ;361 format tp best12. ;362 format fp best12. ;363 format fn best12. ;364 format tn best12. ;365 format Indirect best12. ;366 input367 Test $368 Study_ID $369 tp370 fp371 fn372 tn373 Indirect374 ;375 if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */376 run;
NOTE: The infile 'd:\myfile\schuetz.csv' is: Filename=d:\myfile\schuetz.csv, RECFM=V,LRECL=32767,File Size (bytes)=3190, Last Modified=23Dec2010:15:34:36, Create Time=19Nov2008:16:46:13
NOTE: 108 records were read from the infile 'd:\myfile\schuetz.csv'. The minimum record length was 23. The maximum record length was 33.NOTE: The data set WORK.SCHUETZ has 108 observations and 7 variables.NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds
108 rows created in WORK.SCHUETZ from d:\myfile\schuetz.csv.
NOTE: WORK.SCHUETZ data set was successfully created.NOTE: PROCEDURE IMPORT used (Total process time): real time 0.10 seconds cpu time 0.09 seconds
377 data schuetz;378 set schuetz;379 if test ="CT" then testtype=1;380 sens=1; spec=0; true=tp; n=tp+fn; output;381 sens=0; spec=1; true=tn; n=tn+fp; output;382 run;
NOTE: There were 108 observations read from the data set WORK.SCHUETZ.NOTE: The data set WORK.SCHUETZ has 216 observations and 12 variables.NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
383 proc sort data=schuetz;384 by study_id test;385 run;
NOTE: There were 216 observations read from the data set WORK.SCHUETZ.NOTE: The data set WORK.SCHUETZ has 216 observations and 12 variables.NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
386 proc nlmixed data=schuetz cov ecov;387 parms msens=2 mspec=1 s2usens=0 s2uspec=0 covsesp=0;388 logitp=(msens+usens)*sens+(mspec+uspec)*spec;389 p = exp(logitp)/(1+exp(logitp));390 model true ~ binomial(n,p);391 random usens uspec ~ normal([0,0],[s2usens,covsesp,s2uspec]) subject=sudy_id out=randeffs;ERROR: Variable SUDY_ID not found.
NOTE: The data set WORK.RANDEFFS has 0 observations and 0 variables.WARNING: Data set WORK.RANDEFFS was not replaced because new file is incomplete.NOTE: PROCEDURE NLMIXED used (Total process time): real time 0.10 seconds cpu time 0.01 seconds
392 proc print;393 run;
下面是编辑内容:
proc import out=schuetz
datafile="d:\myfile\schuetz.csv"
dbms=csv
replace;
getnames=yes;
run;
data schuetz;
set schuetz;
if test ="CT" then testtype=1;
sens=1; spec=0; true=tp; n=tp+fn; output;
sens=0; spec=1; true=tn; n=tn+fp; output;
run;
proc sort data=schuetz;
by study_id test;
run;
proc nlmixed data=schuetz cov ecov;
parms msens=2 mspec=1 s2usens=0 s2uspec=0 covsesp=0;
logitp=(msens+usens)*sens+(mspec+uspec)*spec;
p = exp(logitp)/(1+exp(logitp));
model true ~ binomial(n,p);
random usens uspec ~ normal([0,0],[s2usens,covsesp,s2uspec]) subject=sudy_id out=randeffs;
proc print;
run;