Information Technology Reference
In-Depth Information
to define the confidence width. Simpson's rule uses quadratic polynomials; that is, it uses parabolic arcs
instead of the straight line segments used in the more traditional trapezoidal rule. In particular, let the
function f be tabulated at points x 0 , x 1 , and x 2 equally spaced by distance h, and denote
f
= () .
f x
n
n
Then Simpson's rule states that
x
x
+
2
h
1
3
2
0
ò
ò
fxdx
()
=
fxdx
()
»
hf
(
++
4
f
f
)
0
1
2
x
x
.
0
0
Since it uses quadratic polynomials to approximate functions, Simpson's rule actually gives exact
results when approximating integrals of polynomials up to cubic degree.
For an integral from a length of stay of 2 to 18 days using the increment of 0.05 (there are 401 data
points defined in the kde50 output dataset), the confidence width, p(2≤X≤18) is defined by
Data work.confidence;
Set nis.kde50;
Sum=0;
If (value<2 or value>18) then sum=sum;
If (value<2.05 or value>17.95) then sum=sum+density;
If (value ge 20.5 and value le 17.95) then sum=sum+4*density);
Data nis.simpson;
Set work.confidence;
Integral=sum*0.05/3;
Run;
kernel densIty estImatIon to estImate PatIent lengtH of stay
In this section, we examine estimates of the patient's length of stay and total charges, and demonstrate
how visualization itself can be used to investigate the population. One of the biggest advantages in using
kernel density estimation is the ability to compare different patient sub-groups. For example, we can
examine whether patients with pneumonia spend more time in the hospital compared to patients without
pneumonia. To do this, we use the following code:
proc sort data=nis.samplepneumonia out=work.pneumonia;
by pneumonia;
proc kde data=work.pneumonia;
univar los/gridl= 0 gridu= 20 out=nis.kdelospneumonia bwm= 3 method=srot;
Search WWH ::




Custom Search