close all
clear all
    disp('Light')
    lw = 3; 
 set(0, 'DefaultAxesFontSize', 16);
 fs = 15;
 msize = 10;


load 'C:\STAT\Descriptive\Descriptivedat\light.dat'

irange = iqr(light);
q1 = prctile(light, 25);
q3 = prctile(light, 75);
out1 = find(light < q1 -  2.5*irange)  %indices for outliers smaller that q1-2.5*iqr
out3 = find(light > q3 + 2.5*irange)  %indices for outliers larger that q3+2.5*iqr
lightc = light(   setdiff( (1:length(light)), union(out1,out3)))
%take indices (1:length(light))  minus (out1 union out3), so the outlier
%indices are excluded

%mean, 20\% trimmed mean, Real MAD, std, variance
meli = mean(lightc)
tm20 = trimmean(lightc,20)
realmad = 1/0.6745 * mad(lightc,1) 
std(lightc)
var(lightc)
%-------------------
figure(1)
% histogram with 30 bins
hist(lightc, 30)
%print  -depsc  'C:\Brani\Courses\bmestatu\Fall2007\reviewfig1.eps'

figure(2)
histn(lightc,15,3,42);
hold on
[f,x,u] = ksdensity(lightc);
plot(x,f,'r-','linewidth',lw)
title('Density estimate for "cleaned" light data')
%print  -depsc  'C:\Brani\Courses\bmestatu\Fall2007\reviewfig2.eps'


