Description Usage Arguments Details Value References Examples
Calculate weighted reach and frequency statistics from TURF data for all possible combinations of n choose k, for userspecified combination sets, or for Monte Carlo simulated subsets of combinations.
1 
data 
Required. Literal character string representing name of a file in the working directory readable using

n 
Required. Scalar indicating the number of items to be included in the TURF algorithm; 0 < n < ( 
k 
Required. Vector of length 1 to n containing any values 1 to n indicating the combination sizes to be evaluated
by the TURF algorithm. Noninteger values are coerced using 
combos 
Optional. List of combination sets to be evaluated by the TURF algorithm, such as that generated by 
... 
Optional. Additional arguments controlling behavior and output of the TURF algorithm. See 
TURF algorithm is as originally described by Miaoulis, et al. (1990) and outputs reach and frequency statistics for each combination evaluated.
Reach = sum(weights[reached]) / sum(weights), where an individual is considered "reached" if the reach criterion is met for at least
the number of items indicated by the depth
argument in turf.args
. See Markowitz (2005) for a more detailed explanation
of depth of reach.
Frequency = sum(weights x
items_reached) / sum(weights). Frequency includes all individuals, whether reached or not. Frequency
among "reached" individuals may be calculated as Frequency / Reach regardless of weights.
When the combos
argument is omitted from the call, combination sets are generated automatically using turf.combos
and
information passed to it by n, k and any additional arguments passed from turf.args
. The user may also pass any
combination sets (e.g., a usertruncated set) developed in or out of R, so long as the structure of the combination sets corresponds to
that described above.
Monte Carlo simulated combination sets, when requested, are generated using the procedure described by Adler, et al. (2010). Sets of n choose k that result in small numbers of combinations should be run without the Monte Carlo simulation option since they require little processing time (e.g., 12 choose 7 = 792 combinations and will run in less than 1 second). Typically, even larger sets will run in a reasonable amount of time without subsetting (e.g., 18 choose 10 = 43,758 combinations and will run in less than a minute on most computers), but RAM may become a limiting factor, especially when large numbers of individuals are combined with problems involving large numbers of items. The default for substituting Monte Carlo simulated subsets of combinations is set at 10,000. For the above reasons, and because subsetting can lead to duplicate combinations especially when the original set is small, care should be taken to not subset combinations until the original set becomes unmanageably large.
The lack of looping in the algorithm permits processing at about 1,000 combinations per second.
R object:
A list of 2 elements
turf 
A list of 
call 
The call to 
Written to Console:
Combination size(s) evaluated, as k of n; time in seconds required to evaluate all combinations of a given size; total time in seconds required to complete the function call.
Adler, T.J., Smith, C. & Dumont, J. 2010. Optimizing product portfolios using discrete choice modeling and TURF. In: S. Hess, A. Daly (Eds), Choice modeling: the stateoftheart and the stateofpractice; proceedings from the Inaugural International Choice Modeling Conference. Emerald Publishing Group Ltd., pp. 485497.
Krieger, A.M. & Green, P.E. 2000. Turf revisited: Enhancements to toal unduplicated reach and frequency analysis. Marketing Research, 12, 3036.
Markowitz, L. 2005. Going beyond TURF to complement and extend existing product lines. IpsosInsight, November 2005.
Miaoulis, G., Free, V. & Parsons, H. 1990. TURF: A new planning approach for product line extensions. Marketing Research, March, pp. 2840.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39  ##Example 1
##Evaluate all combinations of 3, 4, 5 and 6 items drawn from 10 items.
data(turf_ex_data)
ex1 < turf(turf_ex_data, 10, 3:6)
##Output to Console:
##3 of 10: 0.105068 sec
##4 of 10: 0.1420949 sec
##5 of 10: 0.1511021 sec
##6 of 10: 0.1160791 sec
##total time elapsed: 0.518347 sec
##Example 2
##Pass additional arguments
data(turf_ex_data)
ex2 < turf(turf_ex_data, 10, 3:6, depth=2, keep=20, mc=TRUE, nsims=100)
##Output to Console:
##3 of 10: 0.03802586 sec
##4 of 10: 0.03702521 sec
##5 of 10: 0.0380249 sec
##6 of 10: 0.03802609 sec
##total time elapsed: 0.156105 sec
##Example 3
##Customize combos, exclude item 10 from all combinations of size 3
data(turf_ex_data)
psims < colSums(turf_ex_data[,c(1:2)]) / sum(turf_ex_data[,2])
psims < psims / sum(psims)
combos < turf.combos(10, 3, mc=TRUE, nsims=100, psims=psims)
combos[[1]] < combos[[1]][which(combos[[1]][,10]==1),]
ex3 < turf(turf_ex_data, 10, 3, combos)
##Output to Console:
##3 of 10: 0.02001405 sec
##total time elapsed: 0.02001405 sec

Loading required package: dplyr
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
3 of 10: 0.1563213 sec
4 of 10: 0.1683111 sec
5 of 10: 0.1135831 sec
6 of 10: 0.09579968 sec
total time elapsed: 0.5390496 sec
3 of 10: 0.03218913 sec
4 of 10: 0.06904626 sec
5 of 10: 0.03043771 sec
6 of 10: 0.02919936 sec
total time elapsed: 0.192512 sec
3 of 10: 0.01686335 sec
total time elapsed: 0.01694083 sec
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.