Resources

Here you will find various documents to support research and teaching, and related to ideas around data archiving, survey data and its use.

ENHANCED PUBLICATIONS & KNOWLEDGE PRODUCTS

Materials have also been put together to support published articles related to some of our data sets and also other projects involving the COMPASS Research Centre. Program code (in SAS) is being made available to allow users to reproduce analyses that were undertaken in the past. You will find these resources among our data holdings as well, as time permits their development and markup. Many thanks in this regard go to our summer scholars for their work on these materials.

Do Hospital Bed Reduction and Multiple System Reform Affect Patient Mortality?




A Trend and Multilevel Analysis in New Zealand over the period 1988–2001.



Davis P, Lay-Yee R (Department of Sociology, The University of Auckland)
Scott A (Department of Statistics, The University of Auckland)
Gauld R (Department of Preventive and Social Medicine, University of Otago)

1. User Guide



User Guide


Prepared for NZSSDS by Karl Parker
Summer 2009–10



1.1 Article Details

1.1.1 Background

New Zealand has been through four national health service market-oriented reforms during the period 1988–2001. Area Health Boards from 1988–1992, Crown Health Enterprises from 1993–1995, Hospital and Health Services 1996–1999 and District Health Boards 2000–current. During this time there was also a substantial reduction in the availability of inpatient beds. The impact of this hospital and system restructuring on the quality and pattern of care is an important issue of public policy concern.

1.1.2 Objectives

To see if the reduction in public hospital bed availability and multiple reorganisations in New Zealand had an effect on the patterns of care and patient outcomes.

1.1.3 Methods

Access to discharge data, amounting to 6,639,487 records, was secured for all 34 major public hospitals in New Zealand over the period 1988–2001. Tables were produced to show the pattern of care over the different regimes. Many different outcomes were looked at including number of discharges, admission rates, access levels, mean length of stay, unplanned readmission rate, and 60-day post-admission mortality rates.

Multilevel models were also used to see the effect the different regimes, as well as other variables, had on 60-day post-admission death, using hospital as a random effect.

1.1.4 Results

Although the number of inpatient beds in use declined by one-third over the period and the national population grew by nearly one-fifth, discharge volumes increased significantly and rates of inpatient admission were maintained, as were access levels for vulnerable groups. These changes were accompanied by workload adjustments (a halving in length of stay and an increase by a quarter in readmission rates). Yet age-adjusted post-admission patient mortality decreased by a quarter over the period of study, a rate of decline that was slowed by the major workload adjustments but not by reform phase.

1.1.5 Conclusion

Other things being equal, a substantial reduction in inpatient bed availability can be effected in national public hospital systems, while largely maintaining access and quality of care. However, the workload adjustments that are required may slow improvements in patient outcomes.

1.2 Purpose of Metadata

The metadata comprises three sections.

  • Data dictionary
  • SAS code and associated outputs
  • SAS program.

The metadata has been structured in such a way to ensure the data and analytical process is user-friendly and easy to understand. The data dictionary provides a list of all the variables, variable names, a description of variables and their values. It includes both original and derived variables created in the course of the analysis. The annotated SAS code and associated output shows and describes each section of the provided SAS code. More specifically, annotations are given to describe a SAS procedure and the related output. The code is organized by table, according to the journal article. The SAS program contains annotated code without the output. The code is sorted by table and can be downloaded and run in SAS.

1.3 Data Sets

We used four data sets in the course of the analysis:

Data set name     N Description & filtering
h_all_diag   24,894,974 records   All diagnoses
h_all_nhi2 6,639,487 records All patients; applies filtering criteria
h_all_last2 4,773,663 records All patients; only the last admission in a given calendar year is kept where there are multiple admissions for a patient in that year
patientlast 3,623,713 records Inpatients only; only the last admission in a given calendar year is kept where there are multiple admissions for a patient in that year

1.4 Filtering the data

What is data filtering
Data filtering is a fundamental and foundational tool of data analysis. It gives you the ability to create a subset of your data based on a set of criteria. Filtering is useful for narrowing your data set to contain only those records pertinent to your analysis, or just narrowing the scope of your analysis, without removing the other observations from the data set.

Data filtering for our data set
The original dataset consisted of 7,682,497 individual records from 34 New Zealand secondary and tertiary hospitals for the period 1988-2001. Filtering was put in place to ensure that definitions of variables were consistent and comparable over time. The fully filtered data set contained 6,639,487 cases.

Below is a sample of the SAS code used for the filtering of the data. It includes filtering of:

  • Well-babies
  • Boarders
  • Transfer patients
  • A&E cases
  • Suspected duplicate records based on consecutive events with the same encrypted NHI and admission date.

Definitions
Boarders: Individuals who stay in hospital without needing treatment, often accompanying another patient, are called 'boarders'. These have been excluded as they are not hospital patients in need of medical care.

Well babies: Healthy hospital-delivered infants were not registered until 1991 and these admissions are not health driven.

SAS Code
data hos1;
set h_all_nhi;
rep = 0
keep event_id nhi evstdate evendate rep;
run;

 

proc sort data=hos1;

 by nhi evstdate descending evendate;

run;

 

*this code creates a new variable rep that takes the value 1 if both nhi and evstdate are the same;

proc iml;

use hos1;

read all var{event_id nhi evstdate rep};

N = nrow(nhi);

DO i=2 TO N;

 if ((nhi[i] = nhi[i-1]) & (evstdate[i]=evstdate[i-1])) then rep[i]=1;

 else rep[i]=0;

END;

create hos2 var{event_id rep};

append;

close hos2;

quit;

 

proc sort data=h_all_nhi; by event_id; run;

proc sort data=hos2; by event_id; run;

 

proc datasets;

 delete hos1;

run;

 

data h_all_nhi;

 merge h_all_nhi hos2;

 by event_id;

run;

 

*this code involves changing the date to year to enable the data to be analysed by year;

data h_all_nhi;

 set h_all_nhi;

 if "01JAN1988"D <= evendate <= "31DEC1988"D then year = 1988;

 if "01JAN1989"D <= evendate <= "31DEC1989"D then year = 1989;

 if "01JAN1990"D <= evendate <= "31DEC1990"D then year = 1990;

 if "01JAN1991"D <= evendate <= "31DEC1991"D then year = 1991;

 if "01JAN1992"D <= evendate <= "31DEC1992"D then year = 1992;

 if "01JAN1993"D <= evendate <= "31DEC1993"D then year = 1993;

 if "01JAN1994"D <= evendate <= "31DEC1994"D then year = 1994;

 if "01JAN1995"D <= evendate <= "31DEC1995"D then year = 1995;

 if "01JAN1996"D <= evendate <= "31DEC1996"D then year = 1996;

 if "01JAN1997"D <= evendate <= "31DEC1997"D then year = 1997;

 if "01JAN1998"D <= evendate <= "31DEC1998"D then year = 1998;

 if "01JAN1999"D <= evendate <= "31DEC1999"D then year = 1999;

 if "01JAN2000"D <= evendate <= "31DEC2000"D then year = 2000;

 if "01JAN2001"D <= evendate <= "31DEC2001"D then year = 2001;

 age=(evstdate-dob)/365.25;

 if "01JAN1992"D <= evendate <= "31MAY1997"D and facility = 3213 and (650<=drg_31<=727

    or specialty='P01' or specialty='P07' or specialty='P10' or specialty='P15'

    or specialty='P17' or specialty='P23' or specialty='P25' or specialty='P27'

    or specialty='P35' or specialty='P40' or specialty='P42' or specialty='P43'

    or specialty='S30' or specialty='S32' or specialty='S33' or specialty='M69'

    or 0 <= age <= 0.25) then status='NW';

 else status='Ot';

 if "01JAN1992"D <= evendate <= "31MAY1997"D and facility = 3213 and

     status='Ot' then facility = 3212;

 drop status;

 if ((evendate=evstdate) & (end_typ ne 'DD') & (substr(specialty,1,3) in

    ('M05','M06','M07','M08'))) then ae = 1;

 else ae = 0;

 if admission_source_code='T' then delete; *delete all the transfer patients;

 if drg_31=572 then delete;

 if drg_31=940 then delete;

 if 951<=drg_31<=952 or 955<=drg_31<=956 then delete;

 if rep=1 then delete; *delete all patients with the same nhi code and same admission date;

 if ae=1 then delete; *delete all A&E cases;

run;

 

data diag;

 set ''; *load the combined diagnosis data file to find well-baby cases;

 if ('V30' le substr(clin_cd,1,3) le 'V39');

run;

 

proc sort data=diag;

 by event_id;

run;

 

proc transpose data=diag out=diag1 prefix=diagcode;

 by event_id;

 var clin_cd;

run;

 

data diag1;

 set diag1;

 wb = 1;

 keep event_id wb;

run;

 

proc sort data=h_all_nhi; by event_id; run;

 

data h_all_nhi;

 merge h_all_nhi diag1;

 by event_id;

 if wb=. then wb = 0;

run;

 

data diag;

 set '';

 bor = 1;

 if (diag_typ = 'A') & (substr(clin_cd,1,4) = 'V650');

 keep event_id bor;

run;

 

proc sort data=diag; by event_id; run;

 

data h_all_nhi;

 merge h_all_nhi diag;

 by event_id;

 if bor=. then bor = 0;

run;

 

data h_all_nhi;

 set h_all_nhi;

 if year = . then delete;

 if wb = 1 then delete; * delete all well babies cases;

 if bor = 1 then delete; *delete all boarder cases;

run;

1.5 Analyses

Table 1

SAS procedure Details
PROC UNIVARIATE     Number of beds utilised per year
Inpatient average length of stay per year
Inpatient average length of stay per year truncated to 97th percentile
PROC FREQ Frequency of discharges per year
Frequency of discharges per year only including inpatients
Frequency of patients per year
Frequency of inpatients per year
Percentage of patients who are daystay patients per year
Percentage of inpatients admissions which are emergencies per year
Frequency and percentage of readmissions per year for all dischargers
Frequency and percentage of readmission inpatients per year for all dischargers
Frequency and percentage of readmissions per year for all patients
Frequency and percentage of readmission inpatients per year for all patients
Frequency and percentage of unplanned readmissions per year for all dischargers 
Frequency and percentage of unplanned inpatient readmissions per year for all dischargers
Frequency and percentage of unplanned readmissions per year for all patients
Frequency and percentage of unplanned inpatients readmissions per year for all patients

Table 2

Method Details
PROC FREQ Frequency of discharges per year for all admissions
Frequency of discharges per year for all inpatient admissions
Frequency of discharges per year for all patients
Frequency of discharges per year for all patients-inpatients
Percentage of all admissions that are 75 and over
Percentage of all inpatient admissions that are 75 and over
Percentage of all admissions that are Māori
Percentage of all inpatient admissions that are Māori
Percentage of all admissions that are deprived
Percentage of all inpatient admissions that are deprived
Percentage of all admissions that are ambulatory sensitive
Percentage of all inpatient admissions that are ambulatory sensitive
Percentage of 60-day post-admission deaths per year for all admissions
Percentage of 60-day post-admission deaths per year for all inpatient admissions
Percentage of 60-day post-admission deaths per year for all patients
Percentage of 60-day post-admission deaths per year for all patients-inpatients
Age adjusted percentage of 60-day post-admission deaths per year for all admissions
Age adjusted percentage of 60-day post-admission deaths per year for all inpatient admissions
Age adjusted percentage of 60-day post-admission deaths per year for all patients
Age adjusted percentage of 60-day post-admission deaths per year for all patients – patients

 

Table 3

Method

Details

PROC 
UNIVARIATE

Mean length of stay for inpatients

PROC FREQ

Frequency of dischargers per year
Number of inpatient dischargers per year
Number of unplanned inpatient readmissions per year

 

Table 4

Method

Details

PROC GLIMMIX

Mixed models where covariates are added one at a time to see their effects on the model. Covariates include year, multiple diagnoses, length of stay, unplanned readmisssions, ambulatory sensitive admissions added, total beds available, reform phase and patient effects.

PROC 
UNIVARIATE

Calculates the variance of the marginal linear predictor for each of the mixed models produced.

1.6 Data Dictionary

5.1 Data sets: h_all_nhi2 and h_last_nhi2

 

5.1.1 Original variables

Variable Name
Description
Values
event_id
Code to identify an event
9 character code
event_type
Type of health event
BT = Birth events (infants born in reporting hospital)
DT = Death event (NZHIS use only)
ID  = Intended day events
IM  = Psychiatric inpatient event (include day patients)
IP  = Non-psychiatric inpatient event (includ day patients)
GP= General Practitioner event (NZHIS use only)
OP= Outpatient event (NZHIS use only)
admission_type
Type of admission (used to calclulate emergency variable)
AA = Arranged admission
AC = Acute admission
AP = Elective admission to a private hospital
RL = Psychiatric patient returned from leave of more than 10 days
WN= Waiting list
WU= Code not used from 20/8/93
ZA = Arranged admission, ACC covered
ZC = Acute, ACC covered
ZP = Private, ACC covered
ZW=  Waiting list, ACC covered
eventlvd
Number of days a patient is absent from the hospital, during stay. 
Maximum is 3 days for non psychiatric patients.
Days
gender
Gender
M= Male;  F= Female;  U= Unknown
drg_31
Diagnosis-Related Group
DRG 3.1 classification code
evendate
Discharge date (used to calculate daystay variable)
Date
evstdate
Date a health event began (used to calculate daystay variable)
date
dead_60
60 day post-admission death
Y= Died within 60 days
N= Did not die within 60 days
year
Year of discharge
Year
age
Age
Year
RADM
Readmission into any hospital within 30 days of discharge with same major diagnostic category
1= Yes
0= No
MAORI
patient coded as Maori in later admissoin, ethnicity changed for all admissions
1= Maori
0= Non-Maori
dep969
High deprivation
1= High deprivation
0= Else

5.1.2 Derived Variables

Variable Name

Description

Values

los2

Length of stay excluding event leave days.

Days

daystay

A If admission and discharge are the same day, 
then patient did not require a bed overnight.
Used to calculate inpatient staydeaths

1= Daystay
0= Inpatient

emergency

Admission type is acute

1= Acute admission
0= Arranged or elective admission

readmission_unplanned

Whether readmission within the same year was unplanned

Y= Acute admission
N= Arranged or elective
O= Other, i.e. not readmissoin

elderly

Patients aged 75 or over are classed as elderly.

1= Elderly
0= Not elderly

agewtal

A weight variable used to calculate the adjusted deaths

Population age weights

agewtin

A weight variable used to calculate the adjusted deaths for inpatients only

Population age weights

 

5.2 Data set: h_all_diag

5.2.1 Original Variables

Variable Name
Description
Values
event_id
Code to identify an event
9 character code
diag_type
A code denoting which section of the ICD-9-CM-A and 
ICD-10-AM coding systems the clinical code falls within.
A= Diagnosis
B= Injury
O= Operation / procedure
clin_cd
Code used to classify the clinical description of a condition, cause
of intentional or unintentional injury, underlying cause of death, 
operation or procedure performed or pathological nature of a tumor.
ICD-9-CM-A classification code
ICD-10-AM classification code

 

5.2.2 Derived Variables

Variable Name
Description
Values
ash
Ambulatory sensitive admissions. hospitalizations of people under 
75 years of age from causes considered responsive to prophylactic 
or therapeutiic interventions deliverable in ambulatory care settings
1= Ambulatory sensitive
0= Not ambulatory sensitive

5.3 Data set: patientlast

5.3.1 Original Variables

Variable Name
Description
Values
dead
60-day post-admission death
1= Death
2= No death
male
Gender (excludes unknown)
1= Male
2= Female
maor
Is ethnicity Maori?
1= Maori
2= Non Maori
mdcgp
Major diagnostic category grouped
01= Diseases and disorders of the nervous system
03= Diseases and disorders of the ear, nose, mouth and throat
04= Diseases and disorders of the respiratory system
05= Diseases and disorders of the circulatory system
06= Diseases and disorders of the digestive system
08= Diseases and disorders of the musculoskeletal and connective tissue
09= Diseases and disorders of the skin, subcutaneous tissue and breast
96= Diseases and disorders of the reproductive system
97= Preganancy, childbirth and puerperium; newborn / neonates
99= Others including ungroupable
status
Tertiary-specialist facility identifier
1= Specialist
2= General
facility
Health agency facility code
4 character code
year
Year variable
1= 1988;  2= 1989;  3= 1990;.......; 14= 2001
age
Age
Years
regime
Reform phases of publicly funded health care system
a_dhc00_01= DHB;  b_hhs96_99= HHS;  c_che93_95= CHE;
d_ahb88_92= AHB
radm_un
planned_pct
Readmission percentage per facility per year
Percentage
los2_mean
Length of stay per facility per year
Days
multi_diag
More than 2 diagnosis
1= Multiple diagnoses
2= Only one diagnosis
dep
Categorical deprivation
a (high deprivation) to j (low deprivation) 
totbedsused
Average beds used per day each year
Beds
ash_pct
Percentage of ambulatory sensitive admissions / year
Percentage

5.3.2 Derived Variables

Variable Name

Description

Values

totbedsavailp1000

Total beds available per 1000 people for each year

Beds

r1

Reform phase. 1993-1995 (market orientation)

1= AHB regime
0=CHE, HHS, DHB regimes

r2

Reform phase. 1996-1999 (modified market)

1= AHB, CHE regimes
0= HHS, DHB regimes

r3

Reform Phase. 2000-2001 (return to regionalization)

1= AHB, CHE, HHS regimes
0= DHB regime

2. Program code and Output

 

Program code and output
Using SAS

 

Contents:

Table 1: Bed supply, patient throughput and pattern of care by reform phase, 1988-2001.

Table 2: Access to hospital care, pattern of admission, and patient outcomes by reform phase, 1988-2001.

Table 3: Rates of change overall and by reform phase for key measures.

Table 4: Multilevel analysis of 60-day postadmission death.

2.1 Table 1

Bed supply, patient throughput and pattern of care by reform phase, 1988-2001

/* Davis, P., Lay-Yee, R., Scott, A., Gauld, R.

Do hospital bed reduction and multiple system reform affect patient mortality?:

A trend and multilevel analysis in New Zealand over the period 1988-2001

(2007) Medical Care, 45 (12), pp. 1186-1194. */

 

/* Table 1 */

/* Karl Parker 16/12/09 */

libname ss '';

options ls=132;

 

/* All Dischargers data set */

data z;

length evntlvd2 8;

set ss.h_all_nhi2 (keep = year evstdate evendate evntlvd multstay radm admission_type drg_31);

 

evntlvd2=evntlvd;

los=evendate-evstdate;                   *Length of stay including event leave days;

if evntlvd2=. then evntlvd2=0;

los2=los-evntlvd2;                       *Length of stay excluding event leave days

(this is the length of stay variable that will be used in the following analysis);

 

*Day stay or inpatient calculation;

if evendate=evstdate then daystay=1;

else daystay=0;

 

*Emergency variable calculation;

if daystay=0 and admission_type in ('AC','ZC')

then emergency=1;

else emergency=0;

 

*Unplanned readmission variable creation;

if radm=1 then do;

if admission_type in ('AC','ZC','WU')

then radm_unplanned='Y';          *Acute admission type,(therefore readmission was unplanned);

else radm_unplanned='N';          *Arranged or elective admission type;

end;

else radm_unplanned='O';          *Other, i.e. not readmission;

 

*Include only data from the following dates, to match Table 1;

if year in ('1988','1990','1994','1998','2001');

run;

 

/* All Patients data set */

data b;

set ss.h_last_nhi2 (keep= evendate radm admission_type evstdate year);

 

*Day stay or inpatient calculation;

if evendate=evstdate then daystay=1;

else daystay=0;

 

*Unplanned readmission variable creation;

if radm=1 then do;

if admission_type in ('AC','ZC','WU')

then radm_unplanned='Y';   *Acute admission type,(therefore readmission was unplanned);

else radm_unplanned='N';   *Arranged or elective admission type;

end;

else radm_unplanned='O';   *Other, i.e. not readmission;

 

*Include only data from the following dates, to match Table 1;

if year in ('1988','1990','1994','1998','2001');

keep year daystay radm radm_unplanned;

run;

/* Table 1: Output */

 

*Sort variable for table;

proc sort data=z;by year;run;

 

/*Average number of beds utilized*/

proc univariate data=z noprint;

by year;                   *Calculate summary stats for each year;

where daystay=0;           *Inpatients only;

var los2;                  *Length of stay;

output out=losum sum=sum;

run;

 

*Divide sum by number of days in each year;

data losum2;

set losum;

if year=1988 then aub=sum/366;           *leap year;

if year=1990 then aub=sum/365;

if year=1994 then aub=sum/365;

if year=1998 then aub=sum/365;

if year=2001 then aub=sum/365;

 

*Divide by the number of facilities each year;

if year=1988 then beds=aub/33;

if year=1990 then beds=aub/34;

if year=1994 then beds=aub/34;

if year=1998 then beds=aub/33;

if year=2001 then beds=aub/32;

run;

 

*Print inpatient average utilised beds per day, for each year;

proc print data=losum2 noobs;title 'verage utilised beds by year';var _ALL_;run;

title ' ';run;

 

Average utilised beds by year

 

year

sum

aub

beds

1988

2943717

8042.94

243.726

1990

2639812

7232.36

212.717

1994

2428532

6653.51

195.692

1998

1832856

5021.52

152.167

2001

1929012

5284.96

165.155

 

   

/*Number of dischargers overall*/

proc freq data=z;

tables year;

run;

The FREQ procedure

 

year

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

1988

353443

15.05

353443

15.05

1990

389571

16.59

743014

31.64

1994

481821

20.51

1224835

52.15

1998

528961

22.52

1753796

74.67

2001

594842

25.33

2348638

100.00

 

/*Impatient dischargers*/

proc freq data=z;

where daystay=0;     *Inpatients only;

tables year;

run; 

The FREQ procedure

 

 

year

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

1988

328843

18.15

328843

18.15

1990

330734

18.26

659577

36.41

1994

365797

20.19

1025374

56.60

1998

375641

20.74

1401015

77.34

2001

410503

22.66

1811518

100.00

 

 

/*Number of patients per year*/

proc freq data=b;

tables year;

run; 

The FREQ procedure

 

year

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

1988

271186

16.02

271186

16.02

1990

293711

17.35

564897

33.36

1994

351619

20.77

916516

54.13

1998

369412

21.82

1285928

75.95

2001

407307

24.05

1693235

100.00

 

 

/*Number of inpatients per year*/

proc freq data=b;

where daystay=0;     *Inpatients only;

tables year;

run;

 

The FREQ procedure 

year

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

1988

252381

19.32

252381

19.32

1990

249182

19.08

501563

38.40

1994

266354

20.39

767917

58.79

1998

259345

19.85

1027262

78.64

2001

279003

21.36

1306265

100.00

 

 

/*Inpatient average length of stay per year*/

proc univariate data=z noprint;

by year;

where daystay=0;                  *Inpatients only;

var los2;                         *Length of stay;

output out=ialofs mean=mean;      *Outputs the mean for each year;

run;

proc print data=ialofs noobs;var _all_;run;

 

year

mean

1988

8.95174

1990

7.98168

1994

6.63902

1998

4.87928

2001

4.69914

 

 

/*Inpatient average length of stay truncated*/

proc sort data=z;by drg_31;run;

 

proc rank data=z groups=100 out=inpat1 (keep = year los2 ranklos drg_31);

by drg_31;                        *Compute ranks for each diagnostic related group;

where daystay=0;                   *Inpatients only;

var los2;                         *Length of stay;

ranks ranklos;                    *Name length of stay ranks;

run;

 

proc univariate data=inpat1 noprint;

title 'inpatient discharges: los by drg';

by drg_31;                         *Compute summary stats for each diagnostic related group;

where ranklos=97;                  *Include 97th percentile only;

var los2;                          *Length of stay;

output out=inpat2 max=max97;      *Output max length of stay (truncated);

run;

 

 

 

data inpat3;

merge inpat1 (in=a) inpat2 (in=b); *merge data sets;

by drg_31;

if a;

if ranklos>97 then los2=max97;

*If length of stay is ranked higher than the 97th percentile, values are assigned the 97th percentile value (max value);

run;

 

*Sort for summary stats;

proc sort data=inpat3;by year;run;

 

*Summary stats for inpatient average length of stay truncated to 97th percentile for each year;

proc univariate data=inpat3 noprint;

title 'inpatient discharges: truncated los';

by year;                          *Compute summary stats for each year;

var los2;                         *Length of stay;

output out=inpat4 mean=sum; *output sums and name output data set losum;

run;

proc print data=inpat4;title 'Average length of stay by year (truncated)';var _all_;run;

title ' ';run;

 

Average length of stay by year (truncated)

 

Obs

year

average

1

1988

7.23786

2

1990

6.75520

3

1994

5.83490

4

1998

4.70917

5

2001

4.52982

 

 *Sort for frequency tables;

proc sort data=z;by year; run;

 

/*Daystay %*/

proc freq data=z;

by year;                   *Frequency table calculated for each year;

tables daystay;

run;

 

The FREQ procedure

 

year=1988

 

daystay

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

328843

93.04

328843

93.04

1

24600

6.96

353443

100.00

 

year=1990

 

daystay

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

330734

84.90

330734

84.90

1

58837

15.10

389571

100.00

 

year=1994

 

daystay

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

365797

75.92

365797

75.92

1

116024

24.08

481821

100.00

 

year=1998

 

daystay

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

375641

71.01

375641

71.01

1

153320

28.99

528961

100.00

 

year=2001

 

daystay

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

410503

69.01

410503

69.01

1

184339

30.99

594842

100.00

 

  

/*Energency %*/

proc freq data=z;

by year;                   *Frequency table calculated for each year;

where daystay=0;     *inpatient admissions;

tables emergency;    *acute admission;

run;

 

The FREQ procedure

 

year=1988

 

 

emergency

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

120642

36.69

120642

36.69

1

208201

63.31

328843

100.00

 

 

year=1990

 

emergency

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

118131

35.72

118131

35.72

1

212603

64.28

330734

100.00

 

year=1994

 

emergency

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

133207

36.42

133207

36.42

1

232590

63.58

365797

100.00

 

year=1998

 

emergency

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

126741

33.74

126741

33.74

1

248900

66.26

375641

100.00

 

year=2001

 

emergency

Frequency

Percent

Cumulative
Frequency

Cumulative
Percent

0

130178

31.71

130178

31.71

1

280325

68.29

410503

100.00

 

 

 /*Number and percentage of readmissions per year for all dischargers*/

proc freq data=z;

tables radm*year;

run; 

The FREQ procedure

 

Table of RADM by year

RADM

year

Frequency
Percent
Row Pct
Col Pct

1988

1990

1994

1998

2001

Total

0

326014
13.88
15.30
92.24

356047
15.16
16.71
91.39

436707
18.59
20.49
90.64

477413
20.33
22.40
90.25

534794
22.77
25.10
89.91

2130975
90.73




1

27429
1.17
12.60
7.76

33524
1.43
15.40
8.61

45114
1.92
20.73
9.36

51548
2.19
23.68
9.75

60048
2.56
27.59
10.09

217663
9.27




Total

353443
15.05

389571
16.59

481821
20.51

528961
22.52

594842
25.33

2348638
100.00

 

 

/*Number and percentage of readmission inpatients per year for all dischargers*/

proc freq data=z;

where daystay=0;                  *Inpatients only;

tables radm*year;

run;

The FREQ procedure

 

 

Table of RADM by year

RADM

year

Frequency
Percent
Row Pct
Col Pct

1988

1990

1994

1998

2001

Total

0

303249
16.74
18.41
92.22

301698
16.65
18.31
91.22

332095
18.33
20.16
90.79

339441
18.74
20.60
90.36

371095
20.49
22.52
90.40

1647578
90.95




1

25594
1.41
15.61
7.78

29036
1.60
17.71
8.78

33702
1.86
20.56
9.21

36200
2.00
22.08
9.64

39408
2.18
24.04
9.60

163940
9.05




Total

328843
18.15

330734
18.26

365797
20.19

375641
20.74

410503
22.66

1811518
100.00

 

  

/*Number and percentage of readmissions per year for all patients*/

proc freq data=b;

tables radm*year;

run; 

The FREQ procedure

 

Table of RADM by year

RADM

year

Frequency
Percent
Row Pct
Col Pct

1988

1990

1994

1998

2001

Total

0

254937
15.06
16.12
94.01

274556
16.21
17.36
93.48

328629
19.41
20.78
93.46

344315
20.33
21.77
93.21

379289
22.40
23.98
93.12

1581726
93.41




1

16249
0.96
14.57
5.99

19155
1.13
17.18
6.52

22990
1.36
20.62
6.54

25097
1.48
22.51
6.79

28018
1.65
25.13
6.88

111509
6.59




Total

271186
16.02

293711
17.35

351619
20.77

369412
21.82

407307
24.05

1693235
100.00

 

 

/*Number and percentage of readmission inpatients per year for all patients*/

proc freq data=b;

where daystay=0;                  *Inpatients only;

tables radm*year;

run;

The FREQ procedure

 

Table of RADM by year

RADM

year

Frequency
Percent
Row Pct
Col Pct

1988

1990

1994

1998

2001

Total

0

236990
18.14
19.52
93.90

231930
17.76
19.10
93.08

247482
18.95
20.38
92.91

239849
18.36
19.75
92.48

257950
19.75
21.24
92.45

1214201
92.95




1

15391
1.18
16.72
6.10

17252
1.32
18.74
6.92

18872
1.44
20.50
7.09

19496
1.49
21.18
7.52

21053
1.61
22.87
7.55

92064
7.05




Total

252381
19.32

249182
19.08

266354
20.39

259345
19.85

279003
21.36

1306265
100.00

 

  

/*Number and percentage of unplanned readmissions per year for all dischargers*/

proc freq