回歸分析作業 1044794 毛勝煒


d<-c(155.5,195.0,197.0,207.0,214.9,230.0,239.5,242.0,252.5,255.0,259.9,259.9,269.9,270.0,274.9,283.0,285.0,285.0,299.0,299.9,
319.0,319.9,324.5,330.0,336.0,339.0,340.0,355.0,359.9,359.9)
stem(d)
hist(x=d,main="",xlab="房價",ylab="數量")
# Summary statistics for the 30 sample prices
d<-c(155.5,195.0,197.0,207.0,214.9,230.0,239.5,242.0,252.5,255.0,259.9,259.9,269.9,270.0,274.9,283.0,285.0,285.0,299.0,299.9,
319.0,319.9,324.5,330.0,336.0,339.0,340.0,355.0,359.9,359.9)
平均數
result.mean <- mean(d)
print(result.mean)

總和

中位數
median.result <- median(d)
print(median.result)

眾數

變異數與標準差

# Simulate 500 and 1000 data form normal distribution.
500:
rnorm(500, mean = 10, sd = 1)

1000:
rnorm(1000, mean = 10, sd = 1)

500的正態分佈直方圖

1000的正態分佈直方圖

smooth curve
x = seq(-5, 5, 0.1)
plot(x = x, y = dnorm(x), type="l", bty="n")
