bsp_4_1_3b.m

% Beispiel für Kap 4.1.3b
% Beispiel Lebensdauern
X = load('../daten/lebensdauer.dat');
X1 = X(:,1);
X2 = X(:,2);
edges = 0:16;

figure('Position',[1 1 700 400], 'Color',[1 1 1]);
subplot(1,2,1)
histogram(X1, edges)
xlim([0,16])
xlabel("Lebensdauern von Typ 1");
subplot(1,2,2)
histogram(X2, edges)
xlim([0,16])
xlabel("Lebensdauern von Typ 2");

% berechnen der Quantile für i/N
N = 20;
p = (1:N-1)/N;
x1p = quantile(X1, p);
x2p = quantile(X2, p);

% berechnen der Parameter und Quantile der Normalverteilung
m = mean(X1);
s = std(X1);
xnp = norminv(p, m, s);

figure('Position',[1 1 700 400], 'Color',[1 1 1]);
subplot(1,2,1)
plot(x2p, x1p, 'o', [0 12], [0, 12])
title('Q-Q-Plot Typ1 über Typ2')
xlabel('Typ 2')
ylabel('Typ 1')

subplot(1,2,2)
plot(xnp, x1p, 'o', [0 12], [0, 12])
title('Q-Q-Plot Typ1 über Normalverteilung')
xlabel('Normalverteilung')
ylabel('Typ 1')