5.2 Quantitative Variables
The main quantitative variables considered in the descriptive
analysis are:
quantitative_vars <- c(
"sales",
"volume",
"median_price",
"listings",
"months_inventory"
)
For each variable, measures of position, variability, skewness, and
kurtosis will be considered.
5.2.1 Sales
mean(real_estate$sales)
## [1] 192.2917
median(real_estate$sales)
## [1] 175.5
quantile(
real_estate$sales,
probs = c(0.25, 0.75)
)
## 25% 75%
## 127 247
min(real_estate$sales)
## [1] 79
max(real_estate$sales)
## [1] 423
sales_range <- max(real_estate$sales) -
min(real_estate$sales)
sales_range
## [1] 344
IQR(real_estate$sales)
## [1] 120
var(real_estate$sales)
## [1] 6344.3
sd(real_estate$sales)
## [1] 79.65111
cv(real_estate$sales)
## [1] 41.42203
skewness(real_estate$sales)
## [1] 0.718104
# Excess kurtosis
kurtosis(real_estate$sales) - 3
## [1] -0.3131764
The number of sales ranges from 79 to 423, with a mean of
approximately 192.29 and a median of 175.5. The mean is higher than the
median, which is consistent with the positive skewness observed in the
distribution.
The central 50% of the observations lies between 127 and 247 sales,
resulting in an interquartile range of 120. The standard deviation is
approximately 79.65 sales, while the coefficient of variation is
approximately 41.42%, indicating substantial variability relative to the
average level of sales.
The skewness coefficient is approximately 0.72, suggesting a
moderately right-skewed distribution. This indicates that some
relatively high sales observations extend the upper tail and pull the
mean above the median.
The excess kurtosis is approximately -0.31. The distribution can
therefore be described as mildly platykurtic relative to a normal
distribution, suggesting slightly lighter tails and a less pronounced
tendency toward extreme observations.
5.2.2 Volume
mean(real_estate$volume)
## [1] 31.00519
median(real_estate$volume)
## [1] 27.0625
quantile(
real_estate$volume,
probs = c(0.25, 0.75)
)
## 25% 75%
## 17.6595 40.8930
min(real_estate$volume)
## [1] 8.166
max(real_estate$volume)
## [1] 83.547
volume_range <- max(real_estate$volume) -
min(real_estate$volume)
volume_range
## [1] 75.381
IQR(real_estate$volume)
## [1] 23.2335
var(real_estate$volume)
## [1] 277.2707
sd(real_estate$volume)
## [1] 16.65145
cv(real_estate$volume)
## [1] 53.70536
skewness(real_estate$volume)
## [1] 0.884742
# Excess kurtosis
kurtosis(real_estate$volume) - 3
## [1] 0.176987
The total sales volume ranges from USD 8.17 million to USD 83.55
million, with a mean of approximately USD 31.01 million and a median of
USD 27.06 million. The mean is higher than the median, which is
consistent with the positive skewness observed in the distribution.
The central 50% of observations lies between USD 17.66 million and
USD 40.89 million, resulting in an interquartile range of approximately
USD 23.23 million. The standard deviation is approximately USD 16.65
million, while the coefficient of variation is approximately 53.70%,
indicating substantial variability relative to the average sales
volume.
The skewness coefficient is approximately 0.88, suggesting a
moderately right-skewed distribution. Some observations with relatively
high sales volumes extend the upper tail and pull the mean above the
median.
The excess kurtosis is approximately 0.18, which is close to zero.
Therefore, the distribution can be considered approximately mesokurtic,
with only a very slight tendency toward heavier tails than a normal
distribution.
5.2.3 Median Price
mean(real_estate$median_price)
## [1] 132665.4
median(real_estate$median_price)
## [1] 134500
quantile(
real_estate$median_price,
probs = c(0.25, 0.75)
)
## 25% 75%
## 117300 150050
min(real_estate$median_price)
## [1] 73800
max(real_estate$median_price)
## [1] 180000
median_price_range <- max(real_estate$median_price) -
min(real_estate$median_price)
median_price_range
## [1] 106200
IQR(real_estate$median_price)
## [1] 32750
var(real_estate$median_price)
## [1] 513572983
sd(real_estate$median_price)
## [1] 22662.15
cv(real_estate$median_price)
## [1] 17.08218
skewness(real_estate$median_price)
## [1] -0.3645529
# Excess kurtosis
kurtosis(real_estate$median_price) - 3
## [1] -0.6229618
The median sale price ranges from USD 73,800 to USD 180,000, with a
mean of approximately USD 132,665 and a median of USD 134,500. The mean
is slightly lower than the median, which is consistent with the negative
skewness observed in the distribution.
The central 50% of observations lies between USD 117,300 and USD
150,050, resulting in an interquartile range of USD 32,750. The standard
deviation is approximately USD 22,662, while the coefficient of
variation is approximately 17.08%. Compared with sales and total sales
volume, median price therefore shows substantially lower relative
variability.
The skewness coefficient is approximately -0.36, indicating a mildly
left-skewed distribution. Some relatively low median-price observations
extend the lower tail and contribute to pulling the mean slightly below
the median.
The excess kurtosis is approximately -0.62, suggesting a mildly
platykurtic distribution, with somewhat lighter tails than a normal
distribution.
5.2.4 Listings
mean(real_estate$listings)
## [1] 1738.021
median(real_estate$listings)
## [1] 1618.5
quantile(
real_estate$listings,
probs = c(0.25, 0.75)
)
## 25% 75%
## 1026.5 2056.0
min(real_estate$listings)
## [1] 743
max(real_estate$listings)
## [1] 3296
listings_range <- max(real_estate$listings) -
min(real_estate$listings)
listings_range
## [1] 2553
IQR(real_estate$listings)
## [1] 1029.5
var(real_estate$listings)
## [1] 566569
sd(real_estate$listings)
## [1] 752.7078
cv(real_estate$listings)
## [1] 43.30833
skewness(real_estate$listings)
## [1] 0.6494982
# Excess kurtosis
kurtosis(real_estate$listings) - 3
## [1] -0.79179
The total number of active listings ranges from 743 to 3296, with a
mean of approximately 1738.02 and a median of 1618.5. The mean is higher
than the median, which is consistent with the positive skewness observed
in the distribution.
The central 50% of observations lies between 1026.5 and 2056.0,
resulting in an interquartile range of 1029.5. The standard deviation is
approximately 752.71 listings, while the coefficient of variation is
approximately 43.31%, indicating substantial relative variability in the
number of active listings.
The skewness coefficient is approximately 0.65, suggesting a
moderately right-skewed distribution. Some observations with relatively
high numbers of listings extend the upper tail and pull the mean above
the median.
The excess kurtosis is approximately -0.79, indicating a platykurtic
distribution with lighter tails than a normal distribution.
5.2.5 Months Inventory
mean(real_estate$months_inventory)
## [1] 9.1925
median(real_estate$months_inventory)
## [1] 8.95
quantile(
real_estate$months_inventory,
probs = c(0.25, 0.75)
)
## 25% 75%
## 7.80 10.95
min(real_estate$months_inventory)
## [1] 3.4
max(real_estate$months_inventory)
## [1] 14.9
months_inventory_range <- max(real_estate$months_inventory) -
min(real_estate$months_inventory)
months_inventory_range
## [1] 11.5
IQR(real_estate$months_inventory)
## [1] 3.15
var(real_estate$months_inventory)
## [1] 5.306889
sd(real_estate$months_inventory)
## [1] 2.303669
cv(real_estate$months_inventory)
## [1] 25.06031
skewness(real_estate$months_inventory)
## [1] 0.04097527
# Excess kurtosis
kurtosis(real_estate$months_inventory) - 3
## [1] -0.1744475
The months inventory ranges from 3.4 to 14.9 months, with a mean of
approximately 9.19 months and a median of 8.95 months. The mean and
median are very close, which is consistent with the near-zero skewness
observed in the distribution.
The central 50% of observations lies between 7.80 and 10.95 months,
resulting in an interquartile range of 3.15 months. The standard
deviation is approximately 2.30 months, while the coefficient of
variation is approximately 25.06%, indicating moderate relative
dispersion around the average inventory level.
The skewness coefficient is approximately 0.04, suggesting an
approximately symmetric distribution, with no relevant evidence of
asymmetry.
The excess kurtosis is approximately -0.17, which is close to zero.
Therefore, the distribution can be considered approximately mesokurtic,
with only a very slight tendency toward lighter tails than a normal
distribution.
5.4 Overall Comparison of Quantitative Variables
To provide an overall comparison of the quantitative variables, the
main measures of position, variability, and distribution shape are
summarized in the following table. This allows the statistical
characteristics of sales, volume,
median_price, listings, and
months_inventory to be compared directly.
descriptive_stats <- t(
sapply(
real_estate[quantitative_vars],
summary_stats_quant_var
)
)
knitr::kable(
descriptive_stats,
digits = 2,
format.args = list(
scientific = FALSE,
big.mark = ","
),
caption = "Descriptive Statistics for Quantitative Variables"
)
Descriptive Statistics for Quantitative Variables
|
Mean |
Median |
Q1 |
Q3 |
Min |
Max |
Range |
Variance |
SD |
IQR |
CV |
Skewness |
Excess_Kurtosis |
| sales |
192.29 |
175.50 |
127.00 |
247.00 |
79.00 |
423.00 |
344.00 |
6,344.30 |
79.65 |
120.00 |
41.42 |
0.72 |
-0.31 |
| volume |
31.01 |
27.06 |
17.66 |
40.89 |
8.17 |
83.55 |
75.38 |
277.27 |
16.65 |
23.23 |
53.71 |
0.88 |
0.18 |
| median_price |
132,665.42 |
134,500.00 |
117,300.00 |
150,050.00 |
73,800.00 |
180,000.00 |
106,200.00 |
513,572,983.09 |
22,662.15 |
32,750.00 |
17.08 |
-0.36 |
-0.62 |
| listings |
1,738.02 |
1,618.50 |
1,026.50 |
2,056.00 |
743.00 |
3,296.00 |
2,553.00 |
566,568.97 |
752.71 |
1,029.50 |
43.31 |
0.65 |
-0.79 |
| months_inventory |
9.19 |
8.95 |
7.80 |
10.95 |
3.40 |
14.90 |
11.50 |
5.31 |
2.30 |
3.15 |
25.06 |
0.04 |
-0.17 |
The descriptive statistics reveal relevant differences in the
behavior of the quantitative variables. In terms of relative
variability, volume shows the highest
coefficient of variation (53.71%), followed by
listings (43.31%) and sales (41.42%), while
median_price is comparatively more stable, with the
lowest coefficient of variation (17.08%).
Regarding distribution shape, sales,
volume, and listings show moderate
positive skewness, indicating a tendency toward relatively high
values in the right tail. Conversely, median_price presents
mild negative skewness, while
months_inventory is approximately
symmetric. The relationship between mean and
median is consistent with these skewness patterns.
In terms of kurtosis, sales, median_price,
and listings show negative excess
kurtosis, indicating somewhat lighter tails than a
normal distribution. volume and
months_inventory have excess kurtosis values close to zero,
suggesting distributions that are approximately
mesokurtic.