Midterm

docx

School

University of the Cumberlands *

*We aren’t endorsed by this school

Course

ITS-530-51

Subject

Economics

Date

Feb 20, 2024

Type

docx

Pages

8

Uploaded by ProfSardine3404

Report
Mid-term Graduate School, University of the Cumberlands ITS-530-B20: Analyzing & Visualizing Data Dr. Lamar Brown July 26, 2023
#1 # Read the housing data from the "HousingData.csv" file HousingData <- read . csv ( "HousingData.csv" , header = TRUE , sep = "," ) # Create separate datasets for housing data in Florida (FL) and New York (NY) housingDataFL <- HousingData [ HousingData$Location == 'FL' , ] housingDataNY <- HousingData [ HousingData$Location == 'NY' , ] # Find the most expensive and cheapest house prices in New York and Florida expHouseNY <- max ( housingDataNY$Price ) cheapHouseNY <- min ( housingDataNY$Price ) expHouseFL <- max ( housingDataFL$Price ) cheapHouseFL <- min ( housingDataFL$Price ) # Create a vector to categorize the states and another vector for the corresponding house prices stateCategory <- c ( 'CheapNY' , 'CheapFL' , 'ExpNY' , 'ExpFL' ) housePrice <- c ( cheapHouseNY , cheapHouseFL , expHouseNY , expHouseFL ) # Create a bar plot to visualize the expensive and less expensive housing prices in each state category barplot ( housePrice , names . arg = stateCategory , main = "Expensive and Less Expensive Housing Price" , xlab = "State Category" , ylab = "House Price" ) Based on the bar graph result, it appears that living in NY is more costly than living in FL. The least expensive house in FL is almost 1.5x more affordable than the least expensive house in NY. Likewise, the most expensive home in NY is nearly twice as expensive as the most expensive home in FL.
#2 # Find the lowest and highest crime ratings in New York and Florida housing data lowCrimeRateNY <- min ( housingDataNY$CrimeRating ) highCrimeRateNY <- max ( housingDataNY$CrimeRating ) lowCrimeRateFL <- min ( housingDataFL$CrimeRating ) highCrimeRateFL <- max ( housingDataFL$CrimeRating ) # Create a vector to categorize the states based on crime rates and another vector for the corresponding crime ratings stateCategory <- c ( 'lowCrimeNY' , 'lowCrimeFL' , 'highCrimeNY' , 'highCrimeFL' ) crimeRating <- c ( lowCrimeRateNY , lowCrimeRateFL , highCrimeRateNY , highCrimeRateFL ) # Create a bar plot to visualize the crime rates in New York and Florida barplot ( crimeRating , names . arg = stateCategory , main = "Crime Rate in NY and FL" , xlab = "State Category" , ylab = "Crime Rating" ) Based on the result, it shows both NY and FL states have the lowest crime rate for low crime areas. But, when it comes to the highest crime rate data, NY seems a bad choice. Hence, it can be inferred that living in FL is safer than living in NY.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
#3 # Find the lowest and highest crime ratings in New York and Florida housing data lowCrimeRateNY <- min ( housingDataNY$CrimeRating ) highCrimeRateNY <- max ( housingDataNY$CrimeRating ) lowCrimeRateFL <- min ( housingDataFL$CrimeRating ) highCrimeRateFL <- max ( housingDataFL$CrimeRating ) # Filter housing data for low and high crime rate areas in New York and Florida housePriceinLowCrimeRateNY <- housingDataNY [ housingDataNY$CrimeRating == lowCrimeRateNY , ] housePriceinHighCrimeRateNY <- housingDataNY [ housingDataNY$CrimeRating == highCrimeRateNY , ] housePriceinLowCrimeRateFL <- housingDataFL [ housingDataFL$CrimeRating == lowCrimeRateFL , ] housePriceinHighCrimeRateFL <- housingDataFL [ housingDataFL$CrimeRating == highCrimeRateFL , ] # Create a vector to categorize the states based on crime rates and housing prices, and another vector for the corresponding mean house prices stateCategory <- c ( 'PriceLowCrimeNY' , 'PriceLowCrimeFL' , 'PriceHighCrimeNY' , 'PriceHighCrimeFL' ) housePriceAndCrimeRating <- c ( mean ( housePriceinLowCrimeRateNY$Price ), mean ( housePriceinLowCrimeRateFL$Price ), mean ( housePriceinHighCrimeRateNY$Price ), mean ( housePriceinHighCrimeRateFL$Price )) # Create a bar plot to visualize the average housing prices in areas with high and low crime rates barplot ( housePriceAndCrimeRating , names . arg = stateCategory , main = "Housing Price in High and Low Crime Rate Areas" , xlab = "State Category" , ylab = "Average Housing Price vs Crime Rating" ) Based on the bar graph I achieved from the below data, it appears that the crime rate is higher in the low-priced housing areas compared to both states, with a difference of almost double. Even though NY has the highest house price, the crime rate seems higher compared to Florida’s expensive house prices.
#4 Based on the above results, I would consider moving to Florida if I were in Suzie's spot. The housing prices in Florida are lower than those in New York, and the crime rates are also lower. Let’s say if we slightly increase our budget, we can get an expensive house in Florida compared to New York where we cannot even get a medium house with that rate. We have the result from the #3 bar graph which shows expensive houses in Florida have a lower crime rate than in New York. #5 #5b # Create a vector with labels for the data newDataNY <- c ( 'Cheapest House in NY' , 'Expensive House in NY' , 'Salary' ) # Create a vector with corresponding data for the cheapest house price, expensive house price, and salary in NY dataNY <- c ( cheapHouseNY , expHouseNY , 120000 ) # Create a bar plot to visualize the house prices and salary in NY barplot ( dataNY , names . arg = newDataNY , main = "House Price in NY vs Salary" , xlab = "NY" , ylab = "House Price vs Salary" )  
#5c # Create a vector with labels for the data in Florida newDataFL <- c ( 'Cheapest House in FL' , 'Expensive House in FL' , 'Salary' ) # Create a vector with corresponding data for the cheapest house price, expensive house price, and salary in Florida dataFL <- c ( cheapHouseFL , expHouseFL , 75000 ) # Create a bar plot to visualize the house prices and salary in Florida barplot ( dataFL , names . arg = newDataFL , main = "House Price in FL vs Salary" , xlab = "FL" , ylab = "House Price vs Salary" ) #5d Based on the article, Sam explains that making a 20% down payment on a house reduces both the PMI (Private Mortgage Insurance) and interest rates, leading to a decrease in the monthly payment (Hawrylack, 2023). Let's begin our analysis by focusing on the expensive housing areas in NY and FL, which have lower crime rates. The most expensive house in FL is priced at approximately 400K, requiring an 80K down payment, leaving Suzie with $20K for closing fees and potential cosmetic maintenance. On the other hand, an expensive house in NY costs around $700K, necessitating a $140K down payment (Riquier, 2023). As Suzie only has $100K, this option seems nearly impossible unless she considers other loan options beyond the scope of this assignment.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Now, let's delve into additional information about Suzie. If she moves to NY, her income will be 120K, whereas it will be $75K in FL. According to Hawrylack's article, the recommended amount to spend on mortgage payments is around 28% (Hawrylack, 2023). Based on that information, Suzie can allocate $1750 per month towards mortgage payments if she is living in Florida, and $2800 per month if she is living in New York. Suzie has two options for buying a house. The first option, she chooses the expensive house in NY which is priced at $700K, and do a down payment of $100K for it. That way her monthly payment comes to around $2900 which is way higher than her budget. The second option is she buys the expensive house in Florida for around $400K and that way her monthly payment comes to around $1450. By choosing this option, she can use the extra $300 to make additional payments, which will allow her to pay off the mortgage loan in nine years and four months. Or it is better to move to a medium price house in NY state even though the crime rate does not sound good.
References Hawrylack, S. (2023, July 13). The average down payment on a house, explained . What Is The Average Down Payment On A House? | Quicken Loans. https://www.quickenloans.com/learn/average-down-payment-on-house. Riquier, A. (2023, June 15). Current mortgage rates in New York . Forbes. https://www.forbes.com/advisor/mortgages/current-mortgage-rates-new-york.