% Constants
age_exposure = 10; % 피폭 연령 (10세)
attained_ages = 15:5:80; % 도달 연령 (잠복기 반영하여 15세부터 80세까지 5년 간격)
dose = 1; % 방사선량 (Gy)
% Total ERR and EAR parameters for "총 고형암"
params_ERR_total = struct('beta', 0.58, 'alpha1', -0.19, 'alpha2', -1.65);
params_EAR_total = struct('beta', 59.83, 'alpha1', -0.27, 'alpha2', 2.38);
% Individual cancer ERR parameters for 여성 (female)
cancer_params_ERR = {
struct('beta', 0.65, 'alpha1', -0.19, 'alpha2', -1.65), % 식도
struct('beta', 0.38, 'alpha1', -0.19, 'alpha2', -1.65), % 위
struct('beta', 0.33, 'alpha1', -0.19, 'alpha2', -1.65), % 결장
struct('beta', 0.40, 'alpha1', -0.19, 'alpha2', -1.65), % 간
struct('beta', 1.36, 'alpha1', 0.16, 'alpha2', -1.65),
% 폐
struct('beta', 0.87, 'alpha1', 0, 'alpha2', -2.26),
% 유방
struct('beta', 0.32, 'alpha1', -0.19, 'alpha2', -1.65), % 난소
struct('beta', 1.10, 'alpha1', -0.19, 'alpha2', -1.65), % 방광
struct('beta', 1.05, 'alpha1', -0.82, 'alpha2', 0),
% 갑상선
struct('beta', 0.17, 'alpha1', -0.42, 'alpha2', -1.65)
% 기타 고형암
};
% Individual cancer EAR parameters for 여성 (female)
cancer_params_EAR = {
struct('beta', 0.66, 'alpha1', 0.49, 'alpha2', 2.38),
% 식도
struct('beta', 9.18, 'alpha1', -0.27, 'alpha2', 2.38),
% 위
struct('beta', 2.40, 'alpha1', -0.27, 'alpha2', 2.38),
% 결장
struct('beta', 1.30, 'alpha1', -0.27, 'alpha2', 2.38),
% 간
struct('beta', 8.97, 'alpha1', 0.01, 'alpha2', 4.25),
% 폐
struct('beta', 1.47, 'alpha1', -0.27, 'alpha2', 2.38),
% 난소
struct('beta', 2.77, 'alpha1', -0.12, 'alpha2', 6.39),
% 방광
struct('beta', 10.45, 'alpha1', -0.27, 'alpha2', 2.38)
% 기타 고형암
};
% Function to calculate ERR or EAR for a given cancer type
calculate_risk = @(beta, alpha1, alpha2, e, a, d) beta * d * exp(alpha1 * (e - 30) / 10 +
alpha2 * log(a / 70));
% Initialize arrays to store results
err_total_method1 = zeros(length(attained_ages), 1);
ear_total_method1 = zeros(length(attained_ages), 1);
err_total_method2 = zeros(length(attained_ages), 1);
ear_total_method2 = zeros(length(attained_ages), 1);
% Calculate ERR and EAR for each attained age using both methods
for j = 1:length(attained_ages)
age_attained = attained_ages( j);
% Method 1: Total ERR and EAR for "총 고형암"
err_total_method1( j) = calculate_risk(params_ERR_total.beta, params_ERR_total.alpha1,
params_ERR_total.alpha2, age_exposure, age_attained, dose);
ear_total_method1( j) = calculate_risk(params_EAR_total.beta,
params_EAR_total.alpha1, params_EAR_total.alpha2, age_exposure, age_attained, dose);
% Method 2: Sum of ERR and EAR for individual cancers
err_individual_sum = 0;
ear_individual_sum = 0;
for i = 1:length(cancer_params_ERR)
err_individual_sum = err_individual_sum +
calculate_risk(cancer_params_ERR{i}.beta, cancer_params_ERR{i}.alpha1,
cancer_params_ERR{i}.alpha2, age_exposure, age_attained, dose);
end
for i = 1:length(cancer_params_EAR)
ear_individual_sum = ear_individual_sum +
calculate_risk(cancer_params_EAR{i}.beta, cancer_params_EAR{i}.alpha1,
cancer_params_EAR{i}.alpha2, age_exposure, age_attained, dose);
end
err_total_method2( j) = err_individual_sum;
ear_total_method2( j) = ear_individual_sum;
end
% Display results
fprintf('Method 1 (Total ERR and EAR for "총 고형암"):\n');
disp(table(attained_ages', err_total_method1, ear_total_method1, 'VariableNames',
{'Attained_Age', 'ERR', 'EAR'}));
fprintf('\nMethod 2 (Sum of ERR and EAR for individual cancers):\n');
disp(table(attained_ages', err_total_method2, ear_total_method2, 'VariableNames',
{'Attained_Age', 'ERR', 'EAR'}));
% Plotting results for comparison
figure;
plot(attained_ages, err_total_method1, '-o', 'DisplayName', 'Method 1: Total ERR');
hold on;
plot(attained_ages, err_total_method2, '-x', 'DisplayName', 'Method 2: Sum of Individual
ERR');
title('ERR vs Attained Age');
xlabel('Attained Age');
ylabel('ERR per Gy');
legend('show');
grid on;
figure;
plot(attained_ages, ear_total_method1, '-o', 'DisplayName', 'Method 1: Total EAR');
hold on;
plot(attained_ages, ear_total_method2, '-x', 'DisplayName', 'Method 2: Sum of Individual
EAR');
title('EAR vs Attained Age');
xlabel('Attained Age');
ylabel('EAR per Gy (per 10,000 person-years)');
legend('show');
grid on;
% Constants
ages_at_exposure = [10, 30, 50]; % 피폭 연령
attained_ages_by_exposure = {15:10:80, 35:10:80, 55:10:80}; % 각 피폭 연령에 따른 도달
연령 (잠복기 고려)
dose = 1; % Gy = 1 가정
% Parameters for "총 고형암" ERR and EAR
params_ERR = struct('beta', 0.58, 'alpha1', -0.19, 'alpha2', -1.65);
params_EAR = struct('beta', 59.83, 'alpha1', -0.27, 'alpha2', 2.38);
% Function to calculate ERR or EAR for a given cancer type
calculate_risk = @(beta, alpha1, alpha2, e, a, d) beta * d * exp(alpha1 * (e - 30) / 10 +
alpha2 * log(a / 70));
% Initialize figures for combined plots
figure;
hold on;
title('ERR vs Attained Age');
xlabel('Attained Age');
ylabel('ERR per Gy');
grid on;
figure;
hold on;
title('EAR vs Attained Age');
xlabel('Attained Age');
ylabel('EAR per Gy (per 10,000 person-years)');
grid on;
% Calculate and plot ERR and EAR for each exposure age on the same graph
for i = 1:length(ages_at_exposure)
age_exposure = ages_at_exposure(i);
attained_ages = attained_ages_by_exposure{i}; % 잠복기 고려한 도달 연령
% Initialize arrays to store results
results_ERR = zeros(length(attained_ages), 1);
results_EAR = zeros(length(attained_ages), 1);
% Calculate ERR and EAR for each attained age
for j = 1:length(attained_ages)
age_attained = attained_ages( j);
% Calculate ERR
results_ERR( j) = calculate_risk(params_ERR.beta, params_ERR.alpha1,
params_ERR.alpha2, age_exposure, age_attained, dose);
% Calculate EAR
results_EAR( j) = calculate_risk(params_EAR.beta, params_EAR.alpha1,
params_EAR.alpha2, age_exposure, age_attained, dose);
end
% Plot ERR for current exposure age
figure(1);
plot(attained_ages, results_ERR, '-o', 'DisplayName', sprintf('Exposure Age: %d',
age_exposure));
% Plot EAR for current exposure age
figure(2);
plot(attained_ages, results_EAR, '-o', 'DisplayName', sprintf('Exposure Age: %d',
age_exposure));
end
% Add legends to both figures
figure(1);
legend('show');
figure(2);
legend('show');