library(pastecs)
## Loading required package: boot
stat.desc(du_lich)
## visit hotel rom bed_room
## nbr.val 1.200000e+01 1.200000e+01 1.200000e+01 1.200000e+01
## nbr.null 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
## nbr.na 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
## min 1.019000e+03 6.010000e+02 1.382000e+04 2.152700e+04
## max 2.903000e+03 7.950000e+02 2.581200e+04 4.024100e+04
## range 1.884000e+03 1.940000e+02 1.199200e+04 1.871400e+04
## sum 1.899000e+04 8.282000e+03 2.363070e+05 3.740150e+05
## median 1.270000e+03 6.940000e+02 2.004800e+04 3.221650e+04
## mean 1.582500e+03 6.901667e+02 1.969225e+04 3.116792e+04
## SE.mean 1.689880e+02 1.876927e+01 1.497621e+03 2.174234e+03
## CI.mean.0.95 3.719400e+02 4.131088e+01 3.296241e+03 4.785457e+03
## var 3.426832e+05 4.227424e+03 2.691442e+07 5.672752e+07
## std.dev 5.853915e+02 6.501865e+01 5.187911e+03 7.531767e+03
## coef.var 3.699156e-01 9.420717e-02 2.634494e-01 2.416513e-01
## labour rate PGDP Visa Relics
## nbr.val 1.200000e+01 12.0000000 12.0000000 12.0000000 12.0000000
## nbr.null 0.000000e+00 0.0000000 0.0000000 0.0000000 0.0000000
## nbr.na 0.000000e+00 0.0000000 0.0000000 0.0000000 0.0000000
## min 3.433000e+03 0.5000000 15.6000000 3.0000000 50.0000000
## max 1.244000e+04 6.7000000 79.7000000 9.0000000 108.0000000
## range 9.007000e+03 6.2000000 64.1000000 6.0000000 58.0000000
## sum 9.542700e+04 20.5000000 566.4000000 83.0000000 839.0000000
## median 8.394000e+03 1.0500000 50.4000000 7.0000000 66.0000000
## mean 7.952250e+03 1.7083333 47.2000000 6.9166667 69.9166667
## SE.mean 1.049396e+03 0.4881099 6.3354582 0.5429763 4.7249472
## CI.mean.0.95 2.309706e+03 1.0743226 13.9442494 1.1950827 10.3995387
## var 1.321480e+07 2.8590152 481.6563636 3.5378788 267.9015152
## std.dev 3.635216e+03 1.6908623 21.9466709 1.8809250 16.3676973
## coef.var 4.571305e-01 0.9897730 0.4649718 0.2719410 0.2341029
You can also embed plots, for example:
##
## Call:
## lm(formula = visit ~ hotel + rom + labour + rate + PGDP + Visa +
## Relics, data = du_lich)
##
## Residuals:
## 1 2 3 4 5 6
## 102.87584 -33.67153 -92.97712 0.51545 161.21062 -171.62003
## 7 8 9 10 11 12
## -29.11785 -69.63464 36.48238 -0.03203 29.42516 66.54374
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -647.54358 982.01566 -0.659 0.5457
## hotel -0.51913 2.26217 -0.229 0.8298
## rom 0.03810 0.10812 0.352 0.7423
## labour -0.02288 0.16717 -0.137 0.8977
## rate -54.47907 38.91388 -1.400 0.2341
## PGDP 0.37524 27.79130 0.014 0.9899
## Visa -8.32004 87.82764 -0.095 0.9291
## Relics 30.79307 12.68551 2.427 0.0722 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 148.4 on 4 degrees of freedom
## Multiple R-squared: 0.9766, Adjusted R-squared: 0.9357
## F-statistic: 23.87 on 7 and 4 DF, p-value: 0.004139
## 2.5 % 97.5 %
## (Intercept) -3374.0561403 2078.9689889
## hotel -6.7999294 5.7616731
## rom -0.2620810 0.3382796
## labour -0.4870348 0.4412672
## rate -162.5213240 53.5631747
## PGDP -76.7857730 77.5362629
## Visa -252.1686758 235.5285877
## Relics -4.4275570 66.0136975
## (Intercept) hotel rom labour
## (Intercept) 964354.75093 -618.9265536 -18.40907121 47.44845383
## hotel -618.92655 5.1174301 -0.20842287 0.12979331
## rom -18.40907 -0.2084229 0.01168924 -0.01231720
## labour 47.44845 0.1297933 -0.01231720 0.02794734
## rate -18808.12976 55.6474583 -1.79742087 0.70636707
## PGDP 4190.68025 32.0764823 -1.11755460 -1.72023256
## Visa -47688.91572 -12.9359705 1.23617309 2.50398592
## Relics -5520.62167 -19.4572671 1.10541148 -0.77305155
## rate PGDP Visa Relics
## (Intercept) -1.880813e+04 4190.680250 -47688.915721 -5520.6216690
## hotel 5.564746e+01 32.076482 -12.935971 -19.4572671
## rom -1.797421e+00 -1.117555 1.236173 1.1054115
## labour 7.063671e-01 -1.720233 2.503986 -0.7730515
## rate 1.514290e+03 241.998099 282.574627 -82.7203946
## PGDP 2.419981e+02 772.356338 -1594.864831 -235.7005873
## Visa 2.825746e+02 -1594.864831 7713.695017 483.4808729
## Relics -8.272039e+01 -235.700587 483.480873 160.9222108
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.
hoiquy1 <- lm(data= du_lich,visit~rom+labour+ rate+Visa+Relics)
summary(hoiquy1)
##
## Call:
## lm(formula = visit ~ rom + labour + rate + Visa + Relics, data = du_lich)
##
## Residuals:
## Min 1Q Median 3Q Max
## -159.83 -41.78 -12.78 47.13 162.22
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.616e+02 7.258e+02 -1.049 0.33445
## rom 1.576e-02 4.617e-02 0.341 0.74453
## labour 6.379e-03 9.547e-02 0.067 0.94890
## rate -4.816e+01 2.458e+01 -1.959 0.09778 .
## Visa -1.598e-02 4.993e+01 0.000 0.99975
## Relics 2.954e+01 6.609e+00 4.470 0.00424 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 122.3 on 6 degrees of freedom
## Multiple R-squared: 0.9762, Adjusted R-squared: 0.9563
## F-statistic: 49.18 on 5 and 6 DF, p-value: 8.634e-05
hoiquy2 <- lm(data= du_lich,visit~rom+labour+rate+Relics)
summary(hoiquy2)
##
## Call:
## lm(formula = visit ~ rom + labour + rate + Relics, data = du_lich)
##
## Residuals:
## Min 1Q Median 3Q Max
## -159.83 -41.79 -12.78 47.13 162.20
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7.617e+02 5.730e+02 -1.329 0.22540
## rom 1.576e-02 3.994e-02 0.395 0.70484
## labour 6.362e-03 7.363e-02 0.086 0.93357
## rate -4.815e+01 2.269e+01 -2.123 0.07143 .
## Relics 2.954e+01 5.885e+00 5.020 0.00153 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 113.3 on 7 degrees of freedom
## Multiple R-squared: 0.9762, Adjusted R-squared: 0.9626
## F-statistic: 71.71 on 4 and 7 DF, p-value: 9.214e-06
library(lmtest)
## Warning: package 'lmtest' was built under R version 3.4.1
## Loading required package: zoo
## Warning: package 'zoo' was built under R version 3.4.1
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
hoiquy3 <- lm(data= du_lich,visit~rom+rate+Relics)
summary(hoiquy3)
##
## Call:
## lm(formula = visit ~ rom + rate + Relics, data = du_lich)
##
## Residuals:
## Min 1Q Median 3Q Max
## -154.79 -44.26 -9.83 45.82 164.85
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.092e+02 1.527e+02 -5.299 0.00073 ***
## rom 1.912e-02 8.641e-03 2.213 0.05785 .
## rate -4.745e+01 1.981e+01 -2.395 0.04353 *
## Relics 2.998e+01 2.768e+00 10.831 4.66e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 106 on 8 degrees of freedom
## Multiple R-squared: 0.9762, Adjusted R-squared: 0.9672
## F-statistic: 109.2 on 3 and 8 DF, p-value: 7.882e-07
confint(hoiquy3)
## 2.5 % 97.5 %
## (Intercept) -1.161335e+03 -457.00931779
## rom -8.070820e-04 0.03904491
## rate -9.314369e+01 -1.75825539
## Relics 2.359857e+01 36.36538622
vcov(hoiquy3)
## (Intercept) rom rate Relics
## (Intercept) 23322.0584846 -2.264857e-01 -927.30828405 -233.72879643
## rom -0.2264857 7.466548e-05 -0.04368403 -0.01672303
## rate -927.3082841 -4.368403e-02 392.62121662 15.97354822
## Relics -233.7287964 -1.672303e-02 15.97354822 7.66276196
dwtest(hoiquy3) ## Durbin-Watson test
##
## Durbin-Watson test
##
## data: hoiquy3
## DW = 2.242, p-value = 0.3913
## alternative hypothesis: true autocorrelation is greater than 0