' Program executes the inverse normal method of p-value combination (in cross-correlated panels) ' p-values to be evaluated need to be stored in the workfile-vector "pvals" ' Main results are stored in the workfile table "inm" ' 1st row: Hartung(kappa); test statistic; p-value; estimated rho ' 2nd row: Choi (no correlation); test statistic; p-value ' 3rd row: Fisher (no correlation); test statistic; p-value ' 4th row: sample size ' References: ' Hartung, J. (1999): "A Note on Combining Dependent Tests of Significance", Biometrical Journal ' Demetrescu, M., U. Hassler and A.-I. Tarcolea (2006): "Combinig Signficance of Correlated Statistics ' with Application to Panel Data", Oxford Bulletin of Economics and Statistics 'the default of kappa is 0.2, which can be changed below '*** Determine kappa********************************************************* !kappa=0.2 '*** Nothing needs to be provided below *********************************** 'smpl %0 %1 !n=@obs(pvals) '********************************************************************************* 'Apply inverse normal method 'Step 1: Converting p-values into probits vector(!n) probits for !j=1 to !n probits(!j)=@qnorm(pvals(!j)) next 'Step 2: Calculating (constant) correlation between probits vector(!n) probits_dev probits_dev=probits-@mean(probits) 'mean deviations !rhohat=1-(1/(!n-1))*@sumsq(probits_dev) vector(2) temp temp(1)=-1/(!n-1) temp(2)=!rhohat !rhohatstar=@max(temp) 'determining rhohatstar if !kappa<0 then !ka=0.1*(1+1/(!n-1)-!rhohatstar) else !ka=!kappa endif 'Step 3: Calculating t_rhohatstar_kappa statistic !t_rhohatstar = @sum(probits)/@sqrt(!n+!n*(!n-1)*(!rhohatstar+!ka*@sqrt(2/(!n+1))*(1-!rhohatstar))) '***** Compute Choi and Fisher ************************************************ !choi=@sum(probits)/@sqrt(!n) 'genr help_series = log(pvals) !fisher=-2*@sum(log(pvals)) '************************************************************************************ 'Store results in a table table inm inm(2,1)="Hartung (0.2)" 'inm(1,3)="p-value" 'inm(1,4)="rhohatstar" inm(2,2)=!t_rhohatstar inm(2,3)=@cnorm(!t_rhohatstar) inm(2,4)=!rhohatstar inm(3,1)="Choi Z" inm(4,1)="Fisher P" inm(3,2)=!choi inm(3,3)=@cnorm(!choi) inm(4,2)=!fisher inm(4,3)=1-@cchisq(!fisher,2*!n) inm(5,1)=@obs(pvals) 'delete help_series delete probits delete probits_dev