rawdata.prep: Preparation of survey raw data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Preparation of survey raw data for further use in a MCI interaction matrix.

Usage

1
rawdata.prep(cols.below1, cols.below2, cols.keep, colnames.new)

Arguments

cols.below1

First list of columns in a survey data frame to arrange one below the other (e.g. destination IDs)

cols.below2

Second list of columns in a survey data frame to arrange one below the other (e.g. obtained destination purchases)

cols.keep

List of columns in a survey data frame that must be kept for all data (e.g. IDs of customer origins)

colnames.new

Character vector of new column names

Details

This function re-orders survey raw data for further use in the function mcimat.create. Sometimes, in a household survey, two or three destinations/stores are obtained instead of one, always arranged in different columns. This function re-orders survey raw data in single columns for further use in the function mcimat.create.

Value

A data frame containing three columns named corresponding to colnames.new

Author(s)

Thomas Wieland

References

Huff, D. L./Batsell, R. R. (1975): “Conceptual and Operational Problems with Market Share Models of Consumer Spatial Behavior”. In: Advances in Consumer Research, 2, p. 165-172.

Wieland, T. (2017): “Market Area Analysis for Retail and Service Locations with MCI”. In: The R Journal, 9, 1, p. 298-323. https://journal.r-project.org/archive/2017/RJ-2017-020/RJ-2017-020.pdf.

Wieland, T. (2018): “Competitive locations of grocery stores in the local supply context - The case of the urban district Freiburg-Haslach”. In: European Journal of Geography, 9, 3, p. 98-115.

See Also

mcimat.create

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(HaslachSurvey)
# survey raw data (Store choices and purchases)

# Preparing raw data (HaslachSurvey)
HaslachSurvey_prepared <- rawdata.prep (cols.below1 = 
list(HaslachSurvey$LM1_Text, HaslachSurvey$LM2_Text),
cols.below2 = list(HaslachSurvey$LM1E, HaslachSurvey$LM2E),
cols.keep = list(HaslachSurvey$WO),
colnames.new = c("LM", "LME", "Wohnort"))
# "WO" and "Wohnort" = origin ID
# "LM1_Text", "LM2_Text" and "LM" = destination IDs (grocery stores)
# "LM1E", "LM2E" and "LME" = grocery store purchases

HaslachSurvey_prepared

MCI2 documentation built on Aug. 2, 2019, 5:04 p.m.