Date: Tue, 28 Jan 2003 17:48:04 +0100
Reply-To: Asesoría Bioestadística
<bioestadistica@eresmas.net>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Asesoría Bioestadística
<bioestadistica@eresmas.net>
Subject: Re: Confidence intervals of various percentiles.
Content-Type: text/plain; charset=us-ascii
Hi Margo:
Just for the median (not for other percentiles, sorry)
* If you are using SPSS 11.x:
COMPUTE one = 1 .
RATIO STATISTICS amount1 WITH one
/PRINT = CIN(95) MEDIAN .
RATIO STATISTICS amount2 WITH one
/PRINT = CIN(95) MEDIAN .
* Older versions of SPSS:
The following MACRO will do the same:
define cimed95(!positional !tokens(1))
sort cases by !1 (A).
matrix.
get medvar /var=!1.
compute n=nrow(medvar).
do if n le 284.
+ compute lowval=(n+1)/2-0.9789*sqrt(n).
+ compute low=trunc(lowval).
+ do if n=17.
+ compute low=5.
+ end if.
+ do if n=67.
+ compute low=26.
+ end if.
+ do if n le 120.
+ compute pmiss95={0;0;0;0;0;.0313;.0156;.0078;.0391;.0215;.0117;.0386;
.0225;.0129;.0352;.0213;.0490;.0309;.0192;.0414;.0266;.0169;.0347;.0227;
.0433;.0290;.0192;.0357;.0241;.0428;.0295;.0201;.0351;.0243;.0410;.0288;
.0470;.0336;.0237;.0385;.0275;.0436;.0315;.0488;.0357;.0259;.0400;.0293;
.0444;.0328;.0489;.0365;.0270;.0402;.0300;.0441;.0331;.0479;.0363;.0273;
.0396;.0300;.0430;.0328;.0464;.0356;.0498;.0385;.0295;.0414;.0319;.0444;
.0344;.0474;.0369;.0286;.0395;.0308;.0422;.0330;.0448;.0352;.0475;.0375;
.0295;.0398;.0314;.0422;.0334;.0446;.0355;.0470;.0375;.0495;.0396;.0316;
.0417;.0334;.0439;.0352;.0460;.0371;.0482;.0390;.0313;.0409;.0330;.0428;
.0346;.0448;.0363;.0467;.0380;.0487;.0398;.0323;.0415;.0338;.0433;.0353}.
+ compute realcov=100*(1-pmiss95(n)).
+ end if.
end if.
do if n gt 284.
+ compute low=trunc((n+1)/2-0.98*sqrt(n)).
end if.
compute upper=n+1-low.
compute lower95=medvar(low).
compute upper95=medvar(upper).
print {lower95,upper95}
/format="f10.2"
/clabels="Lower 95","Upper 95"
/title="95% CI for median".
do if n le 120.
print realcov
/format="f8.1"
/title="Exact coverage (%)".
end if.
end matrix.
!enddefine.
* Macro call: process variables one by one.
cimed95 amount1.
cimed95 amount2.
HTH
Marta Garcia-Granero
> Hi Listers --
>
> Does anyone know how to obtain confidence intervals for various percentiles.
>
> E.g., if I do the following:
>
> EXAMINE
> VARIABLES=amount1 amount2
> /PLOT NONE
> /PERCENTILES(10,25,50,75,90) HAVERAGE
> /STATISTICS DESCRIPTIVES
> /CINTERVAL 95
> /NOTOTAL.
>
> I get the mean with confidence intervals -- but not, in the percentile
> chart, the median and other percentiles.
>
> Any thoughts?
>
> Margo Schlanger
>
> ______________________
> Margo Schlanger
> Assistant Professor of Law
> Harvard Law School
> Cambridge, MA 02138
> (617) 495-4626
> (253) 295-6089 (fax)