function cvalue=cvcalcABS(osser);
%Calculates p-values of TVP and Optimal tests -- requires tables in the same directory
%Inputs: osser=osserved value of the statistic
%Output: critical value at 5% level (scalar)
%Note: the critical value table is generated by cvREC.m

numero=[0.1000    10.496;
    0.1500    8.087;
    0.2000    6.609;
    0.2500    5.594;
    0.3000    4.842;
    0.3500    4.212;
    0.4000    3.738;
    0.4500    3.333;
    0.5000    2.984;
    0.5500    2.700;
    0.6000    2.412;
    0.6500    2.153;
    0.7000    1.900;
    0.7500    1.655;
    0.8000    1.446;
    0.8500    1.192;
    0.9000    0.952];

tavola=numero; 
uno=0; 
if osser<=tavola(1,1) cv=numero(1,2); uno=uno+1; end;
if osser>=tavola(end,1) cv=numero(end,2); uno=uno+1; end;
if uno==0;
   rigal=find(numero(:,1)<=osser);
   riga=[max(rigal);max(rigal)+1]; sel=tavola(riga,[1,2]);
   cv=sel(2,2)+(sel(2,1)-osser)*(sel(1,2)-sel(2,2))/(sel(2,1)-sel(1,1));
end;
cvalue=cv;