% % Written by: % -- % John L. Weatherwax 2008-02-20 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- clear all; close all; clc; addpath('../../Code/CSTool'); load lawpop; % <- the total population for ti=1:2, x = lawpop(:,ti); n = length(x); T = median(x); % compute the jackknifed replicates of the median statistic: jack = zeros(1,n); % <- store the jackknifed replicates for ii=1:n jack(ii) = median( x( setdiff(1:n,ii) ) ); end fprintf('the unique jackknifed replicates are given by\n'); unique(jack) % get the mean of the jackknifed estimates TJ = mean(jack); jackBias = (n-1)*(TJ-T); jackEstStdError = sqrt( ((n-1)/n)*sum( ( jack - TJ ).^2 ) ); % (of the gpa): fprintf('the jackknifed estimate of the SE of the median of component %d is %10.5f\n', ti, jackEstStdError ); fprintf('the jackknifed estimate of the bias in the median of component %d is %10.5f\n', ti, jackBias ); end