How Covid-19 Affected the Economy And Housing Market
In this document we will be analyzing how Covid-19 affected the economy and housing market within Cincinnati as well as specifically the general housing market within the Xavier area. Through your viewing of this document you will better understand property sales trends troughout the Xavier area
Running Code
When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
a
a
Looking over the histogram, it appears to create an almost bell curve around 2,000 square feet for the most amount of single family households.
looking at this box plot shows that households in Walnut Hills, Hyde Park, and Mount Adams seems to have the highest average bathrooms per bedroom as well as the highest outliers of that ratio. this implies that these neighborhoods are more wealthy as they can afford to have more bathrooms than bedrooms(which implies they have more people in the house)
Looking at this data we can clearly see that Hyde park has the highest transaction value compared to the rest of the neighborhoods by a considerable margin. Looking at it as well we can tell that there apears to be a seasonal relationship in august.
Gifted Property
If you were gifted your choice of a property with any factors you want, you would want a specific combination of factors in order to maxamise profit when selling the house. You would want a household with a large amount of square footage located in hyde park as these help maxamise the value of the household as these relationships are linear. You would also want to sell the house in august as this is the most profitable time to sell houses in hyde park. You will also want to sell a newer house as they do sell for a bit more statistically but it dosn’t seem to be as big of a factor as others. Those are the factors you would want if you were to obtain a property of your choice as a gift and if you intended to sell it for profit.
Self - Directed Analysis
Looking at this you can clearly see that there are a couple corporations that have acceded 32million dollars worth of value, however looking at the count of properties, it appears that only 3 organizations actually own a great amount of properties, but at most this is around 15 for the highest corporation. These three corporations are Bryan Carlier LLC, Denrick Properties LLC, and VB One LLC. Looking at these graphs I would have to say that tis is in fact a problem but not nearly as big as some people would be making out.
Source Code
---title: "Assignment 4 - Tommy Granzier"author: "Tommy G"editor: visualtoc: true # Generates an automatic table of contents.format: # Options related to formatting. html: # Options related to HTML output. code-tools: TRUE # Allow the code tools option showing in the output. embed-resources: TRUE # Embeds all components into a single HTML file. execute: # Options related to the execution of code chunks. warning: FALSE # FALSE: Code chunk sarnings are hidden by default. message: FALSE # FALSE: Code chunk messages are hidden by default. echo: FALSE # TRUE: Show all code in the output.---## How Covid-19 Affected the Economy And Housing MarketIn this document we will be analyzing how Covid-19 affected the economy and housing market within Cincinnati as well as specifically the general housing market within the Xavier area. Through your viewing of this document you will better understand property sales trends troughout the Xavier area## Running CodeWhen you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:```{r}#| include: FALSE#| label: setuplibrary(tidyverse) # For the normal stufflibrary(skimr) #For better summary statistics```a```{r}#|label: load data#|message: FalseX_P <-read_csv("http://asayanalytics.com/xu_prop-csv")```a```{r}X_P <- X_P %>%#I am getting rid of days that cant existmutate(day =ifelse(month ==2& day >=30, NA, day))X_P <- X_P %>%#I am getting rid of things that couldn't have been built outsidemutate(year =ifelse(year >=2022, NA, year)) #of the dataset's timelineX_P <- X_P %>%#Gets rid of any negative salesmutate(value =ifelse(value <=0, NA, value))X_P <- X_P %>%# Since there are lest than 10 unique vatible, it is better tomutate(neighborhood =as.factor(neighborhood)) #have this as a factor``````{r}X_P <- X_P %>%#This creates a date as a sigle valuemutate(sale_date =as.Date(paste(year, month, day, sep ="-")))X_P <- X_P %>%# This gets rid of now redundent year, month, and day valuesselect(-year, -month, -day)X_P <- X_P %>%#This determins wheather it is a multifamly apartment or notmutate(mult_fam =FALSE) %>%mutate(mult_fam =ifelse(use ==401| use ==402| use ==403, TRUE, mult_fam))X_P <- X_P %>%# This shows the relationship between the standard deviation andmutate(val_cat =case_when( # the mean for value, if value is missing it alsois.na(value) ~"is missing", #displays that it is missing value >=mean(value, na.rm =TRUE) -sd(value, na.rm =TRUE) & value <=mean(value, na.rm =TRUE) +sd(value, na.rm =TRUE) ~"Within 1 SD", value >mean(value, na.rm =TRUE) +sd(value, na.rm =TRUE) ~"Above 1 SD", value <mean(value, na.rm =TRUE) -sd(value, na.rm =TRUE) ~"Below 1 SD" ))``````{r}#3.1X_P %>%filter(use !=510) %>%#Only single family householdsggplot(aes(x = finished_sqft)) +#creating the plot and making it a histogramgeom_histogram(binwidth =250, fill ="blue3", color ="black", alpha =0.72) +labs(title ="Distribution of Single Family Households", #with some cosmeticx ="Finished Square Feet", #Choices and the naming of the title, x, and yy ="Count of Households")```Looking over the histogram, it appears to create an almost bell curve around 2,000 square feet for the most amount of single family households.```{r}#3.2X_P %>%filter(!is.na(full_bath) &!is.na(bedrooms) & bedrooms >0) %>%ggplot(aes(x = neighborhood, y = full_bath / bedrooms)) +geom_boxplot(fill ="blue2", color ="black") +labs(title ="Ratio of Full Bathrooms to Bedrooms",x ="Neighborhoods",y ="Full Bathrooms per Bedrooms") +theme(axis.text.x =element_text(angle =45, hjust =1))```looking at this box plot shows that households in Walnut Hills, Hyde Park, and Mount Adams seems to have the highest average bathrooms per bedroom as well as the highest outliers of that ratio. this implies that these neighborhoods are more wealthy as they can afford to have more bathrooms than bedrooms(which implies they have more people in the house)```{r}#3.3X_P %>%filter(!is.na(value)) %>%group_by(neighborhood, month =month(sale_date)) %>%summarise(t_sales =sum(value, na.rm =TRUE)) %>%ggplot(aes(x = month, y = t_sales, color = neighborhood, group = neighborhood)) +geom_line(size =1) +labs(title ="Total Transaction Value of Households by Month and Neighborhood",x ="Months (1 through 12)",y ="Total Sales",color ="Neighborhood")```Looking at this data we can clearly see that Hyde park has the highest transaction value compared to the rest of the neighborhoods by a considerable margin. Looking at it as well we can tell that there apears to be a seasonal relationship in august.```{r}X_P %>%ggplot(aes(x = finished_sqft, y = value)) +geom_point(alpha =0.72, color ="blue3") +labs(title ="Relationship Between Home Size and Value",x ="Finished Square Feet",y ="Home Value ($)")``````{r}X_P %>%filter(!is.na(yr_blt)) %>%mutate(age =year(sale_date) - yr_blt) %>%ggplot(aes(x = age, y = value)) +geom_point(alpha =0.75, color ="blue2") +geom_smooth(method ="lm", color ="red", se =FALSE) +#Gets the trend linelabs(title ="Relationship Between Home Age and Value",x ="Age of Home (Years)",y ="Home Value ($)")```## Gifted PropertyIf you were gifted your choice of a property with any factors you want, you would want a specific combination of factors in order to maxamise profit when selling the house. You would want a household with a large amount of square footage located in hyde park as these help maxamise the value of the household as these relationships are linear. You would also want to sell the house in august as this is the most profitable time to sell houses in hyde park. You will also want to sell a newer house as they do sell for a bit more statistically but it dosn't seem to be as big of a factor as others. Those are the factors you would want if you were to obtain a property of your choice as a gift and if you intended to sell it for profit.\## Self - Directed Analysis```{r}X_P %>%filter(!is.na(purchaser)) %>%group_by(purchaser)%>%summarize(t_value =sum(value, na.rm =TRUE)) %>%filter(t_value >=2000000) %>%ggplot(aes(x = purchaser, y = t_value)) +geom_bar(stat ="identity", fill ="blue3", color ="black", alpha =0.7) +labs(title ="Total value of properties owned by purchaser",x ="Purchaser (of more than 3 million total value)",y ="Total Value") +theme(axis.text.x =element_text(angle =45, hjust =1))``````{r}X_P %>%filter(!is.na(purchaser)) %>%group_by(purchaser)%>%summarize(t_value =sum(value, na.rm =TRUE), P_C =n()) %>%filter(t_value >=2000000) %>%ggplot(aes(x = purchaser, y = P_C)) +geom_bar(stat ="identity", fill ="blue3", color ="black", alpha =0.7) +labs(title ="Total count of properties owned by purchaser",x ="Purchaser (of more than 3 million total value)",y ="Total Count") +theme(axis.text.x =element_text(angle =45, hjust =1))```Looking at this you can clearly see that there are a couple corporations that have acceded 32million dollars worth of value, however looking at the count of properties, it appears that only 3 organizations actually own a great amount of properties, but at most this is around 15 for the highest corporation. These three corporations are Bryan Carlier LLC, Denrick Properties LLC, and VB One LLC. Looking at these graphs I would have to say that tis is in fact a problem but not nearly as big as some people would be making out.