diff --git a/projekt.rmd b/projekt.rmd index 8cf3858..309b61d 100644 --- a/projekt.rmd +++ b/projekt.rmd @@ -1,5 +1,5 @@ --- -title: "Projekt Zaliczeniowy 1" +title: "Statystyczna analiza cen kupna oraz najmu mieszkań w 15 największych miastach w Polsce" author: "Michał Hiszpański, Nikola Kubiczek, Adrian Mirecki" date: "2026-04-29" output: @@ -19,21 +19,22 @@ fig.width = 8 fig.height = 5 ``` -# Import data +# O danych -The dataset contains apartment sales and df offers from the 15 largest cities in Poland (Warsaw, Lodz, Krakow, Wroclaw, Poznan, Gdansk, Szczecin, Bydgoszcz, Lublin, Katowice, Bialystok, Czestochowa). The data comes from local websites with apartments for sale. To fully capture the neighborhood of each apartment better, each offer was extended by data from the Open Street Map with distances to points of interest (POI). The data is collected monthly and covers a timespan between August 2023 and June 2024 +Zestaw danych zawiera oferty sprzedaży (na przestrzeni dwunastu miesięcy) oraz oferty wynajmu (na przestrzeni ośmiu miesięcy) mieszkań z 15 największych miast w Polsce (Warszawa, Łódź, Kraków, Wrocław, Poznań, Gdańsk, Szczecin, Bydgoszcz, Lublin, Katowice, Białystok, Częstochowa). Dane pochodzą z lokalnych stron internetowych z ogłoszeniami o sprzedaży mieszkań. Aby jeszcze lepiej uchwycić cechy otoczenia każdego mieszkania, każda oferta została uzupełniona o dane z OpenStreetMap, zawierające odległości do punktów zainteresowania (POI – Points of Interest). + +Dane są zbierane miesięcznie i obejmują okres od sierpnia 2023 roku do czerwca 2024 roku. ## Files - apartments_pl_YYYY_MM.csv: sale price - apartments_df_pl_YYYY_MM.csv: monthly df -## Data Fields -1. ```city``` - the name of the city where the property is located -1. ```type``` - type of the building -1. ```squareMeters``` - the size of the apartment in square meters -1. ```rooms``` - number of rooms in the apartment -1. ```floor``` / floorCount - the floor where the apartment is located and the total number of floors in the building +## Parametry danych +1. ```city``` - nazwa miasta, w którym znajduje się mieszkanie +1. ```squareMeters``` - powierzchnia mieszkania w metrach kwadratowych +1. ```rooms``` - liczba pomieszczeń w mieszkaniu +1. ```floor``` floorCount - the floor where the apartment is located and the total number of floors in the building 1. ```buildYear``` - the year when the building was built 1. ```latitude```, ```longitude``` - geo coordinate of the property 1. ```centreDistance``` - distance from the city centre in km @@ -101,34 +102,43 @@ apartments_warsaw <- apartments[apartments$city == "warszawa",] # Wykresy -```{r heatmaps} +```{r violin rent} ggplot(rent, aes(x = city, y = price_m2)) + - geom_violin(fill = "lightgray", alpha = 0.3) + + geom_violin(fill = "blue", alpha = 0.3) + geom_boxplot(width = 0.1, outlier.alpha = 0.01) + theme_minimal() + theme(axis.text.x = element_text(angle = 45, hjust = 1)) + - labs(title = "Rozkład ceny wynajmu za m² w miastach", + labs(title = "Zależność ceny za m² od miasta (wynajem)", x = "Miasto", y = "Cena za m² (PLN)") +``` + +```{r viloin apart} ggplot(apartments, aes(x = city, y = price_m2)) + geom_violin(fill = "lightgray", alpha = 0.3) + geom_boxplot(width = 0.1, outlier.alpha = 0.01) + theme_minimal() + theme(axis.text.x = element_text(angle = 45, hjust = 1)) + - labs(title = "Rozkład ceny kupna mieszkania za m² w miastach", + labs(title = "Zależność ceny za m² w od miasta (kupno)", x = "Miasto", y = "Cena za m² (PLN)") -ggplot(rent, aes(x=centreDistance, y=price_m2, col = buildYear)) + - geom_point(alpha=0.1, size=0.5) + - geom_smooth(method = "lm", se = TRUE, color = "red") + +``` + +```{r prosta regresja ceny od odległości od centrum} + +ggplot(rent, aes(x=centreDistance, y=price_m2)) + + geom_point(color = "blue",alpha=0.03, size=0.3) + + geom_smooth(method = "lm", se = TRUE, color = "orange") + facet_wrap(~ city) + theme_minimal() + labs( title = "Cena za m² vs odległość od centrum (wynajem)", x = "Odległość od centrum (km)", y = "Cena za m² (PLN)") + +``` ggplot(apartments, aes(x=centreDistance, y=price_m2, col = buildYear)) + geom_point(alpha=0.1, size=0.5) +