close all
clear all
disp('Nanoprism')
  lw = 2; 
  set(0, 'DefaultAxesFontSize', 16);
  fs = 15;
  msize = 10;
% end of preabmle--------------------------------------
load 'C:\STAT\Corr\Corrdat\nanoprism.dat'
recsep = nanoprism(:,1);
logwl = nanoprism(:,2);
r = corr(recsep, logwl)    %0.9246
n = length(logwl);
%fisher z and inverse transforms as pure functions 
fisherz = @(x) atanh(x); invfisherz = @(x) tanh(x);
%Forming z for testing H0: rho = 0.96: 
z = (fisherz(r) - fisherz(0.96))/(1/sqrt(n-3))   %-1.3840
% alternative H1: rho < 0.96
pval = normcdf(z)  %0.0832
%95% confidence interval
invfisherz([fisherz(r) - norminv(0.975)/sqrt(n-3) ,...
            fisherz(r) + norminv(0.975)/sqrt(n-3)])
  %0.8203    0.9694

