2024-02-10

Introduction

  • Lung cancer is the second most common cancer in the United States, and the deadliest cancer worldwide
  • Lung cancer is so deadly because it is not often caught in the early stages; many patients are asymptomatic in these early stages
  • There is nothing that solely causes of lung cancer, but by analyzing these types of data sets, we can find certain conditions that may be linked to higher outcomes of the cancer
    Diagram of Lung Cancer

    Diagram of Lung Cancer

Data Set & Problem

  • The data set I used was found on Kaggle, and originally used in a study of lung cancer patients from China
  • It contains 26 columns including patients’ index, patient ID, age, and gender, and possible risk factors including air pollution, alcohol use, dust allergy, occupational hazards, genetic risk, chronic lung disease, balanced diet, obesity, smoking, passive smoker, chest pain, coughing of blood, fatigue, weight loss, shortness of breath, wheezing, swallowing difficulty, clubbing of fingernails, frequent colds, dry cough, and snoring, along with level ranking.
  • Data Set & Problem (Cont.)

    • Question to answer: How do the ages of people with high genetic risk and occupational hazards, compare to the ages of people with high pollution exposure? Are people with exposure to air pollution sooner to develop lung cancer? Do genetic and occupational risks take longer to develop?
    • People living in large, heavily polluted cities, are exposed from birth. I want to find out if these sorts of people are developing lung cancer at younger ages. As many cities worldwide continue to increase factory quantities, production levels, and carbon omitting vehicles, could the world see a spike in lung cancer levels?

    Manipulating/Cleaning the data

    First, I wanted to remove any null values from the data set, as I wanted to visualize which factors contributed the most to cancer. Next, I wanted to remove a few variables which are very often said to cause lung cancer and other chronic diseases, along with the patient Id column. Then I wanted to rename a few columns with longer names to make then more manageable.

    sum(is.na(lc))
    [1] 0
    colnames(lc) <- c("index","patientId","Age","Gender","airPollution","alcoholUse","dustAllergy","jobHazard","geneticRisk","chronicLD","balancedDiet", "Obesity","Smoking","passiveSmoker","chestPain","coughingBlood", "Fatigue", "weightLoss","shortnessOfBreath","Wheezing","difficultySwallowing","fingernailClubbing","Colds", "dryCough","Snoring","Level")
    lc <- subset(lc, select= -c(Smoking,passiveSmoker,alcoholUse, patientId))

    Vizualizing Age Frequency

    The main factors I want to look at are job hazards, air pollution, and genetic risk, and how they affect the level. So I first just wanted to visualize the frequency of each of those variables, along with age.

    hist(lc$Age, main="Histogram of Age", col="darkgreen")

    Visualizing Air Pollution frequency

    barplot(table(lc$airPollution), main="Air Pollution Exposure", xlab="Exposure Level",ylab="Frequency")

    Visualizing Occuptaional Hazard Frequency

    barplot(table(lc$jobHazard),main="Occupational Hazard Levels",xlab="Exposure Level",ylab="Frequency")

    Visualizing Genetic Risk Frequency

    barplot(table(lc$geneticRisk),main="Genetic Risk Level",xlab="Level",ylab="Frequency")

    Visualizing Level Frequency

    barplot(table(lc$Level),ylab="Frequency",xlab="Level")

    Exploratory Analysis

    I want to filter the data so that only high values are included. Air pollution and Occupational hazard are ranked on a scale of 1 to 8, and genetic risk on 1 to 7.

    ap_high <- lc %>%
      select(Age,airPollution,Level) %>%
      filter(airPollution>=6)
    jh_high <- lc %>%
      select(Age, jobHazard,Level) %>%
      filter(jobHazard>=6)
    gr_high <- lc %>%
      select(Age, geneticRisk,Level) %>%
      filter(geneticRisk>=5)

    Exploratory Analysis (Cont.)

    Plotting Pollution Exposure Level vs Age

    plot_ap <- ap_high %>%
      ggplot(aes(unclass(airPollution),Age,color=Level))+
      geom_point()+
      labs(x="Pollution Exposure Level") +
      theme_bw()
      
    ggplotly(plot_ap,height=250,width=500)

    Exploratory Analysis (Cont.)

    Plotting Occupational Hazards vs Age

    plot_jh <- jh_high %>%
      ggplot(aes(unclass(jobHazard),Age,color=Level)) +
      geom_point() +
      labs(x="Occupational Hazard Levels") +
      theme_bw()
    ggplotly(plot_jh,height=250,width=500)

    Exploratory Analysis (Cont.)

    Plotting Genetic Risk vs Age

    plot_gr <- gr_high %>%
      ggplot(aes(unclass(geneticRisk),Age,color=Level)) +
      geom_point() +
      labs(x="Genetic Risk Ranking") +
      theme_bw()
    ggplotly(plot_gr,height=250,width=500)

    Conclusion

    After Analyzing the data, it appears that the factors of air pollution, job hazards, and genetic risk rank mainly in the high and medium levels for people with high exposure. Contrary to what I previously hypothesized, it does not necessarily appear that people with high air pollution exposure are developing cancer at a younger age than the other two groups analyzed. However, it does appear that people with the highest pollution exposures are more likely to have a high severity level. Taking these risk factors into consideration can be helpful for doctors, and people who are at a higher risk can be screened more frequently. However, these factors are not preventable to every person. These risk factors will take social, political, and economic solutions to minimize.

    Link to Data Set