Learn R Programming

MCI (version 1.0.1)

var.check: Checking MCI input variables

Description

This function tests a variable if it matches the standards of the MCI model analysis.

Usage

var.check(x, asdummy = FALSE)

Arguments

x
A vector
asdummy
boolean argument that indicates if a character vector should be regarded as to be transformed to dummy variables

Value

  • Returns a character value depending on the test result: "valid_n" indicates that the variable is valid for MCI analyzes. Otherwise it contains zero/and or negative values ("invalid_zn") or character values ("invalid_s"). If asdummy = TRUE, a character variable is tested as "asdummy".

Details

In the MCI model, only numeric variables with values greater than zero are accepted (From the theoretical perspective, a zero or negative attractivity/utility is just as impossible as zero or negative market shares. In the log-centering transformation, those values cannot be processed.). This function tests a variable if it matches these standards.

References

Colome Perales, R. (2002): Consumer Choice in Competitive Location Models. Barcelona. Hartmann, M. (2005): Gravitationsmodelle als Verfahren der Standortanalyse im Einzelhandel. Statistik Regional Electronic Papers, 02/2005. Halle. 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.

See Also

var.correct

Examples

Run this code
testvar1 <- 1:10
var.check(testvar1)
# returns "valid_n"

testvar2 <- -5:5
var.check(testvar2)
# returns "invalid_zn"

testvar3 <- c("1","5.5", "4", "10.2", "k", "7.6")
var.check(testvar3)
# returns "invalid_s"

testvar4 <- c("Peter", "Paul", "Peter", "Mary", "Peter", "Paul")
var.check(testvar4, asdummy=TRUE)
# returns "asdummy"

Run the code above in your browser using DataLab