Description Usage Arguments Details Value Author(s) References Examples
This function creates a dataset of dummy variables based on an input character vector.
1 | var.asdummy(x)
|
x |
A character vector |
In MCI analyzes (as in OLS regression models generally) only quantitative information (that means: numeric) is allowed. Qualitative information (e.g. brands, companies, retail chains) can be added using dummy variables [1,0]. This function transforms a character vector x
with c characteristics to a set of c dummy variables whose column names correspond to these characteristics marked with “_DUMMY”.
A data.frame
with dummy variables corresponding to the levels of the input variable.
Thomas Wieland
Nakanishi, M./Cooper, L. G. (1982): “Simplified Estimation Procedures for MCI Models”. In: Marketing Science, 1, 3, p. 314-322.
Tihi, B./Oruc, N. (2012): “Competitive Location Assessment - the MCI Approach”. In: South East European Journal of Economics and Business, 7, 2, p. 35-49.
Wieland, T. (2015): “Raeumliches Einkaufsverhalten und Standortpolitik im Einzelhandel unter Beruecksichtigung von Agglomerationseffekten. Theoretische Erklaerungsansaetze, modellanalytische Zugaenge und eine empirisch-oekonometrische Marktgebietsanalyse anhand eines Fallbeispiels aus dem laendlichen Raum Ostwestfalens/Suedniedersachsens”. Geographische Handelsforschung, 23. 289 pages. Mannheim : MetaGIS.
1 2 3 4 5 6 7 8 9 10 11 12 | charvec <- c("Peter", "Paul", "Peter", "Mary", "Peter", "Paul")
# Creates a vector with three names (Peter, Paul, Mary)
var.asdummy(charvec)
# Returns a data frame with 3 dummy variables
# (Mary_DUMMY, Paul_DUMMY, Peter_DUMMY)
data(grocery2)
# Loads the data
dummyvars <- var.asdummy(grocery2$store_chain)
# Save the dummy variable set into a new dataset
mynewmcidata <- data.frame(grocery2, dummyvars)
# Add the dummy dataset to the input dataset
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.