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

Generic function `mlcm`

uses different methods to fit the results of a conjoint measurement experiment using `glm`

(Generalized Linear Model). The default method permits fitting the data with a choice of 3 different models. The formula method permits fitting the data with a parametric model.

1 2 3 4 5 6 7 8 9 10 11 | ```
mlcm(x, ...)
## Default S3 method:
mlcm(x, model = "add", whichdim = NULL, lnk = "probit",
control = glm.control(maxit = 50000, epsilon = 1e-14), ...
)
## S3 method for class 'formula'
mlcm(x, p, data,
model = "add", whichdim = NULL,
lnk = "probit", opt.meth = "BFGS",
control = list(maxit = 50000, reltol = 1e-14), ...)
``` |

`x` |
a data frame of an odd number of columns (at least 5) or a formula object. In the case of a data frame, the first should be logical or a 2-level factor named |

`p` |
numeric indicating initial values of parameters for the formula method. |

`data` |
data frame of class ‘mlcm.df’ for the formula method. |

`model` |
character indicating which of three conjoint measurement models to fit to the data: “add”, for additive (default), “ind”, for independence or “full”, for including a dependence with the levels of each dimension with the others. The “full” is not applicable for the formula method. |

`whichdim` |
integer indicating which dimension of the data set to fit when the independence model is chosen |

`lnk` |
character indicating the link function to use with the binomial family. Current default is the probit link. |

`control` |
information to control the fit. See |

`opt.meth` |
character indicating optimization method (default: “BFGS”) for |

`...` |
additional arguments passed to |

In a conjoint measurement experiment, observers are presented with pairs of stimuli that vary along 2 or more dimensions. The observer's task is to choose which stimulus of the pair is greater along one of the dimensions. Over a large number of trials, `mlcm`

estimates numbers,

*ψ_1, ..., ψ_p, ψ'_1, ..., ψ'_q, ...*

,

by maximum likelihood using `glm`

that best predict the observer's judgments.

The function permits the estimation of 3 different models, independent, additive (the default) and full,
by specifying the `model`

argument. The independent model fits the data along only 1 dimension, specified by the `whichdim`

argument. The additive model fits all dimensions with each fixed at 0 at the lowest level on each dimension. Thus, if there are *n* dimensions each with *p_i* levels, `mlcm`

estimates *∑ p_i - n* coefficients.

Specifying the full model will fit a saturated model in which an estimate will be made for each combination of the scale values except the lowest (0 on all scales). This option, now, allows any number of dimensions to be fit.

a list of class ‘mlcm’ that will include some of the following components depending on whether the default or formual method is used:

`pscale ` |
a vector or matrix giving the perceptual scale value estimates |

`stimulus ` |
numeric indicating the scale values along each dimension |

`sigma ` |
numeric indicating judgment |

`par ` |
numeric indicating the fitted parameter values when the formula method is used |

`logLik ` |
log likelihood returned with the formula method |

`hess ` |
Hessian matrix returned with the formual method |

`method ` |
character indicating whether the model was fit by |

`se ` |
standard errors returned with the formula method |

`NumDim` |
numeric indicating number of stimulus dimensions in data set |

`NumLev` |
numeric indicating the number of levels along both dimensions, currently assumed to be the same |

`model` |
character indicating which of the 3 models were fit |

`link` |
character indicating the link used for the binomial family with |

`obj` |
the ‘glm’ object |

`data ` |
the ‘mlcm’ data frame |

`conv ` |
numeric indicating whether convergence was reached in the case of the formula method |

`formula ` |
formula object from argument to formula method |

`func ` |
function constructed from formula object |

`whichdim` |
numeric indicating which dimension was fit in the case of the “ind” model |

Ken Knoblauch

Luce, R. D., and Tukey, J. W. (1964). Simultaneous conjoint measurement.
*Journal of Mathematical Psychology*, **1**,
1–27.

Krantz, D. H., Luce, R. D., Suppes, P., and Tversky, A. (1971).
*Foundations of Measurement, Vol. 1: Additive and Polynomial Representations*.
New York: Academic Press.

Ho, Y. H., Landy. M. S. and Maloney, L. T. (2008). Conjoint measurement of gloss and surface texture. *Psychological Science*, **19**, 196–204.

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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | ```
# Additive model
bg.add <- mlcm(BumpyGlossy)
plot(bg.add, type = "b")
# Independence model for Bumpiness
bg.ind <- mlcm(BumpyGlossy, model = "ind", whichdim = 2)
anova(bg.ind, bg.add, test = "Chisq")
# Full model
bg.full <- mlcm(BumpyGlossy, model = "full")
anova(bg.add, bg.full, test = "Chisq")
opar <- par(mfrow = c(1, 2), pty = "s")
# Compare additive and full model graphically
plot(bg.full, standard.scale = TRUE, type = "b",
lty = 2, ylim = c(0, 1.05),
xlab = "Gloss Level",
ylab = "Bumpiness Model Estimates")
# additive prediction
bg.pr <- with(bg.add, outer(pscale[, 1], pscale[, 2], "+"))
# predictions are same for arbitrary scaling,
# so we adjust additive predictions to best fit
# those from the full model by a scale factor.
cf <- coef(lm(as.vector(bg.full$pscale/bg.full$pscale[5, 5]) ~
as.vector(bg.pr) - 1))
matplot(cf * bg.pr, type = "b", add = TRUE, lty = 1)
#### Now make image of residuals between 2 models
bg.full.sc <- bg.full$pscale/bg.full$pscale[5, 5]
bg.add.adj <- cf * bg.pr
bg.res <- (bg.add.adj - bg.full.sc) + 0.5
image(1:5, 1:5, bg.res,
col = grey.colors(100, min(bg.res), max(bg.res)),
xlab = "Gloss Level", ylab = "Bumpiness Level"
)
#### Example with formula
# additive model
bg.frm <- mlcm(~ p[1] * (x - 1)^p[2] + p[3] * (y - 1)^p[4],
p = c(0.1, 1.3, 1.6, 0.8), data = BumpyGlossy)
summary(bg.frm)
# independence model
bg.frm1 <- mlcm(~ p[1] * (x - 1)^p[2], p = c(1.6, 0.8),
data = BumpyGlossy, model = "ind", whichdim = 2)
summary(bg.frm1)
### Test additive against independent fits
ddev <- -2 * (logLik(bg.frm1) - logLik(bg.frm))
df <- attr(logLik(bg.frm), "df") - attr(logLik(bg.frm1), "df")
pchisq(as.vector(ddev), df, lower = FALSE)
# Compare additive power law and nonparametric models
xx <- seq(1, 5, len = 100)
par(mfrow = c(1, 1))
plot(bg.add, pch = 21, bg = c("red", "blue"))
lines(xx, predict(bg.frm, newdata = xx)[seq_along(xx)])
lines(xx, predict(bg.frm, newdata = xx)[-seq_along(xx)])
AIC(bg.frm, bg.add)
par(opar)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.