--- title: "aaa" author: "Jan de Leeuw" date: "1/16/2017" output: html_document --- ##Breakfast Our next examples uses the breakfast dataset from @green_rao_72, which is also analyzed in Chapter 14 of @borg_groenen_05 and in @deleeuw_mair_A_09c. Forty two individuals were asked to order fifteen breakfast items according to preference. These items are: toast = toast pop-up, butoast = buttered toast, engmuff = English muffin and margarine, jdonut = jelly donut, cintoast = cinnamon toast, bluemuff = blueberry muffin and margarine, hrolls = hard rolls and butter, toastmarm = toast and marmalade, butoastj = buttered toast and jelly, toastmarg = toast and margarine, cinbun = cinnamon bun, danpastry = Danish pastry, gdonut = glazed donut, cofcake = coffee cake, and cornmuff = corn muffin and butter. For this 42 × 15 matrix we compute the unconstrained MDS solution. ```{r breakfast_data, echo = FALSE} data (breakfast, package = "smacof") delta <- matrix(0, 57, 57) delta[1:42, 43:57] <- as.matrix (breakfast) delta <- delta + t(delta) h <- -delta diag(h) <- -rowSums (h) e <- eigen (h) xini <- e\$vectors[, 2:3] w <- matrix(0, 57, 57) w[1:42, 43:57] <- 1 w <- w + t(w) delta <- triangleFromSymmetric(delta, diagonal = FALSE) w <- triangleFromSymmetric(w, diagonal = FALSE) ``` ```{r breakfast_unfold, echo = FALSE, cache = TRUE} h <- smacofUpDown (delta, w = w, xini = xini, verbose = FALSE) ``` ```{r breakfast_plot, fig.align = "center", echo = FALSE} plot(h\$x, type = "n", xlab = "dim 1", ylab = "dim 2") text(h\$x[1:42,], as.character (1:42), col = "RED") text(h\$x[43:57,], names(breakfast), col = "BLUE") ``` #Discussion