Download - VBA Program - Life Expectancy Calculator
![Page 1: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/1.jpg)
Cho EunwooCheung Chin Ho
Wong Chi KiWong Chun Hong
Life Expectancy Calculator
![Page 2: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/2.jpg)
This VBA program is designed to estimate a person’s life expectancy, taking into account a number of factors, such as his or her current age, gender, amount of weekly exercise, smoking habits, etc.
Overview
![Page 3: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/3.jpg)
1. “Base” Life Expectancy Life table for Hong Kong population, published by the Census of
Statistics Department in 2013, is utilized to calculate “base” life expectancy.
2. Modification The “base” is then modified according to the user input
regarding his or her own specific health conditions and daily habits.
Calculation Steps
![Page 4: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/4.jpg)
1. “Base” Life Expectancy
• There are different life tables for male and female population
• This table links gender and age with their corresponding life expectancy.
• This life expectancy serves as a “base” for further modification.
![Page 5: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/5.jpg)
In fact, there are many factors such as blood pressure, smoking, amount of sleep, stress level, family history on diseases, etc.
However, to ensure that all measurement are extracted from reliable sources, only 8 factors were included in this project.
Some factors affect mortality rate, while the others directly affect the absolute value of life expectancy.
2. Modification
![Page 6: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/6.jpg)
Marital status (change in mortality rate) On average, married people have a 15 percent higher life
expectancy than people who are single.
Smoking habit (direct change in life expectancy) Smoking 1 cigarette per day reduces life expectancy by
0.008219178 years
2. Modification
![Page 7: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/7.jpg)
2. Modification
• By utilizing Userform in Excel, the program asks user to select or input his or her relevant health data.
![Page 8: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/8.jpg)
VBA Codes
![Page 9: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/9.jpg)
VBA Codes
![Page 10: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/10.jpg)
VBA Codes
![Page 11: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/11.jpg)
VBA Codes
![Page 12: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/12.jpg)
Demonstration
![Page 13: VBA Program - Life Expectancy Calculator](https://reader036.vdocuments.us/reader036/viewer/2022071907/55ca7148bb61eb62318b4609/html5/thumbnails/13.jpg)
Demonstration