Posts

Showing posts from November, 2024

The Final project in this class

Image
  Issaiah Jennings  Final Project Introduction My project aimed to determine whether smoking status and region (northeast, southeast, southwest, northwest) significantly impact insurance charges. Specifically, I wanted to see if smokers incur higher charges compared to non-smokers and whether insurance costs differ across regions. Understanding these relationships could help insurance providers identify how lifestyle and geographic factors influence healthcare costs, ultimately guiding pricing strategies and market targeting. Methods This project closely relates to concepts from class, particularly hypothesis testing and statistical analysis. For example, I used a t-test to compare the average insurance charges between smokers and non-smokers, a method we learned to analyze differences between two groups. Similarly, I applied ANOVA (Analysis of Variance) to test for differences in average charges across multiple groups, in this case, the regions. These methods align with the c...

Module # 12 assignment

Image
  Issaiah Jennings  Module # 12 assignment > # Install and load the 'forecast' package > if (!require(forecast)) {  # Check if 'forecast' package is installed +   install.packages("forecast")  # Install the package if not present + } > library(forecast)  # Load the package >  > # Define the data for 2012 and 2013 > data_2012 <- c(31.9, 27, 31.3, 31, 39.4, 40.7, 42.3, 49.5, 45, 50, 50.9, 58.5) # Credit card charges for 2012 > data_2013 <- c(39.4, 36.2, 40.5, 44.6, 46.8, 44.7, 52.2, 54, 48.8, 55.8, 58.7, 63.4) # Credit card charges for 2013 >  > # Combine the data into a single vector > student_cc <- c(data_2012, data_2013) >  > # Create a time series object > cc_series <- ts(student_cc, frequency = 12, start = c(2012, 1))  > # frequency = 12 (monthly), start = c(2012, 1) indicates the time series starts in January 2012 >  > # Plot the time series > plot.ts(cc_series,...

Module # 11 assignment

  Issaiah Jennings  Module # 11 assignment > # Load the necessary package and data > library(ISwR) > data(ashina) >  > # Set up factors and prepare data > ashina$subject <- factor(1:16) > attach(ashina) > act <- data.frame(vas = vas.active, subject = subject, treat = 1, period = grp) > plac <- data.frame(vas = vas.plac, subject = subject, treat = 0, period = grp) > combined_data <- rbind(act, plac) >  > # Fit the additive model and view summary > additive_model <- lm(vas ~ subject + treat + period, data = combined_data) > summary(additive_model) Call: lm(formula = vas ~ subject + treat + period, data = combined_data) Residuals:    Min     1Q Median     3Q    Max  -48.94 -18.44   0.00  18.44  48.94  Coefficients: (1 not defined because of singularities)             Estimate Std. Error...