Scripts/blockjak.run
From TNT
blockboot
Author: Mark Siddall.
Version: 1.0.
For: resampling whole partitions as units.
Arguments: none.
Example: not provided.
Script
Scripts may not be displaying correctly here at present, use the script from the provide file in the archive.
macro=; /*** check whether blocks are defined ***/ if (nblocks < 2) quote * This macro is intended to implement Siddalls
partition jackknife support. For this to work
you must have defined partions using the BLOCKS
command. No blocks have been found.
Please define your blocks, or arraange your
data input in blocks and re-run.; proc/; end
var: numblocks;
set numblocks nblocks;
if (nblocks < 25) if (getresponse [Only 'numblocks' partitions? Continue?]!= 1) if(getresponse [Show partitions?]==1) loop =dumpblocks 1 nblocks set numblocks blockstart[#dumpblocks];
quote blocknum #dumpblocks 'numblocks';
stop end proc/; end
end
if (getresponse ['numblocks' partitions found. To stop and see blocks click NO or CANCEL.]!=1) loop =dumpblocks 1 nblocks set numblocks blockstart[#dumpblocks];
quote blocknum #dumpblocks 'numblocks';
stop proc/; end if (getresponse [Using whatever New Tech Search params are current. To stop, view and reset them click NO or CANCEL.]!=1)
xmult:;
proc/; end
var: block_weight choose_block block_start block_end; tsave /; tsave * jakblock.tre; report -; sil = all; collapse temp;
loop =bootrep 1 100
progress #bootrep 100 Jackknifing blocks ... ;
/* one jackknife replicate follows */ /* TNT does not allow weights of 0 */ ccode /1.; ccode [.;
/* TNT does not allow weights of 0 */ /* re weight 1st char of blocks by incremental sampling */
loop =resamp 1 nblocks
set choose_block getrandom[1 nblocks];
set block_start blockstart['choose_block'];
set block_end blockend['choose_block'];
set block_weight weight['block_start'];
set block_weight++;
ccode /'block_weight' 'block_start';
stop
/* correct weight or exclude chars of blocks */ loop =reweight 1 nblocks
set block_start blockstart[#reweight];
set block_end blockend[#reweight];
set block_weight weight['block_start'];
if ('block_weight' == 1)
ccode ] 'block_start'.'block_end';
else
set block_weight--;
ccode /1 'block_start'.'block_end';
end
stop /* follow with treesearch etc */ xmult ; nelsen * ; save / ; stop /*end of bootrep loop */ progress /; sil - all; report =; tsave /; keep 0; p jakblock.tre; if (getresponse[See groups as freq diffs < 50 pct? Click NO for MajRule]==1) freqdifs; else majority; end proc/;