Information Technology Reference
In-Depth Information
The total expenditure increases as the value of the New Index increases except for the value of zero.
This could occur because many of the ICD9 codes included in the New Index may not be defined in the
inpatient dataset, resulting in a code of zero. Fortunately, there is a dataset in the MEPS files containing
all possible patient conditions. We will use this dataset combined with the inpatient costs to examine
the New Index. To set up the conditions, we use the following code to transpose the patient conditions
so that each patient has just one observation in the dataset:
proc sort data=nis.patientconditions
out=work.patientconditions;
by dupersid;
proc Transpose data=work.patientconditions
out=work.tran (drop=_name_ _label_)
prefix=med_;
var icd9codx ;
by dupersid;
run;
Next, we concatenate the patient conditions into one column in the dataset.
data work.concat(keep= dupersid icd9codx) ;
length icd9codx $ 32767 ;
set work.tran ;
array chconcat {*} med_: ;
icd9codx = left(trim(med_1)) ;
do i = 2 to dim(chconcat) ;
icd9codx = left(trim(icd9codx)) || ' ' || left(trim(chconcat[i])) ;
end ;
run ;
Because it is unknown just how many variables need to be concatenated, the maximum possible
length was used. Proc SQL is used to reduce the length of the text string to its minimum possible.
proc sql ;
select max(length(icd9codx)) into:icd9codx_LEN from work.concat ;
quit ;
%put icd9codx_LEN=&icd9codx_LEN ;
data icd9.icd9codes ;
length icd9codx $ &icd9codx_LEN ;
set work.concat ;
run ;
The next step is to merge the dataset of patient conditions with the dataset of inpatient data:
Search WWH ::




Custom Search