runRegressions: Run regressions on a booking Matrix

Description Usage Arguments Details Value Examples

View source: R/bookMatrix.R

Description

Run linear regressions on a cumulative hotel booking matrix

Usage

1
2
3
runRegressions(data1, lag, year1=2016, year2=2015, 
                oneyear=TRUE, wdayyes=TRUE, monthyes=TRUE, bayernholiday=TRUE,  publicholiday=TRUE,
                italholiday=FALSE, season=FALSE, season2=FALSE, clear=FALSE, ...)

Arguments

data1

a data.frame with the variables target (contains bookings on arrival date), a undefined number of lags (contains bookings at the days before arrival) and undefined number of control variables.

lag

number of lag regressed on

year1

The year regressed on

year2

Year that is used for the comparison for the same date years before

oneyear

If TRUE add normalized one year ago on the same date data

wdayyes

If TRUE add weekdays in regression

monthyes

If TRUE add month in regression

bayernholiday

If TRUE add holidays in Bayern in regression

publicholiday

If TRUE add public holidays in Germany in regression

italholiday

If TRUE add holidays in Italy in regression

season

If TRUE add regular season in regression

season2

If TRUE add shorter season in regression

clear

If TRUE short output just inlcuding formula, the first coefficients and the rsquared

...

arguments to be used to form the default control argument if it is not supplied directly.

Details

runRegressions run linear regressions on a cumulative hotel booking matrix

Value

An object of class "lm.fit".

Examples

1
2
3
4
5
6
7
8
##create data
cBM2016 <- data.frame(a <- rnorm(n=30,mean=15), b <- rnorm(n=30,mean=10), b <- rnorm(n=30,mean=10))
colnames(cBM2016) <-  c("target", "lag5", "lagp5")

## use function with sample cBM2016
runRegressions(data1=cBM2016, lag=5, year1=2016, year2=2015, 
                oneyear=FALSE, wdayyes=FALSE, monthyes=FALSE, bayernholiday=FALSE, publicholiday=FALSE,
                italholiday=FALSE, season=FALSE, season2=FALSE, clear=FALSE)

bookMatrix documentation built on May 2, 2019, 5:46 p.m.