Survival analysis is a crucial tool in actuarial science, used to model time-to-event data. This presentation explores various statistical techniques applied to a breast cancer dataset.
Survival analysis is a crucial tool in actuarial science, used to model time-to-event data. This presentation explores various statistical techniques applied to a breast cancer dataset.
The dataset used in this analysis contains information related to breast cancer cases. It includes several variables such as Age,Race,Marital Status, T Stage, N Stage. Let’s begin by examining the structure and initial rows of the dataset:
library(ggplot2) ggplot(data, aes(x=Age)) + geom_histogram(binwidth=5, fill="blue", color="black", alpha=0.7) + labs(title="Distribution of Age", x="Age (years)", y="Frequency")
#Boxplot of Age by Grade
ggplot(data, aes(x=factor(Grade), y=Age)) + geom_boxplot(fill="blue", color="black", alpha=0.7) + labs(title="Boxplot of Age by Grade", x="Grade", y="Age (years)")
#Density Plot of Age
ggplot(data, aes(x=Age)) + geom_density(fill="blue", alpha=0.7) + geom_vline(aes(xintercept=mean(Age)), color="red", linetype="dashed", size=1) + labs(title="Density Plot of Age with Mean Line", x="Age (years)", y="Density")
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. ## ℹ Please use `linewidth` instead. ## This warning is displayed once every 8 hours. ## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was ## generated.
#R Code Example
# Example code to create a plot ggplot(data, aes(x=Age, y=Grade)) + geom_point() + labs(title="Scatter Plot of Age vs. Grade", x="Age (years)", y="Grade")