Confidence Intervals for comparing an individual's slope with a control group average slope
This SPSS macro outputs the percentage of controls that fall below a given individual's estimated slope (Crawford and Garthwaite, 2004).
Pairs of percentiles can be used to obtain endpoints of confidence intervals. For example the endpoints of a 95% CI correspond to percentiles which equal 0.025 and 0.975.
INPUT: the one sample t-test of slope of a single case versus control group (This is the variable tout outputted using the SPSS syntax at http://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/singcase/multiW ), its degrees of freedom and the required percentile.
Desired inputs can be entered into the macro using the Data list statement below. Cutting and Pasting into a SPSS syntax window will run the program with results displayed in a new untitled spreadsheet.
DATA LIST free
/tout df perc.
BEGIN DATA.
-8.895 12 0.975
-8.895 12 0.025
END DATA.
define singcci ( !POS !TOKENS(1)
/ !POS !TOKENS(1)
/ !POS !TOKENS(1)).
set errors=none.
set formats f10.5.
set mxloops=10000.
compute #tv = -abs(!1).
COMPUTE #lim = -2 .
COMPUTE #CUMF1 = NCDF.T(#tv,!2,#LC1) .
COMPUTE #ULIM = !3 .
LOOP IF (#CUMF1 LT #ULIM) .
+ COMPUTE #lim = #LC1 .
+ COMPUTE #LC1 = #LC1 - #tv .
+ COMPUTE #CUMF1 = NCDF.T(#tv,!2,#LC1) .
END LOOP .
COMPUTE #CUMF2 = NCDF.T(#tv,!2,#lim) .
COMPUTE #DIFF = 1 .
LOOP IF (#DIFF GT .00005) .
+ DO IF (#CUMF2 LT #ULIM) .
+ COMPUTE #lim = (#lim - 0.010).
+ COMPUTE #CUMF2 = NCDF.T(#tv,!2,#lim) .
+ ELSE .
+ COMPUTE #lim = (#lim + 0.010) .
+ COMPUTE #CUMF2 = NCDF.T(#tv,!2,#lim) .
+ END IF .
+ COMPUTE #DIFF = ABS(#CUMF2 - #ULIM) .
END LOOP .
compute limit = cdfnorm(#lim/sqrt(!2+1))*100.
EXECUTE .
!ENDDEFINE.
singcci tout df perc.