Hprice

Psalms Kinyele

2024-10-28

#Analysis of Hprice

#importing necessary packages

library(datasets)

#faraway package used

library(faraway)

#viewing our dataset

View(hprice)

#What does it entail?

str(hprice)
## 'data.frame':    324 obs. of  8 variables:
##  $ narsp  : num  4.22 4.27 4.33 4.36 4.39 ...
##  $ ypc    : int  13585 14296 15413 16490 17634 18210 17958 18659 19360 15354 ...
##  $ perypc : num  6.47 5.23 7.81 6.99 6.94 ...
##  $ regtest: int  20 20 20 20 20 20 20 20 20 18 ...
##  $ rcdum  : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
##  $ ajwtr  : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
##  $ msa    : Factor w/ 36 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 2 ...
##  $ time   : int  1 2 3 4 5 6 7 8 9 1 ...
summary(hprice)
##      narsp            ypc            perypc          regtest      rcdum  
##  Min.   :3.920   Min.   :12535   Min.   :-2.054   Min.   :13.00   0:279  
##  1st Qu.:4.264   1st Qu.:16609   1st Qu.: 3.535   1st Qu.:18.00   1: 45  
##  Median :4.412   Median :18454   Median : 3.964   Median :20.00          
##  Mean   :4.484   Mean   :18769   Mean   : 4.268   Mean   :20.42          
##  3rd Qu.:4.575   3rd Qu.:20323   3rd Qu.: 5.711   3rd Qu.:22.00          
##  Max.   :5.563   Max.   :33383   Max.   : 8.788   Max.   :29.00          
##                                                                          
##  ajwtr        msa           time  
##  0:189   1      :  9   Min.   :1  
##  1:135   2      :  9   1st Qu.:3  
##          3      :  9   Median :5  
##          4      :  9   Mean   :5  
##          5      :  9   3rd Qu.:7  
##          6      :  9   Max.   :9  
##          (Other):270

#Frequency tables

table(hprice$narsp)
## 
## 3.919991205 3.958906621 3.974058411 3.979681654 4.025351691  4.02891677 
##           1           1           1           2           1           2 
## 4.030694522 4.037774224 4.043051268  4.04480409 4.058717411 4.067315916 
##           1           1           1           1           1           1 
## 4.077537444 4.092676531 4.107589776 4.112511841 4.120661846 4.123903352 
##           1           1           1           1           1           1 
## 4.131961414 4.135166557 4.136765254 4.139955061 4.143134726 4.151039906 
##           1           1           2           1           1           1 
## 4.152613446 4.155753178 4.157319385 4.162003163 4.163559679 4.165113657 
##           1           1           1           3           1           1 
## 4.166665224 4.172847647  4.17438727 4.180522282 4.182050143 4.183575673 
##           1           2           2           2           3           1 
## 4.185098879 4.188138465 4.191168724 4.200204907  4.20319899 4.215086135 
##           1           1           2           2           1           2 
## 4.220977191 4.223909811 4.226833745 4.229749155 4.231203789   4.2326562 
##           1           4           1           1           1           1 
## 4.237000819  4.23988689 4.244200274 4.245634053 4.247065671 4.249922772 
##           2           3           1           1           2           1 
## 4.251348268 4.254193285  4.25561271 4.257030123  4.25844553 4.265492776 
##           1           1           2           1           2           1 
##  4.26689637 4.268297891  4.26969745 4.271095053 4.273884519 4.275276286 
##           2           1           1           2           1           1 
## 4.280824171 4.283586562 4.284964901 4.286341343 4.287715997 4.291828346 
##           1           3           2           1           1           1 
## 4.301358773 4.304065093 4.305415512 4.310799125 4.312140487 4.314817926 
##           1           2           2           1           1           1 
## 4.317488114  4.32015119  4.32677812 4.328098333 4.333361423 4.334672978 
##           2           1           2           1           2           1 
## 4.337290741 4.338597057 4.339901669 4.343805422 4.346399418 4.352855218 
##           2           1           1           1           1           1 
## 4.355425973 4.357990037 4.361823947 4.363098625 4.366913036 4.370712855 
##           2           3           1           2           1           2 
##  4.37197626 4.373238167 4.375757022 4.377014074 4.378269548 4.379523543 
##           1           2           2           1           1           3 
## 4.382026635 4.384523477 4.387014195 4.388257184 4.389498631 4.390738537 
##           1           1           1           1           1           1 
## 4.391977003 4.393213843 4.395682942  4.40060302 4.401829243 4.403053965 
##           1           2           3           1           1           1 
## 4.404277281 4.410371145 4.411585455 4.412798293 4.416428098 4.417635081 
##           1           1           1           1           1           2 
## 4.420044683 4.421247311 4.424846632 4.426043502 4.427238941 4.430816799 
##           1           1           1           1           1           1 
##  4.43556742 4.439115566 4.440295579 4.441474111 4.445001398  4.44617449 
##           1           2           1           3           2           1 
## 4.448516376 4.449685265 4.454347296 4.455509394 4.456670142 4.457829633 
##           2           1           1           1           1           2 
## 4.458987694 4.461299798 4.463606657  4.46475805 4.465908119 4.467056866 
##           3           1           1           1           1           1 
## 4.468204296 4.471638793  4.47278098 4.480740142 4.483002552  4.48413184 
##           1           1           1           1           1           1 
## 4.485259855  4.48751216  4.48863637 4.489759317 4.492001522 4.494238625 
##           2           1           1           2           1           1 
##  4.49980967 4.500920148 4.507557323 4.508659319 4.509760018 4.510859507 
##           1           1           3           2           1           1 
## 4.511957787 4.514150821 4.515245495 4.519612331 4.523960097 4.536891362 
##           1           1           2           1           1           1 
## 4.540098157 4.541164889 4.545420149 4.546481222  4.54965746 4.551769441 
##           1           1           2           1           1           1 
## 4.553876892 4.566429326  4.56746835 4.569543008 4.574710979  4.57574136 
##           2           2           1           2           2           1 
## 4.581901528 4.584967479 4.587006184 4.590056548 4.593097636 4.607168158 
##           1           1           1           1           1           1 
## 4.620058798 4.628886727 4.636668823 4.643428913 4.645351961 4.651099088 
##           1           1           1           1           1           1 
##  4.65300753 4.662495267 4.663439094 4.671893832 4.672828834 4.688591766 
##           1           1           1           1           1           1 
## 4.691347882  4.70138903 4.703203954 4.713127341 4.715816678 4.718498871 
##           1           1           1           1           1           1 
## 4.721173889 4.730921405 4.751000607 4.760463097 4.761318881 4.762173935 
##           1           1           1           2           1           1 
## 4.770684624 4.774068735 4.774912961 4.783316371 4.823502192 4.861361567 
##           1           1           1           1           1           1 
## 4.862908335 4.875960437 4.882801923 4.911183238 4.917788721 4.918520028 
##           1           1           1           1           1           1 
## 4.925077383 4.955827058 4.965637886 4.991112669 5.033048849 5.078916839 
##           1           1           1           1           1           1 
## 5.113191864 5.150976814 5.154446978 5.156177599 5.164214347 5.168208716 
##           1           1           2           1           1           1 
## 5.174453362 5.178407035 5.186826956 5.203457052 5.210578435 5.212214667 
##           1           1           1           1           2           1 
## 5.213848227 5.233778845 5.234844927 5.287761822 5.360352772 5.360822543 
##           2           1           1           1           1           1 
## 5.362230678 5.369707377 5.388614977 5.522260586 5.540478936 5.545958437 
##           1           1           1           1           1           1 
## 5.554895694 5.557985645 5.562986688 
##           1           1           1

#Frequency tables

table(hprice$ypc)
## 
## 12535 13005 13447 13477 13520 13585 13667 13730 13845 14033 14075 14244 14256 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 14273 14296 14357 14382 14444 14452 14559 14579 14587 14616 14646 14674 14693 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 14726 14855 14871 14900 14946 14969 15011 15065 15087 15097 15238 15252 15277 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 15354 15358 15383 15398 15413 15448 15473 15530 15560 15562 15576 15582 15622 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 15646 15687 15748 15844 15863 15895 15950 15951 15959 15960 15969 15993 16007 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 16018 16054 16144 16224 16265 16267 16276 16302 16333 16409 16455 16490 16563 
##     1     1     1     1     1     1     1     1     1     1     1     2     1 
## 16565 16601 16612 16618 16624 16654 16660 16702 16774 16799 16861 16875 16884 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 16897 16905 16937 16942 16984 17018 17025 17148 17152 17156 17292 17302 17331 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 17345 17352 17402 17416 17440 17472 17493 17541 17562 17583 17603 17609 17624 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 17634 17645 17700 17713 17715 17747 17763 17786 17805 17812 17832 17834 17837 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 17844 17871 17902 17914 17917 17943 17958 17974 17977 17992 18008 18020 18046 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 18063 18072 18150 18156 18161 18210 18234 18252 18264 18294 18295 18301 18331 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 18406 18439 18445 18447 18449 18459 18466 18488 18534 18577 18611 18630 18655 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 18659 18687 18744 18754 18766 18811 18824 18846 18849 18903 18905 18950 18993 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 19026 19103 19112 19117 19126 19132 19159 19191 19193 19235 19239 19253 19273 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 19277 19279 19306 19336 19338 19341 19360 19373 19403 19459 19462 19468 19540 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 19545 19548 19568 19628 19646 19691 19693 19706 19730 19783 19785 19799 19804 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 19824 19827 19828 19833 19844 19856 19963 19976 19980 19995 20020 20059 20161 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 20169 20181 20232 20291 20300 20313 20322 20325 20379 20436 20449 20456 20489 
##     1     1     1     2     1     1     1     1     1     1     1     1     1 
## 20499 20563 20577 20687 20692 20720 20724 20744 20784 20802 20892 20902 20967 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 21056 21082 21130 21138 21146 21238 21272 21326 21381 21441 21466 21471 21491 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 21551 21665 21798 21841 21874 21891 22014 22020 22053 22055 22064 22229 22246 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 22247 22250 22254 22259 22395 22653 22711 22787 22849 22914 22930 23075 23107 
##     1     1     1     1     1     1     1     1     1     1     1     1     1 
## 23509 23531 23653 23765 23794 23806 23920 23967 24519 24908 25110 25294 25583 
##     1     1     1     1     1     1     1     2     1     1     1     1     1 
## 26295 26566 27296 27802 29828 30555 30943 32163 33383 
##     1     1     1     1     1     1     1     1     1

#Frequency tables

table(hprice$perypc)
## 
## -2.054273396 -1.554743331 -1.383855025 -1.203053126 -1.129656412 -1.088490224 
##            1            1            1            1            1            1 
## -0.981193786 -0.466705158 -0.271346667 -0.222601469 -0.176412598 -0.146214665 
##            1            1            1            1            1            1 
##  0.014635931  0.481647567  0.601964904  0.661698126  0.827466399  0.867426204 
##            1            1            1            1            1            1 
##  1.055817555  1.073355527  1.075009641   1.15942029    1.1645438   1.26984127 
##            1            1            1            1            1            1 
##  1.302407258  1.345042241  1.466558409  1.473899693  1.498770359  1.537410318 
##            1            1            1            1            1            1 
##    1.5574047  1.593736117  1.635408852  1.705328434  1.712446845  1.797666858 
##            1            1            1            1            1            1 
##   1.80553998  1.805658057  1.881101239  1.883711669  1.966500886  2.027238223 
##            1            1            1            1            1            1 
##   2.13194561  2.178847027  2.207977208  2.368026472  2.437307228  2.469568702 
##            1            1            1            1            1            1 
##  2.470734487  2.493140316  2.582456913  2.600082542  2.603326473  2.619504908 
##            1            1            1            1            1            1 
##  2.672500841  2.686360489  2.701566278  2.701694554  2.729340409  2.737869341 
##            1            1            1            1            1            1 
##  2.746493838  2.751747732  2.890338828  2.960572471  2.961904293   3.04870568 
##            1            1            1            1            1            1 
##  3.069651483  3.071820017  3.090124498  3.150485979  3.196615348  3.218932257 
##            1            1            1            1            1            1 
##  3.242656185  3.266417149  3.291619714  3.327276145  3.348369188  3.382939552 
##            1            1            1            1            1            1 
##  3.485024496  3.485974886  3.526734926  3.537569749  3.541010685  3.544912684 
##            1            1            1            1            1            1 
##   3.57266736  3.573588944  3.580269275  3.600227682  3.600780768  3.610585179 
##            1            1            1            1            1            1 
##  3.616976793  3.626082897  3.628149597  3.639986393  3.661216832  3.661269184 
##            1            1            1            1            1            1 
##  3.661971831  3.670921457  3.671001231  3.671493042  3.673125527  3.675038172 
##            1            1            1            1            1            1 
##  3.675201716   3.68073413  3.680815309  3.682079292  3.685166102   3.69480785 
##            1            1            1            1            1            1 
##  3.701022969  3.703703704  3.704774015  3.708419545  3.710365384  3.713886707 
##            1            1            1            1            1            1 
##  3.713971858  3.719706932    3.7218159  3.724137931  3.739789391   3.74583162 
##            1            1            1            1            1            1 
##  3.749501396  3.756900155  3.758338305  3.764739996  3.765649925  3.768100339 
##            1            1            1            1            1            1 
##  3.772914233  3.775194625  3.777486383  3.778748952  3.792332533  3.793178497 
##            1            1            1            1            1            1 
##  3.800412516  3.805839219  3.806807378  3.815250068  3.820322721  3.821389311 
##            1            1            1            1            1            1 
##   3.82156279  3.822839265  3.826166701  3.831051682  3.851239669  3.851551536 
##            1            1            1            1            1            1 
##  3.852429297  3.853541417  3.862870803  3.862880532  3.865689756  3.885644021 
##            1            1            1            1            1            1 
##  3.887786908  3.903552734  3.908061204   3.92033543  3.920844327    3.9223782 
##            1            1            1            1            1            1 
##  3.923307104  3.926231902  3.940341279  3.942733413  3.957460267  3.960015379 
##            1            1            1            1            1            1 
##  3.967354341   3.97053315  3.976721629   3.99029715  4.000466527  4.026588265 
##            1            1            1            1            1            1 
##  4.061438488  4.091914475  4.143381315   4.14384915  4.195291136  4.253179533 
##            1            1            1            1            1            1 
##  4.299363057  4.327182475  4.406925168   4.43144375   4.43318952  4.451410658 
##            1            1            1            1            1            1 
##  4.451977401  4.472199839  4.517396184  4.520200288  4.551273845  4.563357327 
##            1            1            1            1            1            1 
##  4.569787178  4.574926085   4.57644899  4.576611864  4.652563427  4.661016949 
##            1            1            1            1            1            1 
##  4.670186659  4.703199601    4.7045258  4.715196525  4.765375343   4.79244403 
##            1            1            1            1            1            1 
##  4.861395603  4.901960784  4.927174911  4.934325744  4.947019437  4.952422145 
##            1            1            1            1            1            1 
##  5.026784602  5.039633481    5.0415278  5.043712172  5.075558476  5.080845395 
##            1            1            1            1            1            1 
##  5.119330882  5.125170149  5.131957656  5.168576833  5.171011979  5.177821487 
##            1            1            1            1            1            1 
##  5.192846369  5.215906587  5.233713655  5.255878285  5.326047796  5.355029586 
##            1            1            1            1            1            1 
##  5.355033469   5.36433303   5.44500477  5.514025609  5.520954976  5.530806086 
##            1            1            1            1            1            1 
##  5.531868372  5.541740675    5.5687974  5.596907276  5.609802795  5.638450502 
##            1            1            1            1            1            1 
##  5.651954784  5.659729377  5.661022747  5.675837719  5.679122183  5.679882526 
##            1            1            1            1            1            1 
##  5.691275168  5.707401033  5.708552449  5.717944855  5.726784649  5.737221107 
##            1            1            1            1            1            1 
##  5.768768046   5.82002796  5.838167939  5.846490542  5.866402116  5.883617216 
##            1            1            1            1            1            1 
##  5.884149445  5.900769074  5.906554431  5.918739419  5.940922668   5.95621378 
##            1            1            1            1            1            1 
##   5.96556706  5.973090131  5.988451694   5.98848638  5.995379501  6.008296534 
##            1            1            1            1            1            1 
##  6.012061817  6.029376925  6.033146536  6.135478516  6.174814815  6.186117977 
##            1            1            1            1            1            1 
##  6.189869836  6.207435525  6.240239017  6.241806264   6.25673572  6.263522285 
##            1            1            1            1            1            1 
##  6.288777784  6.395825568  6.465517241  6.534971226  6.568144499  6.606130782 
##            1            1            1            1            1            1 
##  6.606828382  6.626913383  6.628450579  6.648697215  6.656495905  6.672932331 
##            1            1            1            1            1            1 
##  6.676519728  6.684033729  6.689235785  6.696541277  6.701304836  6.714449541 
##            1            1            1            1            1            1 
##  6.733128034  6.770472168  6.777689341  6.804564164  6.851211073  6.937537902 
##            1            1            1            1            1            1 
##  6.958554347  6.987607863  7.019307062  7.097374258  7.111000991  7.121727968 
##            1            1            1            1            1            1 
##  7.176887988  7.213614427  7.287245522  7.361209849  7.409831773  7.518625946 
##            1            1            1            1            1            1 
##  7.527920314  7.610314288  7.692307692   7.71314178  7.802056555  7.808316485 
##            1            1            1            1            1            1 
##   7.81337437  8.035516093   8.23602066  8.436634974  8.441203282  8.787715781 
##            1            1            1            1            1            1

#Frequency tables

table(hprice$regtest)
## 
## 13 15 16 17 18 19 20 21 22 23 24 25 26 29 
##  9  9  9 27 45 27 54 54 18  9 18  9 27  9

#Frequency tables

table(hprice$rcdum)
## 
##   0   1 
## 279  45

#Frequency tables

table(hprice$ajwtr)
## 
##   0   1 
## 189 135

#Frequency tables

table(hprice$msa)
## 
##  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 
##  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9 
## 27 28 29 30 31 32 33 34 35 36 
##  9  9  9  9  9  9  9  9  9  9

#Frequency tables

table(hprice$time)
## 
##  1  2  3  4  5  6  7  8  9 
## 36 36 36 36 36 36 36 36 36

Converting data for array and matrix format

num_data <-as.array(hprice$narsp)
hprice_array <- as.matrix(hprice)
print(hprice_array)
##     narsp      ypc     perypc        regtest rcdum ajwtr msa  time
## 1   "4.223910" "13585" " 6.46551724" "20"    "0"   "0"   "1"  "1" 
## 2   "4.271095" "14296" " 5.23371365" "20"    "0"   "0"   "1"  "2" 
## 3   "4.326778" "15413" " 7.81337437" "20"    "0"   "0"   "1"  "3" 
## 4   "4.363099" "16490" " 6.98760786" "20"    "0"   "0"   "1"  "4" 
## 5   "4.391977" "17634" " 6.93753790" "20"    "0"   "0"   "1"  "5" 
## 6   "4.454347" "18210" " 3.26641715" "20"    "0"   "0"   "1"  "6" 
## 7   "4.509760" "17958" "-1.38385502" "20"    "0"   "0"   "1"  "7" 
## 8   "4.569543" "18659" " 3.90355273" "20"    "0"   "0"   "1"  "8" 
## 9   "4.607168" "19360" " 3.75690015" "20"    "0"   "0"   "1"  "9" 
## 10  "4.361824" "15354" " 5.70740103" "18"    "0"   "0"   "2"  "1" 
## 11  "4.393214" "15959" " 3.94034128" "18"    "0"   "0"   "2"  "2" 
## 12  "4.382027" "16490" " 3.32727614" "18"    "0"   "0"   "2"  "3" 
## 13  "4.366913" "17148" " 3.99029715" "18"    "0"   "0"   "2"  "4" 
## 14  "4.430817" "17834" " 4.00046653" "18"    "0"   "0"   "2"  "5" 
## 15  "4.448516" "18156" " 1.80553998" "18"    "0"   "0"   "2"  "6" 
## 16  "4.463607" "19103" " 5.21590659" "18"    "0"   "0"   "2"  "7" 
## 17  "4.489759" "19833" " 3.82138931" "18"    "0"   "0"   "2"  "8" 
## 18  "4.515245" "20563" " 3.68073413" "18"    "0"   "0"   "2"  "9" 
## 19  "4.911183" "17152" " 3.97672163" "25"    "1"   "1"   "3"  "1" 
## 20  "4.991113" "17974" " 4.79244403" "25"    "1"   "1"   "3"  "2" 
## 21  "5.186827" "18903" " 5.16857683" "25"    "1"   "1"   "3"  "3" 
## 22  "5.369707" "19856" " 5.04152780" "25"    "1"   "1"   "3"  "4" 
## 23  "5.360353" "20744" " 4.47219984" "25"    "1"   "1"   "3"  "5" 
## 24  "5.388615" "20967" " 1.07500964" "25"    "1"   "1"   "3"  "6" 
## 25  "5.362231" "21891" " 4.40692517" "25"    "1"   "1"   "3"  "7" 
## 26  "5.287762" "22711" " 3.74583162" "25"    "1"   "1"   "3"  "8" 
## 27  "5.234845" "23531" " 3.61058518" "25"    "1"   "1"   "3"  "9" 
## 28  "4.417635" "15646" " 6.24023902" "26"    "0"   "0"   "4"  "1" 
## 29  "4.471639" "16276" " 4.02658826" "26"    "0"   "0"   "4"  "2" 
## 30  "4.549657" "16942" " 4.09191448" "26"    "0"   "0"   "4"  "3" 
## 31  "4.715817" "17914" " 5.73722111" "26"    "0"   "0"   "4"  "4" 
## 32  "4.917789" "19026" " 6.20743553" "26"    "0"   "0"   "4"  "5" 
## 33  "4.925077" "19540" " 2.70156628" "26"    "0"   "0"   "4"  "6" 
## 34  "4.882802" "19828" " 1.47389969" "26"    "0"   "0"   "4"  "7" 
## 35  "4.862908" "20577" " 3.77748638" "26"    "0"   "0"   "4"  "8" 
## 36  "4.823502" "21326" " 3.63998639" "26"    "0"   "0"   "4"  "9" 
## 37  "4.774913" "16265" " 5.52095498" "26"    "0"   "1"   "5"  "1" 
## 38  "4.861362" "16897" " 3.88564402" "26"    "0"   "1"   "5"  "2" 
## 39  "5.033049" "17763" " 5.12517015" "26"    "0"   "1"   "5"  "3" 
## 40  "5.203457" "18824" " 5.97309013" "26"    "0"   "1"   "5"  "4" 
## 41  "5.210578" "19341" " 2.74649384" "26"    "0"   "1"   "5"  "5" 
## 42  "5.233779" "19799" " 2.36802647" "26"    "0"   "1"   "5"  "6" 
## 43  "5.213848" "20489" " 3.48502450" "26"    "0"   "1"   "5"  "7" 
## 44  "5.178407" "21272" " 3.82156279" "26"    "0"   "1"   "5"  "8" 
## 45  "5.168209" "22053" " 3.67149304" "26"    "0"   "1"   "5"  "9" 
## 46  "5.113192" "23967" " 4.93432574" "29"    "1"   "1"   "6"  "1" 
## 47  "5.174453" "24908" " 3.92623190" "29"    "1"   "1"   "6"  "2" 
## 48  "5.360823" "26566" " 6.65649590" "29"    "1"   "1"   "6"  "3" 
## 49  "5.562987" "27802" " 4.65256343" "29"    "1"   "1"   "6"  "4" 
## 50  "5.557986" "29828" " 7.28724552" "29"    "1"   "1"   "6"  "5" 
## 51  "5.554896" "30555" " 2.43730723" "29"    "1"   "1"   "6"  "6" 
## 52  "5.540479" "30943" " 1.26984127" "29"    "1"   "1"   "6"  "7" 
## 53  "5.522261" "32163" " 3.94273341" "29"    "1"   "1"   "6"  "8" 
## 54  "5.545958" "33383" " 3.79317850" "29"    "1"   "1"   "6"  "9" 
## 55  "4.458988" "17402" " 2.60008254" "17"    "0"   "0"   "7"  "1" 
## 56  "4.487512" "17700" " 1.71244685" "17"    "0"   "0"   "7"  "2" 
## 57  "4.404277" "18488" " 4.45197740" "17"    "0"   "0"   "7"  "3" 
## 58  "4.448516" "19646" " 6.26352228" "17"    "0"   "0"   "7"  "4" 
## 59  "4.458988" "20802" " 5.88414945" "17"    "0"   "0"   "7"  "5" 
## 60  "4.489759" "21441" " 3.07182002" "17"    "0"   "0"   "7"  "6" 
## 61  "4.566429" "22229" " 3.67520172" "17"    "0"   "0"   "7"  "7" 
## 62  "4.651099" "23075" " 3.80583922" "17"    "0"   "0"   "7"  "8" 
## 63  "4.760463" "23920" " 3.66197183" "17"    "0"   "0"   "7"  "9" 
## 64  "4.395683" "14559" " 4.95242214" "24"    "0"   "1"   "8"  "1" 
## 65  "4.395683" "15383" " 5.65972938" "24"    "0"   "1"   "8"  "2" 
## 66  "4.417635" "16144" " 4.94701944" "24"    "0"   "1"   "8"  "3" 
## 67  "4.464758" "17292" " 7.11100099" "24"    "0"   "1"   "8"  "4" 
## 68  "4.492002" "17871" " 3.34836919" "24"    "0"   "1"   "8"  "5" 
## 69  "4.540098" "18252" " 2.13194561" "24"    "0"   "1"   "8"  "6" 
## 70  "4.575741" "18655" " 2.20797721" "24"    "0"   "1"   "8"  "7" 
## 71  "4.593098" "19338" " 3.66121683" "24"    "0"   "1"   "8"  "8" 
## 72  "4.636669" "20020" " 3.52673493" "24"    "0"   "1"   "8"  "9" 
## 73  "4.283587" "14382" " 5.82002796" "20"    "0"   "0"   "9"  "1" 
## 74  "4.333361" "15087" " 4.90196078" "20"    "0"   "0"   "9"  "2" 
## 75  "4.370713" "15951" " 5.72678465" "20"    "0"   "0"   "9"  "3" 
## 76  "4.379524" "17018" " 6.68923579" "20"    "0"   "0"   "9"  "4" 
## 77  "4.416428" "17562" " 3.19661535" "20"    "0"   "0"   "9"  "5" 
## 78  "4.457830" "17832" " 1.53741032" "20"    "0"   "0"   "9"  "6" 
## 79  "4.472781" "18406" " 3.21893226" "20"    "0"   "0"   "9"  "7" 
## 80  "4.500920" "19117" " 3.86287080" "20"    "0"   "0"   "9"  "8" 
## 81  "4.507557" "19827" " 3.71397186" "20"    "0"   "0"   "9"  "9" 
## 82  "4.112512" "14726" " 5.63845050" "17"    "0"   "1"   "10" "1" 
## 83  "4.155753" "15398" " 4.56335733" "17"    "0"   "1"   "10" "2" 
## 84  "4.183576" "16224" " 5.36433303" "17"    "0"   "1"   "10" "3" 
## 85  "4.275276" "17472" " 7.69230769" "17"    "0"   "1"   "10" "4" 
## 86  "4.268298" "17977" " 2.89033883" "17"    "0"   "1"   "10" "5" 
## 87  "4.266896" "18445" " 2.60332647" "17"    "0"   "1"   "10" "6" 
## 88  "4.284965" "18950" " 2.73786934" "17"    "0"   "1"   "10" "7" 
## 89  "4.317488" "19693" " 3.92084433" "17"    "0"   "1"   "10" "8" 
## 90  "4.333361" "20436" " 3.77291423" "17"    "0"   "1"   "10" "9" 
## 91  "4.455509" "17331" " 5.83816794" "13"    "0"   "1"   "11" "1" 
## 92  "4.508659" "18301" " 5.59690728" "13"    "0"   "1"   "11" "2" 
## 93  "4.488636" "19730" " 7.80831648" "13"    "0"   "1"   "11" "3" 
## 94  "4.672829" "21146" " 7.17688799" "13"    "0"   "1"   "11" "4" 
## 95  "4.760463" "22395" " 5.90655443" "13"    "0"   "1"   "11" "5" 
## 96  "4.875960" "22849" " 2.02723822" "13"    "0"   "1"   "11" "6" 
## 97  "4.918520" "22787" "-0.27134667" "13"    "0"   "1"   "11" "7" 
## 98  "4.955827" "23653" " 3.80041252" "13"    "0"   "1"   "11" "8" 
## 99  "4.965638" "24519" " 3.66126918" "13"    "0"   "1"   "11" "9" 
## 100 "4.077537" "15011" " 6.18986984" "21"    "0"   "0"   "12" "1" 
## 101 "4.135167" "15863" " 5.67583772" "21"    "0"   "0"   "12" "2" 
## 102 "4.191169" "16937" " 6.77047217" "21"    "0"   "0"   "12" "3" 
## 103 "4.265493" "18072" " 6.70130484" "21"    "0"   "0"   "12" "4" 
## 104 "4.314818" "19253" " 6.53497123" "21"    "0"   "0"   "12" "5" 
## 105 "4.370713" "19844" " 3.06965148" "21"    "0"   "0"   "12" "6" 
## 106 "4.427239" "19628" "-1.08849022" "21"    "0"   "0"   "12" "7" 
## 107 "4.461300" "20379" " 3.82616670" "21"    "0"   "0"   "12" "8" 
## 108 "4.507557" "21130" " 3.68516610" "21"    "0"   "0"   "12" "9" 
## 109 "4.304065" "16875" " 6.01206182" "20"    "0"   "1"   "13" "1" 
## 110 "4.395683" "17917" " 6.17481482" "20"    "0"   "1"   "13" "2" 
## 111 "4.485260" "19193" " 7.12172797" "20"    "0"   "1"   "13" "3" 
## 112 "4.567468" "20499" " 6.80456416" "20"    "0"   "1"   "13" "4" 
## 113 "4.662495" "21551" " 5.13195766" "20"    "0"   "1"   "13" "5" 
## 114 "4.701389" "21874" " 1.49877036" "20"    "0"   "1"   "13" "6" 
## 115 "4.730921" "22055" " 0.82746640" "20"    "0"   "1"   "13" "7" 
## 116 "4.751001" "22930" " 3.96735434" "20"    "0"   "1"   "13" "8" 
## 117 "4.566429" "23806" " 3.82032272" "20"    "0"   "1"   "13" "9" 
## 118 "3.919991" "14273" " 6.39582557" "18"    "0"   "0"   "14" "1" 
## 119 "3.979682" "14946" " 4.71519652" "18"    "0"   "0"   "14" "2" 
## 120 "4.058717" "15844" " 6.00829653" "18"    "0"   "0"   "14" "3" 
## 121 "4.162003" "16905" " 6.69654128" "18"    "0"   "0"   "14" "4" 
## 122 "4.223910" "17624" " 4.25317953" "18"    "0"   "0"   "14" "5" 
## 123 "4.258446" "18008" " 2.17884703" "18"    "0"   "0"   "14" "6" 
## 124 "4.291828" "18295" " 1.59373612" "18"    "0"   "0"   "14" "7" 
## 125 "4.337291" "18993" " 3.81525007" "18"    "0"   "0"   "14" "8" 
## 126 "4.339902" "19691" " 3.67503817" "18"    "0"   "0"   "14" "9" 
## 127 "4.355426" "17352" " 5.08084539" "16"    "0"   "0"   "15" "1" 
## 128 "4.388257" "18264" " 5.25587828" "16"    "0"   "0"   "15" "2" 
## 129 "4.445001" "19191" " 5.07555848" "16"    "0"   "0"   "15" "3" 
## 130 "4.468204" "20313" " 5.84649054" "16"    "0"   "0"   "15" "4" 
## 131 "4.485260" "21138" " 4.06143849" "16"    "0"   "0"   "15" "5" 
## 132 "4.511958" "21665" " 2.49314032" "16"    "0"   "0"   "15" "6" 
## 133 "4.545420" "22247" " 2.68636049" "16"    "0"   "0"   "15" "7" 
## 134 "4.587006" "23107" " 3.86568976" "16"    "0"   "0"   "15" "8" 
## 135 "4.620059" "23967" " 3.72181590" "16"    "0"   "0"   "15" "9" 
## 136 "4.180522" "16018" " 4.56978718" "19"    "0"   "0"   "16" "1" 
## 137 "4.245634" "16654" " 3.97053315" "19"    "0"   "0"   "16" "2" 
## 138 "4.255613" "17541" " 5.32604780" "19"    "0"   "0"   "16" "3" 
## 139 "4.271095" "18534" " 5.66102275" "19"    "0"   "0"   "16" "4" 
## 140 "4.305416" "19336" " 4.32718247" "19"    "0"   "0"   "16" "5" 
## 141 "4.338597" "19963" " 3.24265618" "19"    "0"   "0"   "16" "6" 
## 142 "4.375757" "20456" " 2.46956870" "19"    "0"   "0"   "16" "7" 
## 143 "4.426044" "21238" " 3.82283926" "19"    "0"   "0"   "16" "8" 
## 144 "4.467057" "22020" " 3.68207929" "19"    "0"   "0"   "16" "9" 
## 145 "4.286341" "14969" " 7.09737426" "23"    "1"   "0"   "17" "1" 
## 146 "4.458988" "15895" " 6.18611798" "23"    "1"   "0"   "17" "2" 
## 147 "4.523960" "16984" " 6.85121107" "23"    "1"   "0"   "17" "3" 
## 148 "4.653008" "18294" " 7.71314178" "23"    "1"   "0"   "17" "4" 
## 149 "4.671894" "19306" " 5.53186837" "23"    "1"   "0"   "17" "5" 
## 150 "4.703204" "19783" " 2.47073449" "23"    "1"   "0"   "17" "6" 
## 151 "4.713127" "19545" "-1.20305313" "23"    "1"   "0"   "17" "7" 
## 152 "4.721174" "20300" " 3.86288053" "23"    "1"   "0"   "17" "8" 
## 153 "4.718499" "21056" " 3.72413793" "23"    "1"   "0"   "17" "9" 
## 154 "3.958907" "14256" " 5.51402561" "17"    "1"   "1"   "18" "1" 
## 155 "4.037774" "14900" " 4.51739618" "17"    "1"   "1"   "18" "2" 
## 156 "4.182050" "15748" " 5.69127517" "17"    "1"   "1"   "18" "3" 
## 157 "4.283587" "16884" " 7.21361443" "17"    "1"   "1"   "18" "4" 
## 158 "4.346399" "17902" " 6.02937693" "17"    "1"   "1"   "18" "5" 
## 159 "4.378270" "18466" " 3.15048598" "17"    "1"   "1"   "18" "6" 
## 160 "4.403054" "18439" "-0.14621466" "17"    "1"   "1"   "18" "7" 
## 161 "4.424847" "19132" " 3.75833831" "17"    "1"   "1"   "18" "8" 
## 162 "4.410371" "19824" " 3.61697679" "17"    "1"   "1"   "18" "9" 
## 163 "5.078917" "19159" " 6.62845058" "26"    "1"   "1"   "19" "1" 
## 164 "5.212215" "20449" " 6.73312803" "26"    "1"   "1"   "19" "2" 
## 165 "5.213848" "22246" " 8.78771578" "26"    "1"   "1"   "19" "3" 
## 166 "5.210578" "23794" " 6.95855435" "26"    "1"   "1"   "19" "4" 
## 167 "5.164214" "25110" " 5.53080609" "26"    "1"   "1"   "19" "5" 
## 168 "5.156178" "25583" " 1.88371167" "26"    "1"   "1"   "19" "6" 
## 169 "5.150977" "25294" "-1.12965641" "26"    "1"   "1"   "19" "7" 
## 170 "5.154447" "26295" " 3.95746027" "26"    "1"   "1"   "19" "8" 
## 171 "5.154447" "27296" " 3.80680738" "26"    "1"   "1"   "19" "9" 
## 172 "4.223910" "16007" " 5.86640212" "20"    "0"   "1"   "20" "1" 
## 173 "4.283587" "16565" " 3.48597489" "20"    "0"   "1"   "20" "2" 
## 174 "4.326778" "17812" " 7.52792031" "20"    "0"   "1"   "20" "3" 
## 175 "4.363099" "19279" " 8.23602066" "20"    "0"   "1"   "20" "4" 
## 176 "4.379524" "20161" " 4.57492609" "20"    "0"   "1"   "20" "5" 
## 177 "4.400603" "20784" " 3.09012450" "20"    "0"   "1"   "20" "6" 
## 178 "4.439116" "20687" "-0.46670516" "20"    "0"   "1"   "20" "7" 
## 179 "4.440296" "21466" " 3.76564992" "20"    "0"   "1"   "20" "8" 
## 180 "4.449685" "22254" " 3.67092146" "20"    "0"   "1"   "20" "9" 
## 181 "4.163560" "14033" " 5.71794485" "21"    "0"   "0"   "21" "1" 
## 182 "4.232656" "14693" " 4.70319960" "21"    "0"   "0"   "21" "2" 
## 183 "4.312140" "15560" " 5.90076907" "21"    "0"   "0"   "21" "3" 
## 184 "4.373238" "16774" " 7.80205656" "21"    "0"   "0"   "21" "4" 
## 185 "4.390739" "17786" " 6.03314654" "21"    "0"   "0"   "21" "5" 
## 186 "4.352855" "18063" " 1.55740470" "21"    "0"   "0"   "21" "6" 
## 187 "4.387014" "18150" " 0.48164757" "21"    "0"   "0"   "21" "7" 
## 188 "4.439116" "18849" " 3.85123967" "21"    "0"   "0"   "21" "8" 
## 189 "4.420045" "19548" " 3.70841954" "21"    "0"   "0"   "21" "9" 
## 190 "4.028917" "14444" " 5.03963348" "21"    "0"   "0"   "22" "1" 
## 191 "4.044804" "15065" " 4.29936306" "21"    "0"   "0"   "22" "2" 
## 192 "4.092677" "15960" " 5.94092267" "21"    "0"   "0"   "22" "3" 
## 193 "4.166665" "17025" " 6.67293233" "21"    "0"   "0"   "22" "4" 
## 194 "4.215086" "17992" " 5.67988253" "21"    "0"   "0"   "22" "5" 
## 195 "4.273885" "18234" " 1.34504224" "21"    "0"   "0"   "22" "6" 
## 196 "4.373238" "18577" " 1.88110124" "21"    "0"   "0"   "22" "7" 
## 197 "4.421247" "19277" " 3.76810034" "21"    "0"   "0"   "22" "8" 
## 198 "4.441474" "19976" " 3.62608290" "21"    "0"   "0"   "22" "9" 
## 199 "4.151040" "14674" " 5.65195478" "22"    "0"   "0"   "23" "1" 
## 200 "4.191169" "15473" " 5.44500477" "22"    "0"   "0"   "23" "2" 
## 201 "4.244200" "16612" " 7.36120985" "22"    "0"   "0"   "23" "3" 
## 202 "4.328098" "17603" " 5.96556706" "22"    "0"   "0"   "23" "4" 
## 203 "4.379524" "18766" " 6.60682838" "22"    "0"   "0"   "23" "5" 
## 204 "4.441474" "19273" " 2.70169455" "22"    "0"   "0"   "23" "6" 
## 205 "4.484132" "19239" "-0.17641260" "22"    "0"   "0"   "23" "7" 
## 206 "4.515245" "19980" " 3.85155154" "22"    "0"   "0"   "23" "8" 
## 207 "4.569543" "20720" " 3.70370370" "22"    "0"   "0"   "23" "9" 
## 208 "4.203199" "15622" " 4.19529114" "21"    "0"   "1"   "24" "1" 
## 209 "4.220977" "16333" " 4.55127384" "21"    "0"   "1"   "24" "2" 
## 210 "4.237001" "17440" " 6.77768934" "21"    "0"   "1"   "24" "3" 
## 211 "4.320151" "18611" " 6.71444954" "21"    "0"   "1"   "24" "4" 
## 212 "4.389499" "19706" " 5.88361722" "21"    "0"   "1"   "24" "5" 
## 213 "4.456670" "19995" " 1.46655841" "21"    "0"   "1"   "24" "6" 
## 214 "4.507557" "20322" " 1.63540885" "21"    "0"   "1"   "24" "7" 
## 215 "4.553877" "21082" " 3.73978939" "21"    "0"   "1"   "24" "8" 
## 216 "4.590057" "21841" " 3.60022768" "21"    "0"   "1"   "24" "9" 
## 217 "4.182050" "14646" " 5.19284637" "20"    "0"   "0"   "25" "1" 
## 218 "4.229749" "15358" " 4.86139560" "20"    "0"   "0"   "25" "2" 
## 219 "4.284965" "16267" " 5.91873942" "20"    "0"   "0"   "25" "3" 
## 220 "4.355426" "17345" " 6.62691338" "20"    "0"   "0"   "25" "4" 
## 221 "4.401829" "18161" " 4.70452580" "20"    "0"   "0"   "25" "5" 
## 222 "4.445001" "18630" " 2.58245691" "20"    "0"   "0"   "25" "6" 
## 223 "4.510860" "18846" " 1.15942029" "20"    "0"   "0"   "25" "7" 
## 224 "4.519612" "19568" " 3.83105168" "20"    "0"   "0"   "25" "8" 
## 225 "4.551769" "20291" " 3.69480785" "20"    "0"   "0"   "25" "9" 
## 226 "4.025352" "14579" " 5.11933088" "22"    "0"   "1"   "26" "1" 
## 227 "4.030695" "15238" " 4.52020029" "22"    "0"   "1"   "26" "2" 
## 228 "4.067316" "16054" " 5.35503347" "22"    "0"   "1"   "26" "3" 
## 229 "4.107590" "16861" " 5.02678460" "22"    "0"   "1"   "26" "4" 
## 230 "4.139955" "17416" " 3.29161971" "22"    "0"   "1"   "26" "5" 
## 231 "4.231204" "17713" " 1.70532843" "22"    "0"   "1"   "26" "6" 
## 232 "4.269697" "18447" " 4.14384915" "22"    "0"   "1"   "26" "7" 
## 233 "4.280824" "19126" " 3.68081531" "22"    "0"   "1"   "26" "8" 
## 234 "4.301359" "19804" " 3.54491268" "22"    "0"   "1"   "26" "9" 
## 235 "4.143135" "13667" " 0.01463593" "18"    "0"   "0"   "27" "1" 
## 236 "4.131961" "13845" " 1.30240726" "18"    "0"   "0"   "27" "2" 
## 237 "4.028917" "14616" " 5.56879740" "18"    "0"   "0"   "27" "3" 
## 238 "3.979682" "15576" " 6.56814450" "18"    "0"   "0"   "27" "4" 
## 239 "3.974058" "16302" " 4.66101695" "18"    "0"   "0"   "27" "5" 
## 240 "4.043051" "16799" " 3.04870568" "18"    "0"   "0"   "27" "6" 
## 241 "4.120662" "17805" " 5.98845169" "18"    "0"   "0"   "27" "7" 
## 242 "4.172848" "18459" " 3.67312553" "18"    "0"   "0"   "27" "8" 
## 243 "4.200205" "19112" " 3.53756975" "18"    "0"   "0"   "27" "9" 
## 244 "4.182050" "14357" " 1.05581755" "20"    "0"   "0"   "28" "1" 
## 245 "4.185099" "14452" " 0.66169813" "20"    "0"   "0"   "28" "2" 
## 246 "4.174387" "15277" " 5.70855245" "20"    "0"   "0"   "28" "3" 
## 247 "4.136765" "16409" " 7.40983177" "20"    "0"   "0"   "28" "4" 
## 248 "4.157319" "17493" " 6.60613078" "20"    "0"   "0"   "28" "5" 
## 249 "4.180522" "17837" " 1.96650089" "20"    "0"   "0"   "28" "6" 
## 250 "4.223910" "18687" " 4.76537534" "20"    "0"   "0"   "28" "7" 
## 251 "4.266896" "19373" " 3.67100123" "20"    "0"   "0"   "28" "8" 
## 252 "4.305416" "20059" " 3.54101068" "20"    "0"   "0"   "28" "9" 
## 253 "4.136765" "14871" " 3.92033543" "19"    "0"   "0"   "29" "1" 
## 254 "4.162003" "15530" " 4.43144375" "19"    "0"   "0"   "29" "2" 
## 255 "4.165114" "16455" " 5.95621378" "19"    "0"   "0"   "29" "3" 
## 256 "4.249923" "17844" " 8.44120328" "19"    "0"   "0"   "29" "4" 
## 257 "4.375757" "18744" " 5.04371217" "19"    "0"   "0"   "29" "5" 
## 258 "4.483003" "19235" " 2.61950491" "19"    "0"   "0"   "29" "6" 
## 259 "4.581902" "19459" " 1.16454380" "19"    "0"   "0"   "29" "7" 
## 260 "4.663439" "20181" " 3.71036538" "19"    "0"   "0"   "29" "8" 
## 261 "4.761319" "20902" " 3.57266736" "19"    "0"   "0"   "29" "9" 
## 262 "4.411585" "16624" " 6.13547852" "24"    "0"   "0"   "30" "1" 
## 263 "4.574711" "17583" " 5.76876805" "24"    "0"   "0"   "30" "2" 
## 264 "4.628887" "18905" " 7.51862595" "24"    "0"   "0"   "30" "3" 
## 265 "4.643429" "20232" " 7.01930706" "24"    "0"   "0"   "30" "4" 
## 266 "4.688592" "21381" " 5.67912218" "24"    "0"   "0"   "30" "5" 
## 267 "4.774069" "22014" " 2.96057247" "24"    "0"   "0"   "30" "6" 
## 268 "4.762174" "21798" "-0.98119379" "24"    "0"   "0"   "30" "7" 
## 269 "4.770685" "22653" " 3.92237820" "24"    "0"   "0"   "30" "8" 
## 270 "4.783316" "23509" " 3.77874895" "24"    "0"   "0"   "30" "9" 
## 271 "4.257030" "13730" " 7.61031429" "21"    "0"   "0"   "31" "1" 
## 272 "4.317488" "14587" " 6.24180626" "21"    "0"   "0"   "31" "2" 
## 273 "4.334673" "15562" " 6.68403373" "21"    "0"   "0"   "31" "3" 
## 274 "4.357990" "16601" " 6.67651973" "21"    "0"   "0"   "31" "4" 
## 275 "4.357990" "17645" " 6.28877778" "21"    "0"   "0"   "31" "5" 
## 276 "4.412798" "18331" " 3.88778691" "21"    "0"   "0"   "31" "6" 
## 277 "4.446174" "18046" "-1.55474333" "21"    "0"   "0"   "31" "7" 
## 278 "4.465908" "18754" " 3.92330710" "21"    "0"   "0"   "31" "8" 
## 279 "4.457830" "19462" " 3.77519463" "21"    "0"   "0"   "31" "9" 
## 280 "4.541165" "17609" " 1.07335553" "15"    "0"   "0"   "32" "1" 
## 281 "4.545420" "17715" " 0.60196490" "15"    "0"   "0"   "32" "2" 
## 282 "4.508659" "18449" " 4.14338132" "15"    "0"   "0"   "32" "3" 
## 283 "4.536891" "19403" " 5.17101198" "15"    "0"   "0"   "32" "4" 
## 284 "4.494239" "20291" " 4.57661186" "15"    "0"   "0"   "32" "5" 
## 285 "4.480740" "20892" " 2.96190429" "15"    "0"   "0"   "32" "6" 
## 286 "4.514151" "22064" " 5.60980280" "15"    "0"   "0"   "32" "7" 
## 287 "4.546481" "22914" " 3.85242930" "15"    "0"   "0"   "32" "8" 
## 288 "4.553877" "23765" " 3.71388671" "15"    "0"   "0"   "32" "9" 
## 289 "4.247066" "15448" "-2.05427340" "21"    "0"   "1"   "33" "1" 
## 290 "4.188138" "15582" " 0.86742620" "21"    "0"   "1"   "33" "2" 
## 291 "4.123903" "16618" " 6.64869722" "21"    "0"   "1"   "33" "3" 
## 292 "4.200205" "18020" " 8.43663497" "21"    "0"   "1"   "33" "4" 
## 293 "4.258446" "19468" " 8.03551609" "21"    "0"   "1"   "33" "5" 
## 294 "4.304065" "20169" " 3.60078077" "21"    "0"   "1"   "33" "6" 
## 295 "4.384523" "20724" " 2.75174773" "21"    "0"   "1"   "33" "7" 
## 296 "4.393214" "21491" " 3.70102297" "21"    "0"   "1"   "33" "8" 
## 297 "4.371976" "22259" " 3.57358894" "21"    "0"   "1"   "33" "9" 
## 298 "4.237001" "13477" " 3.38293955" "18"    "0"   "0"   "34" "1" 
## 299 "4.251348" "13447" "-0.22260147" "18"    "0"   "0"   "34" "2" 
## 300 "4.174387" "14075" " 4.67018666" "18"    "0"   "0"   "34" "3" 
## 301 "4.162003" "14855" " 5.54174067" "18"    "0"   "0"   "34" "4" 
## 302 "4.152613" "15252" " 2.67250084" "18"    "0"   "0"   "34" "5" 
## 303 "4.172848" "15950" " 4.57644899" "18"    "0"   "0"   "34" "6" 
## 304 "4.254193" "16660" " 4.45141066" "18"    "0"   "0"   "34" "7" 
## 305 "4.343805" "17302" " 3.85354142" "18"    "0"   "0"   "34" "8" 
## 306 "4.357990" "17943" " 3.70477401" "18"    "0"   "0"   "34" "9" 
## 307 "4.226834" "12535" " 3.79233253" "19"    "0"   "1"   "35" "1" 
## 308 "4.239887" "13005" " 3.74950140" "19"    "0"   "1"   "35" "2" 
## 309 "4.215086" "13520" " 3.96001538" "19"    "0"   "1"   "35" "3" 
## 310 "4.239887" "14244" " 5.35502959" "19"    "0"   "1"   "35" "4" 
## 311 "4.239887" "15097" " 5.98848638" "19"    "0"   "1"   "35" "5" 
## 312 "4.287716" "15687" " 3.90806120" "19"    "0"   "1"   "35" "6" 
## 313 "4.337291" "15969" " 1.79766686" "19"    "0"   "1"   "35" "7" 
## 314 "4.441474" "16563" " 3.71970693" "19"    "0"   "1"   "35" "8" 
## 315 "4.584967" "17156" " 3.58026928" "19"    "0"   "1"   "35" "9" 
## 316 "4.247066" "15993" " 4.92717491" "18"    "0"   "1"   "36" "1" 
## 317 "4.255613" "16702" " 4.43318952" "18"    "0"   "1"   "36" "2" 
## 318 "4.310799" "17747" " 6.25673572" "18"    "0"   "1"   "36" "3" 
## 319 "4.377014" "18811" " 5.99537950" "18"    "0"   "1"   "36" "4" 
## 320 "4.435567" "19785" " 5.17782149" "18"    "0"   "1"   "36" "5" 
## 321 "4.499810" "20325" " 2.72934041" "18"    "0"   "1"   "36" "6" 
## 322 "4.574711" "20692" " 1.80565806" "18"    "0"   "1"   "36" "7" 
## 323 "4.645352" "21471" " 3.76474000" "18"    "0"   "1"   "36" "8" 
## 324 "4.691348" "22250" " 3.62814960" "18"    "0"   "1"   "36" "9"

Visualisations for NARSP

barplot(table(hprice$narsp), main="Bar Chart of NARSP", xlab="narsp", ylab="Frequency of NARSP")

hist(hprice$narsp, main="Histogram of NARSP", xlab="narsp", ylab="Frequency", col="blue", breaks=10)

boxplot(hprice$narsp, main="Boxplot of NARSP", ylab="narsp")

Visualisations for YPC

barplot(table(hprice$ypc), main="Bar Chart of YPC", xlab="YPC Categories", ylab="Frequency of YPC")

hist(hprice$ypc, main="Histogram of YPC", xlab="YPC Values", ylab="Frequency", col="blue", breaks=10)

boxplot(hprice$ypc, main="Boxplot of YPC", ylab="Values of YPC")

Visualisation for PERYPC

barplot(table(hprice$perypc), main="Bar Chart of PERYPC", xlab="PERYPC Categories", ylab="Frequency of PERYPC")

hist(hprice$perypc, main="Histogram of PERYPC", xlab="PERYPC Values", ylab="Frequency", col="blue", breaks=10)

boxplot(hprice$perypc, main="Boxplot of PERYPC", ylab="Values of PERYPC")

Visualisations for RESTEST

barplot(table(hprice$regtest), main="Bar Chart of REGTEST", xlab="REGTEST Categories", ylab="Frequency of REGTEST")

hist(hprice$regtest, main="Histogram of REGTEST", xlab="REGTEST Values", ylab="Frequency", col="blue", breaks=10)

boxplot(hprice$regtest, main="Boxplot of REGTEST", ylab="Values of REGTEST")

Visulazation for TIME

barplot(table(hprice$time), main="Bar Chart of TIME", xlab="TIME Categories", ylab="Frequency of TIME")

hist(hprice$time, main="Histogram of TIME", xlab="TIME Values", ylab="Frequency", col="blue", breaks=10)

boxplot(hprice$time, main="Boxplot of TIME", ylab="Values of TIME")

#Sample means and population means for a 30 sample subset

set.seed(123)
sample_30 <- hprice[sample(1:nrow(hprice), 30), ]
summary(sample_30)
##      narsp            ypc            perypc          regtest      rcdum  ajwtr 
##  Min.   :3.920   Min.   :13447   Min.   :-1.384   Min.   :13.00   0:27   0:18  
##  1st Qu.:4.257   1st Qu.:16865   1st Qu.: 3.707   1st Qu.:18.25   1: 3   1:12  
##  Median :4.424   Median :17951   Median : 3.771   Median :20.00                
##  Mean   :4.475   Mean   :18345   Mean   : 3.879   Mean   :20.13                
##  3rd Qu.:4.558   3rd Qu.:20476   3rd Qu.: 4.888   3rd Qu.:21.00                
##  Max.   :5.360   Max.   :23967   Max.   : 8.441   Max.   :26.00                
##                                                                                
##       msa          time      
##  3      : 2   Min.   :1.000  
##  9      : 2   1st Qu.:2.250  
##  16     : 2   Median :5.500  
##  22     : 2   Mean   :5.333  
##  29     : 2   3rd Qu.:8.000  
##  34     : 2   Max.   :9.000  
##  (Other):18
population_mean_narsp <- mean(hprice$narsp, na.rm = TRUE)
sample_mean_narsp <- mean(sample_30$narsp, na.rm = TRUE)
cat("Population Mean for NARSP:", population_mean_narsp, "\n")
## Population Mean for NARSP: 4.484157
cat("Sample Mean for NARSP:", sample_mean_narsp, "\n")
## Sample Mean for NARSP: 4.474927
population_mean_ypc <- mean(hprice$ypc, na.rm = TRUE)
sample_mean_ypc <- mean(sample_30$ypc, na.rm = TRUE)
cat("Population Mean for YPC:", population_mean_ypc, "\n")
## Population Mean for YPC: 18769.22
cat("Sample Mean for YPC:", sample_mean_ypc, "\n")
## Sample Mean for YPC: 18345.47
population_mean_perypc <- mean(hprice$perypc, na.rm = TRUE)
sample_mean_perypc <- mean(sample_30$perypc, na.rm = TRUE)
cat("Population Mean for PERYPC:", population_mean_perypc, "\n")
## Population Mean for PERYPC: 4.268455
cat("Sample Mean for PERYPC:", sample_mean_perypc, "\n")
## Sample Mean for PERYPC: 3.878621
population_mean_regtest <- mean(hprice$regtest, na.rm = TRUE)
sample_mean_regtest <- mean(sample_30$regtest, na.rm = TRUE)
cat("Population Mean for REGTEST:", population_mean_regtest, "\n")
## Population Mean for REGTEST: 20.41667
cat("Sample Mean for REGTEST:", sample_mean_regtest, "\n")
## Sample Mean for REGTEST: 20.13333
population_mean_time <- mean(hprice$time, na.rm = TRUE)
sample_mean_time <- mean(sample_30$time, na.rm = TRUE)
cat("Population Mean for TIME:", population_mean_time, "\n")
## Population Mean for TIME: 5
cat("Sample Mean for TIME:", sample_mean_time, "\n")
## Sample Mean for TIME: 5.333333

#Bar plot and Pie charts

barplot(table(hprice$rcdum), main="Bar Chart of RCDUM", xlab="RCDUM Categories", ylab="Frequency of RCDUM", col="lightblue")

pie(table(hprice$rcdum), main="Pie Chart of RCDUM", col=rainbow(length(table(hprice$rcdum))))

barplot(table(hprice$ajwtr), main="Bar Chart of AJWTR", xlab="AJWTR Categories", ylab="Frequency of AJWTR", col="lightblue")

pie(table(hprice$ajwtr), main="Pie Chart of AJWTR", col=rainbow(length(table(hprice$ajwtr))))

barplot(table(hprice$msa), main="Bar Chart of MSA", xlab="MSA Categories", ylab="Frequency of MSA", col="lightblue")

pie(table(hprice$msa), main="Pie Chart of MSA", col=rainbow(length(table(hprice$msa))))

#Scatter Graphs

plot(hprice$narsp, hprice$ypc, main="Scatter Plot of NARSP vs YPC", xlab="NARSP Values", ylab="YPC Values", pch=19, col="blue")

plot(hprice$narsp, hprice$perypc, main="Scatter Plot of NARSP vs PERYPC", xlab="NARSP Values", ylab="PERYPC Values", pch=19, col="blue")

plot(hprice$narsp, hprice$regtest, main="Scatter Plot of NARSP vs REGTEST", xlab="NARSP Values", ylab="REGTEST Values", pch=19, col="blue")

plot(hprice$narsp, hprice$time, main="Scatter Plot of NARSP vs TIME", xlab="NARSP Values", ylab="TIME Values", pch=19, col="blue")

plot(hprice$ypc, hprice$perypc, main="Scatter Plot of YPC vs PERYPC", xlab="YPC Values", ylab="PERYPC Values", pch=19, col="blue")

#Computing measures of location #load necessary library

library(pastecs)

#Finding Mean

mean(hprice$narsp)
## [1] 4.484157
mean(hprice$perypc)
## [1] 4.268455
mean(hprice$ypc)
## [1] 18769.22

#Finding Meadian

median(hprice$narsp)
## [1] 4.412192
median(hprice$perypc)
## [1] 3.963685
median(hprice$ypc)
## [1] 18454

#finding Mode

library(DescTools)
Mode(hprice$narsp)
## [1] 4.22391
## attr(,"freq")
## [1] 4
Mode(hprice$perypc)
## [1] NA
## attr(,"freq")
## [1] NA
Mode(hprice$ypc)
## [1] 16490 20291 23967
## attr(,"freq")
## [1] 2

#Finding variance

var(hprice$narsp)
## [1] 0.1101012
var(hprice$perypc)
## [1] 3.885211
var(hprice$ypc)
## [1] 10122494

#Finding Standard Deviation

sd(hprice$narsp)
## [1] 0.3318151
sd(hprice$perypc)
## [1] 1.971094
sd(hprice$ypc)
## [1] 3181.587

#Finding Interquartile range

IQR(hprice$narsp)
## [1] 0.31098
IQR(hprice$perypc)
## [1] 2.17604
IQR(hprice$ypc)
## [1] 3713.5

#loading necessary library for Skewness and Kurtosis

library(e1071)

#Finding Skweness

skewness(hprice$narsp)
## [1] 1.311706
skewness(hprice$perypc)
## [1] -0.469983
skewness(hprice$ypc)
## [1] 1.136355

#Finding Kurtosis

kurtosis(hprice$narsp)
## [1] 1.485989
kurtosis(hprice$perypc)
## [1] 0.383425
kurtosis(hprice$ypc)
## [1] 2.770542

#Plotting Histogram

hist(hprice$narsp, main="Histogram of Narsp", xlab="NARSP Values",ylab="Frequency", col="lightblue", breaks=10)

hist(hprice$perypc, main="Histogram of PERYPC", xlab="PERYPC Values", ylab="Frequency", col="green", breaks=10)

hist(hprice$ypc, main="Histogram of ypc", xlab="ypc Values",ylab="Frequency", col="purple", breaks=10)

#Plotting Boxplot

boxplot(hprice$narsp, main="Boxplot of NARSP", ylab="Values of NARSP")

boxplot(hprice$perypc, main="Boxplot of PERYPC", ylab="Values of PERYPC")

boxplot(hprice$ypc, main="Boxplot of YPC", ylab="Values of YPC")

#Find Covarience

cov(hprice$narsp, hprice$perypc)
## [1] -0.08997616

#Finding Corelation

cor(hprice$narsp, hprice$perypc)
## [1] -0.1375701
cor(hprice$ypc,hprice$regtest)
## [1] 0.2901941
cor(hprice$narsp,hprice$ypc)
## [1] 0.7642161
cor(hprice$perypc, hprice$regtest)
## [1] 0.03837195
cor(hprice$narsp, hprice$regtest)
## [1] 0.5680897
cor(hprice$ypc, hprice$perypc)
## [1] -0.1887032

#plotting scatter plot

plot(hprice$narsp, hprice$perypc, main="Scatter Plot of NARSP vs PERYPC", xlab="NARSP Values", ylab="PERYPC Values", col="purple")

plot(hprice$ypc,hprice$regtest, main="Scatter Plot of YPC vs REGTEST", xlab="YPC Values", ylab="REGREST Values", pch=19, col="blue")

plot(hprice$narsp, hprice$ypc, main ="Scatter plot of NARSP vs YPC", xlab="NARSP Values", ylab= "YPC Values" , col="pink")

plot(hprice$perypc, hprice$regtest, main="Scatter Plot of PERYPC vs REGTEST", xlab="PERYPC Values", ylab="REGTEST Values",  col="yellow")

plot(hprice$narsp, hprice$regtest, main ="Scatter Plot of NARSP vs REGTEST", xlab="NARSP Values", ylab="REGTEST Values",  col="black")

plot(hprice$ypc, hprice$perypc, main="Scatter Plot of YPC vs PERYPC", xlab="YPC Values", ylab="PERYPC Values", col="lightgreen")

#Simple Linear Regresssion

model <- lm(narsp~ ajwtr, data = hprice)
summary(model)
## 
## Call:
## lm(formula = narsp ~ ajwtr, data = hprice)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.65489 -0.21918 -0.03357  0.13360  0.94919 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  4.39156    0.02281 192.500  < 2e-16 ***
## ajwtr1       0.22223    0.03534   6.288 1.05e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3136 on 322 degrees of freedom
## Multiple R-squared:  0.1094, Adjusted R-squared:  0.1066 
## F-statistic: 39.54 on 1 and 322 DF,  p-value: 1.046e-09

#Simple Linear Regresssion

model <- lm(narsp~ ypc, data = hprice)
summary(model)
## 
## Call:
## lm(formula = narsp ~ ypc, data = hprice)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.39032 -0.14801 -0.03663  0.09124  0.79893 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 2.988e+00  7.136e-02   41.88   <2e-16 ***
## ypc         7.970e-05  3.748e-06   21.26   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2143 on 322 degrees of freedom
## Multiple R-squared:  0.584,  Adjusted R-squared:  0.5827 
## F-statistic: 452.1 on 1 and 322 DF,  p-value: < 2.2e-16

#Finding 30 sample with replacement

num_samples <- 11
sample_size <- 30  
sample_means <- replicate(num_samples, mean(sample(hprice$narsp, size = 30, replace = TRUE)))
hist(sample_means, main = "Distribution of Sample Means", xlab = "Sample Means", col = "lightblue", border = "black")

#Fitting the linear model

model <- lm(regtest ~ time, data = hprice)

#Interpret the Regression Coefficient and Calculate the R-squared value

summary(model)
## 
## Call:
## lm(formula = regtest ~ time, data = hprice)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -7.4167 -2.4167 -0.4167  1.5833  8.5833 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 2.042e+01  4.062e-01   50.26   <2e-16 ***
## time        1.063e-15  7.219e-02    0.00        1    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.355 on 322 degrees of freedom
## Multiple R-squared:  8.834e-29,  Adjusted R-squared:  -0.003106 
## F-statistic: 2.844e-26 on 1 and 322 DF,  p-value: 1

#Interpret the Regression Coefficients and Calculate the R-squared value

predictions <- predict(model, newdata= data.frame(time = c(3,6,9)))
print(predictions)
##        1        2        3 
## 20.41667 20.41667 20.41667

#Discussing the Accuracy

residuals <- model$residuals
plot(hprice$time, residuals)
abline(h = 0, col = 'red')

#Applying the Central Limit Theoram

set.seed(123) # For Reproducibility
sample_means <- replicate(30, mean(sample(hprice$regtest, 30, replace = TRUE)))
hist(sample_means, main = "Distribution of Sample Means", xlab = "Sample Means")

#Compare the Sample Mean Distrubution to the Population Mean

population_mean <-(hprice$regtest)
plot(hprice$regtest)
abline(v = population_mean, col = "blue", lwd = 2)