Posts

Showing posts from November, 2023

Final Project - Matthew Luu

Image
 Average Real Estate Sale Amount Analysis Between 2001 and 2020 in the State of Connecticut Throughout the years the real estate market has had many ups and downs, going through an absurd number of economic depressions between the years 2001 and 2020. My goal with this project is to look through the average sale prices of real estate in the State of Connecticut to see if there has been a significant increase in the overall selling price of real estate within those years.  I obtained the data for this project from  Dataset - Real Estate Sales 2001-2020 GL , which was provided by the State of Connecticut and its Office of Policy and Management. The dataset itself encompasses all real estate sales with a sales price of $2,000 or greater that occur between October 1 and September 30 of each year. For each sale record, the file includes the town, property address, date of sale, property type (residential, apartment, commercial, industrial or vacant land), sales price...

Module 12 Assignment

Image
 a.  Construct a time series plot using R #a. Construct a time series plot  # Load necessary library library(ggplot2) # Create a data frame df <- data.frame(   Month = factor(c(rep(c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"), 2)), levels = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")),   Year = c(rep(2012, 12), rep(2013, 12)),   Charge = c(31.9, 27, 31.3, 31, 39.4, 40.7, 42.3, 49.5, 45, 50, 50.9, 58.5, 39.4, 36.2, 40.5, 44.6, 46.8, 44.7, 52.2, 54, 48.8, 55.8, 58.7, 63.4) ) # Create a time series plot ggplot(df, aes(x = interaction(Year, Month, lex.order = TRUE), y = Charge, group = Year, color = as.factor(Year))) +   geom_line() +   theme(axis.text.x = element_text(...

Module 11 Assignment

> # Ensure the ISwR package is installed and loaded > if (!require(ISwR)) { + install.packages("ISwR") + library(ISwR) + } > > # Load the ashina data > data(ashina) > > # Convert the subject to a factor > ashina$subject <- factor(1:16) > > # Create the 'act' and 'plac' data frames > act <- data.frame(vas = ashina$vas.active, subject = ashina$subject, treat = 1, period = ashina$grp) > plac <- data.frame(vas = ashina$vas.plac, subject = ashina$subject, treat = 0, period = ashina$grp) > > # Define the function 'g1' > g1 <- function(x, y, z) { + seq(from = x, to = y, length.out = z) + } > > # Define your variables > a <- g1(2, 2, 8) > b <- g1(2, 4, 8) > x <- 1:8 > y <- c(1:4, 8:5) > z <- rnorm(8) > > # Generate the model matrices > model_ab <- model.matrix(~ a*b) > model_a_b <- model.matrix(~ a:b) > > # Fit the models > fit_a...