Dashboard Analisis Harga Rumah

Memuat Data Rumah

library(readxl)
## Warning: package 'readxl' was built under R version 4.5.2
library(ggplot2)
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.5.2
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(scales)

DATA_RUMAH <- read_excel("DATA RUMAH.xlsx")
head(DATA_RUMAH)
## # A tibble: 6 × 8
##      NO `NAMA RUMAH`                         HARGA    LB    LT    KT    KM   GRS
##   <dbl> <chr>                                <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1     1 Rumah Murah Hook Tebet Timur, Tebe… 3.8 e9   220   220     3     3     0
## 2     2 Rumah Modern di Tebet dekat Stasiu… 4.6 e9   180   137     4     3     2
## 3     3 Rumah Mewah 2 Lantai Hanya 3 Menit… 3   e9   267   250     4     4     4
## 4     4 Rumah Baru Tebet, Tebet, Jakarta S… 4.30e8    40    25     2     2     0
## 5     5 Rumah Bagus Tebet komp Gudang Pelu… 9   e9   400   355     6     5     3
## 6     6 Rumah Mewah Modern Murah 3 lantai … 4.97e9   300   154     5     3     3

Klik untuk mengunduh dataset:

⬇ Download Data Rumah

Diagram Batang Harga Rumah

ggplot(DATA_RUMAH, aes(x = factor(NO), y = HARGA)) +
  geom_col(fill = "#4c7cf3") +
  labs(
    title = "Diagram Batang Harga Rumah",
    x = "Nomor Rumah",
    y = "Harga (Rp)"
  ) +
  theme_minimal(base_size = 14)
plot of chunk unnamed-chunk-2
Grafik batang ini memperlihatkan perbedaan harga antar nomor rumah.

Grafik Garis Harga Rumah

ggplot(DATA_RUMAH, aes(x = NO, y = HARGA)) +
  geom_line(color="orange", size=1.2) +
  geom_point(color="black", size=3) +
  labs(
    title = "Grafik Garis Harga Rumah",
    x = "Nomor Rumah",
    y = "Harga (Rp)"
  ) +
  theme_minimal(base_size = 14)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
plot of chunk unnamed-chunk-3

Pola kenaikan & penurunan harga rumah tiap nomor.

Pie Chart Proporsi Harga Rumah

ggplot(DATA_RUMAH, aes(x="", y=HARGA, fill=factor(NO))) +
  geom_bar(stat="identity", width=1) +
  coord_polar("y") +
  labs(title="Proporsi Harga Rumah", fill="No Rumah") +
  theme_void()
plot of chunk unnamed-chunk-4

~ Tabel Lengkap Data Rumah

DATA_RUMAH
## # A tibble: 1,010 × 8
##       NO `NAMA RUMAH`                        HARGA    LB    LT    KT    KM   GRS
##    <dbl> <chr>                               <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
##  1     1 Rumah Murah Hook Tebet Timur, Te… 3.8 e 9   220   220     3     3     0
##  2     2 Rumah Modern di Tebet dekat Stas… 4.6 e 9   180   137     4     3     2
##  3     3 Rumah Mewah 2 Lantai Hanya 3 Men… 3   e 9   267   250     4     4     4
##  4     4 Rumah Baru Tebet, Tebet, Jakarta… 4.30e 8    40    25     2     2     0
##  5     5 Rumah Bagus Tebet komp Gudang Pe… 9   e 9   400   355     6     5     3
##  6     6 Rumah Mewah Modern Murah 3 lanta… 4.97e 9   300   154     5     3     3
##  7     7 Rumah lama di Tebet, dekat MT Ha… 2.6 e 9   120   150     3     2     1
##  8     8 RUMAH BAGUS KEREN JALAN LEBAR DI… 1.05e10   350   247     4     4     0
##  9     9 Minimalis Baru Jalan 1 Mobil Aks… 3.25e 9   125    90     3     3     0
## 10    10 Minimalis Baru Jalan 2 Mobil Teb… 4.50e 9   250    96     5     4     1
## # ℹ 1,000 more rows

Analisis Statistik Lengkap

statistik <- DATA_RUMAH %>% summarise(
    Rata_rata = mean(HARGA),
    Median = median(HARGA),
    Maksimum = max(HARGA),
    Minimum = min(HARGA),
    Q1 = quantile(HARGA, 0.25),
    Q3 = quantile(HARGA, 0.75),
    Range = max(HARGA) - min(HARGA)
)
statistik
## # A tibble: 1 × 7
##     Rata_rata     Median    Maksimum   Minimum         Q1         Q3       Range
##         <dbl>      <dbl>       <dbl>     <dbl>      <dbl>      <dbl>       <dbl>
## 1 7628987019. 5000000000 65000000000 430000000 3262500000 9000000000 64570000000

~ Regresi Linear Harga Rumah

model <- lm(HARGA ~ NO, data=DATA_RUMAH)
summary(model)
## 
## Call:
## lm(formula = HARGA ~ NO, data = DATA_RUMAH)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -7.126e+09 -4.344e+09 -2.666e+09  1.287e+09  5.741e+10 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 7.531e+09  4.625e+08  16.281   <2e-16 ***
## NO          1.947e+05  7.926e+05   0.246    0.806    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.344e+09 on 1008 degrees of freedom
## Multiple R-squared:  5.989e-05,  Adjusted R-squared:  -0.0009321 
## F-statistic: 0.06037 on 1 and 1008 DF,  p-value: 0.806
ggplot(DATA_RUMAH, aes(NO, HARGA)) +
  geom_point(color="blue", size=3) +
  geom_smooth(method="lm", color="red") +
  labs(
    title="Regresi Linear Harga Rumah",
    x="Nomor Rumah",
    y="Harga (Rp)"
  ) +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
plot of chunk unnamed-chunk-8

Harga Rumah dari Tertinggi → Terendah

DATA_RUMAH_SORT <- DATA_RUMAH %>% arrange(desc(HARGA))

ggplot(DATA_RUMAH_SORT, aes(x=reorder(NO, HARGA), y=HARGA)) +
  geom_col(fill="purple") +
  coord_flip() +
  labs(
    title="Harga Rumah Tertinggi ke Terendah",
    x="Nomor Rumah",
    y="Harga"
  ) +
  theme_minimal()
plot of chunk unnamed-chunk-9

🌫 Density Plot Harga Rumah

ggplot(DATA_RUMAH, aes(HARGA)) +
  geom_density(fill="lightgreen", alpha=0.6) +
  labs(
    title="Density Plot Harga Rumah",
    x="Harga",
    y="Kepadatan"
  ) +
  theme_minimal()
plot of chunk unnamed-chunk-10

~Kategori Harga Rumah

DATA_RUMAH$Kategori <- cut(
  DATA_RUMAH$HARGA,
  breaks = 3,
  labels = c("Murah", "Sedang", "Mahal")
)
table(DATA_RUMAH$Kategori)
## 
##  Murah Sedang  Mahal 
##    936     71      3

~ Ringkasan Statistik Lanjutan

summary(DATA_RUMAH$HARGA)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## 4.300e+08 3.262e+09 5.000e+09 7.629e+09 9.000e+09 6.500e+10