You are on page 1of 5
7ns2019 HoteLPricing-Analysis/Shwetanshu Rohatgi My Project Code.R at master: shweti-rohatgiHotebPricing-Analysis - GitHub Dismiss Join GitHub today GitHub is home to over 36 milion developers working together hest nd review code, manage projects, and bul seftware together Sign vp Branch master= Find fle Copy oath Hotel-Pricing-Analysis / Shwetanshu Rohatgi My Project Code R Bi vvwetcroatgcoosone awe Blame | History ort 292 Lines (198 see) 12.5 18 1 OHAL: stwetanshusrohatenat con COLLEGE + Hararajs Suragnal Institute of technology, New Dele setting the elrectory and assigning varSabel to the ests érane sete" Brosecks/TIN | pragect/Capstone prosect") hotel ef read.esu(pasteCitiest2.c5v", ep = Viewtroten df) hotel .ctoetec-gsio(ri8-0eet6", hotel ee0arec-gsub("21-0e-16 hotel efsoazec-2si0(~ hotel efuasec-gsun("2s-0ee36", hotel ef0arec-ysi0(-28-0ec-16", “Dee 28 2016", hotel -eFSate) hotel efaacec-gsin("91-Dee16", “See 31 7016", Rotel .ofSt0) hotel efoazec-gsub("4-Jan-7", "Jan 08 2017", hotel sfS0te) hotel ceoscec-gaui("4-Jan-6", “Dan a& 2017", hotel dFste) hotel -ce0ate«-gsi0("8-Jan-a6", “Jan 68 20177, notel.c¢Sate) hotel efsaacec-gsun("8-3an-17", “Tan 08 20177, notel-sfS0te) hotelefosteccgaub(Clan 42837", "Zan 8¢ 2837", note d0ate) hotel. ef0atec-psi0("Jan 6 29:7", “Jan 06 20:7", hotel 4f0ate) 8 ree, poterertoate) 21 2016, hotel. oftoate) 24 2016", hotel.cfSoste) 25 2016", hotel.crivate) e(hotel.c#saate) hovel ooatec-tactor(hotel.sfsoate) sefacro(tatel.etsoate) reneceing he Labeiting revels (rote. stsbate) galyzing the Suamary of the data end describing the variates itpssigthub.convshwetu-sohatgiHotel-Pricing-Analyss/lobimastor/Shwotanshu Rohatgi My Project Code.R. 18 7rsro1g HotehPricing-Analysis'Shwetanshu Rohatgi My Project Code.R at master shwett-rohatgiHotetPricing-Analysis~ Gib abearyesyer)| fescribanorel 8) summary{hotel.e*} raking ¥ = Saoatent, ‘deesiying the not celovent predictor wartsbles ay correlation corrgran sbearyleorgran) oregran(ocel- tf, orders, Lowee.panepanel shade, solre"Corcgran of Hotel deta") ‘trough corraran tasSwimning, StarRating, HoelCapItal are very well correlated to RoorRent (ta we can take then 36 predictors evisuaing gata for Ya hoon rent ad X0,K2,K8 25 HasSulomingPool, Staating and HotelCapucity respectively [able for sasSeiming?ool abte(hatel.ctfnassaiming? 021) suinc-tade(otel d¢siasSuimingfoo!) barplotseta,rain-"sareplot of Hotel Sesning Poel”) vane for startating ‘sple(hotel.atsstartating) starnatingtable(hote 4SSzarkatine) berplot(starRating sain = "Barrplot for Star Rating") ‘tooaPlot for Hereleapactty owplat(hetel.atsiatelcapacity, sain-"boxplat for Hotel Cagaeisy"torszontal = TRE) Library) Startating Vs RoooRent scattorplot(hatel.dfSStartating hotel.dfttoantent,nain-"Acomnt of Hotels with Startating"ylab = "Aoowtent dn IMR", abetsts Roontant of Hotels with Hotel capactty",ylab = “hotel Capacity dn re contents HasSwimnngo0} plot jtttertotel-dfSRocnens) jitter (hated. fhasswlentgge01) 23s ibrarycatesce) ape (HeSwinningPool-Rootent, csth = otel.atyraine'Roatons af Hotels alth FasSwimting?ool",y150 = “ins Sueang Peak, xa ccsttorplonaerte( hate eff eC Roorent®Yassalming?oot"y"starkating', “Wotelcapaetty"). soreadeIAlst, stootherares$st(189-2), soine"Seatten Plot Matrix, diagors] = "histograe") ibrary(eorgean) syscedeta. (rno(hotel.dfsoomant, hotel. sstassutnnsngPol, hotel ofshorelcapacity, hotel. cfstarsatne) coregran(iye, order-TRUE, lowerponel-pael. shade, itpssigthub.conshwetu-sohatgiHotel-Pricing-Analyss/lobimastor!Shwotanshu Rohatgi My Project Code.R. 218 7rsro1g HotehPricing-Analysis'Shwetanshu Rohatgi My Project Code.R at master shwett-rohatgiHotetPricing-Analysis~ Gib raine"Coregran of Hotel Prices In India") ccnotel of C"HBsSuinagpool”y Startatiney “WotelCapacty"P1 yecnote. fy e€°Roorzent")] cortesy) coeur) verter soontentAf hotel. df[anien(hatelcfRoceRent 0200), ) ‘awaring othr factors and their pattern using other trencs with rooment oatyzing Leskeng effect on Roontent ‘sole (novel .et5tatechend) astenc-tebe(hotelefstoneckend) barplot(eebed, naine"Distribution of Weekend, sdab=rhat weckene(0) ewena(s)"s colerange”) sn agregate(Roontent ~ Iakedkend, boaplot(Reantent-toheckend Astshotel. df, mains“oon rent vt. inekend”, ylsbe"or weekend bosplot(Rooent-Teheekend dstaRoonSentl.df,saina"Rooa rent vs. Talekeré", ylabe'Not weekene(8) wnetend(1)", xlate"Raon Rent ‘aoletnotel.s0ate) Morary(isttice) histopran(-ate, data = hotel.ef, masne"Otstribution of Dates, 2 = "obefernt of sates", col-oiue") > seareette(Roontent = bate, data ~ note. f,nman) seattorplot(soateyastoonent, waine"Scatterplot between Date ané Raontenc", XabeYDate", ylad = "Roun Rent 39 Rupees") boaplot(Reament-oate,catasotel. df, malne"oam rent ¥S. ate", Al ieferent Dates", ylabetRoce Rent in rupees % eolne(“red", boaplot(Roanent-bate,cata-Roonont-6f, rains"Raon rent vs. ate", wlabo"Otffornt Sater", yla"Raum Rent Sn rupees °, colee(*r noalyeing Etetrocity effect Roonent tavlo(norel.efszanetracity) aplenc-tebie( hotel eeststetrectty) barplot(e2bie, #ain-"Disteibstion of Istetrocity", «le ot 2 netro city) nc = agaregate(Rooment ~ Tsherrocty, dete = hotel, mean) boxplot(Reament-tohetracity,datsshotel.df, mlns"Hoon rent vi. IatetrocSty", yabe'netro eSty(1) or ao8(8)", xLabtoon Rent fn boaplot(Roonant=renetrocty, dacs-RsorSenth Af, aainn*Roen cent vs. Taketracty*, ylabstatee cy(Q) or noR(@)*, late" Ro60 Rent soalyning Tstoursetbestination effect on Roose ‘aalo(notel.astaraursetoertintion) itpssigthub.conshwetu-sohatgHotel-Pricing-Analyss/lobimastortShwetanshu Rohatgi My Project Code.R. 38 7rsro1g HotehPricing-Analysis'Shwetanshu Rohatgi My Project Code.R at master shwett-rohatgiHotetPricing-Analysis~ Gib aolenc-tebe(hotelefsrsTeuisebestination) barplot (cabled, raine"Distribution of IsToursitDestination", xlab"Not # Tourist Destination(®) 15 a Tounst oestinationt Std = aggregate Qountent ~ IsTurdstoestination, date = hotel. mean) bonpt (Roanent-taTouristbestinstion dato tel.df, nine"toon rent ve. IsTourietDestination", ylaie"Lstourdstbestinatian(3) or bosplo (Rooent=rsTouristbestinationdats-Ronfanth.of, eain"Roon rent vs. TsTouristaestination ylabe"TeTouristbessination(2) ‘wole(notel.otSrreeies) ‘eetabLa (hotel. afSFrenksfs) orplot of Freche" labs “FrgeaSes" ,cole'rae") barplot (44, in “ou = seprenste(Goonsent = Frets, cots = hatelua near) muish extrene outliers of roanrent borplot (Roonent=Frockfi,cnta-hotel sable(3)", slsbe'Roon ent sn rupees oaplot(Rooant=FreekiFl,cata-Roonfertddf, ine*Roon rents. Freehifs", ylabefree MifL aatlable(s)*, xlA0-"Rom Rent £m rp able(netel.atsrreelet) ‘cetanie(ntel.sFSFreebeeneFast) barplot (4, asine"torplot of Frecdreskfaet"xlabs “Freekifi" ,cola"red”) (o « aggregate(saortent ~ Fresreac(art, cats -hotel.cf, mean) 2a = aggregate(toontent ~ Fredireakfast, cate aReontent2.df, mean) snuish extreve outliers of roanrent boxplot(Roanent=frecareakfast,data-hotel df, naine*Roon rent vi. FreeSreakfast, ylabetfree arskfast avaélable2)*, slab="Roon bap lot Rooent-Sreebreaefast,atanReomtent. df, maln="Roon rent vs. Freebrektast", ylnoe"Free Qresefast avaiable(4)*, xlAb"k noatyting Airport distance Fron Motel effects in what ty on Roonent sunny (noel. gF54trport) bowplot (hotel. atsningor, ai onplot of Airgort”,xlabe“bistarce of airport fron Rotel)” vc green” shorkzontal = TRUE) #544008 of Mopar atetance on Roantent scatterplotttotel.d¢SAirport tote dfSRooent, neine"hacn rent ve. Airport distance", xlabALrport distance(en)", ylebe"Roon Re enyponests ‘average Reowent 19 hotels faving suineing pool 15 fore than that whieh don't nave ‘test (Rooment-Aasswiemingool, cata = hotel, alternativeress") ‘tested. offlounRentsntel. s#$starRating) ‘test (tocttent-freabreakfast, data = noted, alterratives"Less") test (Ronment-lahetrocity, date - hatel.df,alternative-"lei") itpssigthub.conshwetu-sohatgHotel-Pricing-Analyss/lobimastortShwetanshu Rohatgi My Project Code.R. 45 7rsro1g HotehPricing-Analysis'Shwetanshu Rohatgi My Project Code.R at master shwett-rohatgiHotetPricing-Analysis~ Gib ‘ss.average Roowent {9 hotels having nore hotel capecity £5 ore compared to one with Less capacity ‘test (hatel.onntent,notel.a¢shetelcapacity) eanerating o multiple Linear regression adel for Roonent ‘s216-In(Roonent-starkatingsaSesentngpeolsHorelCapsesty-1, cits = tatel-of) sunary( Fen) sconteicents of the tocel dserscoetfictonts ‘large cata polnts S's not suitable to show tose An the output fe. dela: salary = bo + bavstartating + tatiassuimtngroole paietelcapacity 4 ba -8(assunption), Bt = 1996,874562, 02°3719.6582, 95 -7.650 4 nocel: salary » -1 + 198.a79562"Startating + 3719.6565asSwinnirgfook -7.6s0merotelcaacity 4s220-In(Rsonent-Starkat ingsanSwtnntngPol Hotei CapacstysIsekandsIefourtetDestination-1, dats = hotel.) sunmary (#882) fseascoeefictents ristec estousls and values are checked and the cevistion was around 1968 because of 98, odelt: salary = bo + butstartating + bztasSutmnnghools bstotelcapacity sbétrsMeskerd(@) + pStIstokans(2) + S64TsToL 50 = -U(sssaptson), EL = 3635.828, 926285.282, bBo 13,065, Bée-#D6.67057, bbo-822. 09152, B6H1878.9355 1 mogel: salary = -1 + 3035.8i9tStartating + 2385.182%sSyconingbool -12.s65motelcapeity 1 £306,675) Teeekene(O) = 9325.09152¢Tseskena(l) + 1978.9995*TsTounstoestination #483 In(Rooant- Stara ingsteSusamtngPol Hotel CapacityeALnpore- I, cata ~ hotel. ef) sunmary(fie3) ‘fse3scoeeFietents we = (assumption), EL = 3244.426008 , 0223085.736921, bie -6,745354, Dts 18,885725 4 Yogel: salary = =1 + 1248.426568°Staotting + 3580.726821%SeSwinmingoo) -6.7ENBSEMotelCapaCitY 6 SBTaSrRLpor itpssigthub.convshwetu-sohatgiHotel-Pricing-Analyss/lobimastor!Shwotanshu Rohatgi My Project Code.R. 55

You might also like