class: middle, inverse .leftcol30[ <center> <img src="https://github.com/emse-madd-gwu/emse-madd-gwu.github.io/raw/master/images/madd_hex_sticker.png" width=250> </center> ] .rightcol70[ # Week 6: .fancy[Conjoint Questions] ### <svg style="height:0.8em;top:.04em;position:relative;fill:white;" viewBox="0 0 512 512"><path d="M496 128v16a8 8 0 0 1-8 8h-24v12c0 6.627-5.373 12-12 12H60c-6.627 0-12-5.373-12-12v-12H24a8 8 0 0 1-8-8v-16a8 8 0 0 1 4.941-7.392l232-88a7.996 7.996 0 0 1 6.118 0l232 88A8 8 0 0 1 496 128zm-24 304H40c-13.255 0-24 10.745-24 24v16a8 8 0 0 0 8 8h464a8 8 0 0 0 8-8v-16c0-13.255-10.745-24-24-24zM96 192v192H60c-6.627 0-12 5.373-12 12v20h416v-20c0-6.627-5.373-12-12-12h-36V192h-64v192h-64V192h-64v192h-64V192H96z"/></svg> EMSE 6035: Marketing Analytics for Design Decisions ### <svg style="height:0.8em;top:.04em;position:relative;fill:white;" viewBox="0 0 448 512"><path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/></svg> John Paul Helveston ### <svg style="height:0.8em;top:.04em;position:relative;fill:white;" viewBox="0 0 448 512"><path d="M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm320-196c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM192 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM64 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z"/></svg> October 06, 2021 ] --- class: inverse # Quiz 2
10
:
00
.leftcol[ ### Link is on the [schedule](https://madd.seas.gwu.edu/2021-Fall/schedule.html) ### Make sure to download the zip file on the first page! ] .rightcol[ <center> <img src="images/quiz_doge.png" width="400"> </center> ] --- # Upcoming events - **Society of Women Engineers (SWE) Conference Boot Camp**:<br>Friday, October 8, 4-5:30 p.m. - **Virtual Media, Journalism, & Public Affairs Fair**:<br>Oct. 19 Time: 4:30 p.m. - 6 p.m. - **Fundamentals of Engineering (FE) Exam Prep Workshop**:<br>November 1, 4-5:30 p.m. - **Virtual Government & Nonprofit Fair**:<br>Nov. 19 Time: 1 p.m. - 4 p.m. --- class: inverse, middle, center # Some RMarkdown tips --- ### .center[Convert a data frame to a markdown table with `kable()`] -- ```r library(tidyverse) mtcars %>% kable() ``` -- .font80[ <table> <thead> <tr> <th style="text-align:left;"> </th> <th style="text-align:right;"> mpg </th> <th style="text-align:right;"> cyl </th> <th style="text-align:right;"> disp </th> <th style="text-align:right;"> hp </th> <th style="text-align:right;"> drat </th> <th style="text-align:right;"> wt </th> <th style="text-align:right;"> qsec </th> <th style="text-align:right;"> vs </th> <th style="text-align:right;"> am </th> <th style="text-align:right;"> gear </th> <th style="text-align:right;"> carb </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Mazda RX4 </td> <td style="text-align:right;"> 21.0 </td> <td style="text-align:right;"> 6 </td> <td style="text-align:right;"> 160.0 </td> <td style="text-align:right;"> 110 </td> <td style="text-align:right;"> 3.90 </td> <td style="text-align:right;"> 2.620 </td> <td style="text-align:right;"> 16.46 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Mazda RX4 Wag </td> <td style="text-align:right;"> 21.0 </td> <td style="text-align:right;"> 6 </td> <td style="text-align:right;"> 160.0 </td> <td style="text-align:right;"> 110 </td> <td style="text-align:right;"> 3.90 </td> <td style="text-align:right;"> 2.875 </td> <td style="text-align:right;"> 17.02 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Datsun 710 </td> <td style="text-align:right;"> 22.8 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 108.0 </td> <td style="text-align:right;"> 93 </td> <td style="text-align:right;"> 3.85 </td> <td style="text-align:right;"> 2.320 </td> <td style="text-align:right;"> 18.61 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Hornet 4 Drive </td> <td style="text-align:right;"> 21.4 </td> <td style="text-align:right;"> 6 </td> <td style="text-align:right;"> 258.0 </td> <td style="text-align:right;"> 110 </td> <td style="text-align:right;"> 3.08 </td> <td style="text-align:right;"> 3.215 </td> <td style="text-align:right;"> 19.44 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Hornet Sportabout </td> <td style="text-align:right;"> 18.7 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 360.0 </td> <td style="text-align:right;"> 175 </td> <td style="text-align:right;"> 3.15 </td> <td style="text-align:right;"> 3.440 </td> <td style="text-align:right;"> 17.02 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Valiant </td> <td style="text-align:right;"> 18.1 </td> <td style="text-align:right;"> 6 </td> <td style="text-align:right;"> 225.0 </td> <td style="text-align:right;"> 105 </td> <td style="text-align:right;"> 2.76 </td> <td style="text-align:right;"> 3.460 </td> <td style="text-align:right;"> 20.22 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Duster 360 </td> <td style="text-align:right;"> 14.3 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 360.0 </td> <td style="text-align:right;"> 245 </td> <td style="text-align:right;"> 3.21 </td> <td style="text-align:right;"> 3.570 </td> <td style="text-align:right;"> 15.84 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Merc 240D </td> <td style="text-align:right;"> 24.4 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 146.7 </td> <td style="text-align:right;"> 62 </td> <td style="text-align:right;"> 3.69 </td> <td style="text-align:right;"> 3.190 </td> <td style="text-align:right;"> 20.00 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Merc 230 </td> <td style="text-align:right;"> 22.8 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 140.8 </td> <td style="text-align:right;"> 95 </td> <td style="text-align:right;"> 3.92 </td> <td style="text-align:right;"> 3.150 </td> <td style="text-align:right;"> 22.90 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Merc 280 </td> <td style="text-align:right;"> 19.2 </td> <td style="text-align:right;"> 6 </td> <td style="text-align:right;"> 167.6 </td> <td style="text-align:right;"> 123 </td> <td style="text-align:right;"> 3.92 </td> <td style="text-align:right;"> 3.440 </td> <td style="text-align:right;"> 18.30 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Merc 280C </td> <td style="text-align:right;"> 17.8 </td> <td style="text-align:right;"> 6 </td> <td style="text-align:right;"> 167.6 </td> <td style="text-align:right;"> 123 </td> <td style="text-align:right;"> 3.92 </td> <td style="text-align:right;"> 3.440 </td> <td style="text-align:right;"> 18.90 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Merc 450SE </td> <td style="text-align:right;"> 16.4 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 275.8 </td> <td style="text-align:right;"> 180 </td> <td style="text-align:right;"> 3.07 </td> <td style="text-align:right;"> 4.070 </td> <td style="text-align:right;"> 17.40 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 3 </td> </tr> <tr> <td style="text-align:left;"> Merc 450SL </td> <td style="text-align:right;"> 17.3 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 275.8 </td> <td style="text-align:right;"> 180 </td> <td style="text-align:right;"> 3.07 </td> <td style="text-align:right;"> 3.730 </td> <td style="text-align:right;"> 17.60 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 3 </td> </tr> <tr> <td style="text-align:left;"> Merc 450SLC </td> <td style="text-align:right;"> 15.2 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 275.8 </td> <td style="text-align:right;"> 180 </td> <td style="text-align:right;"> 3.07 </td> <td style="text-align:right;"> 3.780 </td> <td style="text-align:right;"> 18.00 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 3 </td> </tr> <tr> <td style="text-align:left;"> Cadillac Fleetwood </td> <td style="text-align:right;"> 10.4 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 472.0 </td> <td style="text-align:right;"> 205 </td> <td style="text-align:right;"> 2.93 </td> <td style="text-align:right;"> 5.250 </td> <td style="text-align:right;"> 17.98 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Lincoln Continental </td> <td style="text-align:right;"> 10.4 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 460.0 </td> <td style="text-align:right;"> 215 </td> <td style="text-align:right;"> 3.00 </td> <td style="text-align:right;"> 5.424 </td> <td style="text-align:right;"> 17.82 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Chrysler Imperial </td> <td style="text-align:right;"> 14.7 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 440.0 </td> <td style="text-align:right;"> 230 </td> <td style="text-align:right;"> 3.23 </td> <td style="text-align:right;"> 5.345 </td> <td style="text-align:right;"> 17.42 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Fiat 128 </td> <td style="text-align:right;"> 32.4 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 78.7 </td> <td style="text-align:right;"> 66 </td> <td style="text-align:right;"> 4.08 </td> <td style="text-align:right;"> 2.200 </td> <td style="text-align:right;"> 19.47 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Honda Civic </td> <td style="text-align:right;"> 30.4 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 75.7 </td> <td style="text-align:right;"> 52 </td> <td style="text-align:right;"> 4.93 </td> <td style="text-align:right;"> 1.615 </td> <td style="text-align:right;"> 18.52 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Toyota Corolla </td> <td style="text-align:right;"> 33.9 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 71.1 </td> <td style="text-align:right;"> 65 </td> <td style="text-align:right;"> 4.22 </td> <td style="text-align:right;"> 1.835 </td> <td style="text-align:right;"> 19.90 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Toyota Corona </td> <td style="text-align:right;"> 21.5 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 120.1 </td> <td style="text-align:right;"> 97 </td> <td style="text-align:right;"> 3.70 </td> <td style="text-align:right;"> 2.465 </td> <td style="text-align:right;"> 20.01 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Dodge Challenger </td> <td style="text-align:right;"> 15.5 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 318.0 </td> <td style="text-align:right;"> 150 </td> <td style="text-align:right;"> 2.76 </td> <td style="text-align:right;"> 3.520 </td> <td style="text-align:right;"> 16.87 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> AMC Javelin </td> <td style="text-align:right;"> 15.2 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 304.0 </td> <td style="text-align:right;"> 150 </td> <td style="text-align:right;"> 3.15 </td> <td style="text-align:right;"> 3.435 </td> <td style="text-align:right;"> 17.30 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Camaro Z28 </td> <td style="text-align:right;"> 13.3 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 350.0 </td> <td style="text-align:right;"> 245 </td> <td style="text-align:right;"> 3.73 </td> <td style="text-align:right;"> 3.840 </td> <td style="text-align:right;"> 15.41 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Pontiac Firebird </td> <td style="text-align:right;"> 19.2 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 400.0 </td> <td style="text-align:right;"> 175 </td> <td style="text-align:right;"> 3.08 </td> <td style="text-align:right;"> 3.845 </td> <td style="text-align:right;"> 17.05 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Fiat X1-9 </td> <td style="text-align:right;"> 27.3 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 79.0 </td> <td style="text-align:right;"> 66 </td> <td style="text-align:right;"> 4.08 </td> <td style="text-align:right;"> 1.935 </td> <td style="text-align:right;"> 18.90 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 1 </td> </tr> <tr> <td style="text-align:left;"> Porsche 914-2 </td> <td style="text-align:right;"> 26.0 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 120.3 </td> <td style="text-align:right;"> 91 </td> <td style="text-align:right;"> 4.43 </td> <td style="text-align:right;"> 2.140 </td> <td style="text-align:right;"> 16.70 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 5 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Lotus Europa </td> <td style="text-align:right;"> 30.4 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 95.1 </td> <td style="text-align:right;"> 113 </td> <td style="text-align:right;"> 3.77 </td> <td style="text-align:right;"> 1.513 </td> <td style="text-align:right;"> 16.90 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 5 </td> <td style="text-align:right;"> 2 </td> </tr> <tr> <td style="text-align:left;"> Ford Pantera L </td> <td style="text-align:right;"> 15.8 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 351.0 </td> <td style="text-align:right;"> 264 </td> <td style="text-align:right;"> 4.22 </td> <td style="text-align:right;"> 3.170 </td> <td style="text-align:right;"> 14.50 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 5 </td> <td style="text-align:right;"> 4 </td> </tr> <tr> <td style="text-align:left;"> Ferrari Dino </td> <td style="text-align:right;"> 19.7 </td> <td style="text-align:right;"> 6 </td> <td style="text-align:right;"> 145.0 </td> <td style="text-align:right;"> 175 </td> <td style="text-align:right;"> 3.62 </td> <td style="text-align:right;"> 2.770 </td> <td style="text-align:right;"> 15.50 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 5 </td> <td style="text-align:right;"> 6 </td> </tr> <tr> <td style="text-align:left;"> Maserati Bora </td> <td style="text-align:right;"> 15.0 </td> <td style="text-align:right;"> 8 </td> <td style="text-align:right;"> 301.0 </td> <td style="text-align:right;"> 335 </td> <td style="text-align:right;"> 3.54 </td> <td style="text-align:right;"> 3.570 </td> <td style="text-align:right;"> 14.60 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 5 </td> <td style="text-align:right;"> 8 </td> </tr> <tr> <td style="text-align:left;"> Volvo 142E </td> <td style="text-align:right;"> 21.4 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 121.0 </td> <td style="text-align:right;"> 109 </td> <td style="text-align:right;"> 4.11 </td> <td style="text-align:right;"> 2.780 </td> <td style="text-align:right;"> 18.60 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 1 </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 2 </td> </tr> </tbody> </table> ] --- ### .center[Example from team Omao (cups)] ```r library(tidyverse) library(here) df <- read_csv(here("data", "competitors.csv")) df %>% kable() ``` .font80[ <table> <thead> <tr> <th style="text-align:left;"> brand </th> <th style="text-align:right;"> volumeInOz </th> <th style="text-align:right;"> quantity </th> <th style="text-align:left;"> price </th> <th style="text-align:left;"> pricePerCup </th> <th style="text-align:left;"> biodegrability </th> <th style="text-align:left;"> opacity </th> <th style="text-align:left;"> logo </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> greatValue </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 50 </td> <td style="text-align:left;"> $2.98 </td> <td style="text-align:left;"> $0.06 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> decorRack </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 50 </td> <td style="text-align:left;"> $5.99 </td> <td style="text-align:left;"> $0.12 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> tigerChef </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 100 </td> <td style="text-align:left;"> $7.99 </td> <td style="text-align:left;"> $0.08 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> smartly </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 80 </td> <td style="text-align:left;"> $2.79 </td> <td style="text-align:left;"> $0.03 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> solo </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 50 </td> <td style="text-align:left;"> $4.04 </td> <td style="text-align:left;"> $0.08 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> greatValue </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 100 </td> <td style="text-align:left;"> $3.76 </td> <td style="text-align:left;"> $0.04 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> ecoProducts </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 1000 </td> <td style="text-align:left;"> $187.69 </td> <td style="text-align:left;"> $0.19 </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> </tr> <tr> <td style="text-align:left;"> worldCentric </td> <td style="text-align:right;"> 9 </td> <td style="text-align:right;"> 2000 </td> <td style="text-align:left;"> $220.00 </td> <td style="text-align:left;"> $0.11 </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> </tr> <tr> <td style="text-align:left;"> hefty </td> <td style="text-align:right;"> 18 </td> <td style="text-align:right;"> 50 </td> <td style="text-align:left;"> $3.98 </td> <td style="text-align:left;"> $0.08 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> solo </td> <td style="text-align:right;"> 18 </td> <td style="text-align:right;"> 50 </td> <td style="text-align:left;"> $3.98 </td> <td style="text-align:left;"> $0.08 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> greatValue </td> <td style="text-align:right;"> 18 </td> <td style="text-align:right;"> 120 </td> <td style="text-align:left;"> $5.98 </td> <td style="text-align:left;"> $0.05 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> upAndUp </td> <td style="text-align:right;"> 18 </td> <td style="text-align:right;"> 36 </td> <td style="text-align:left;"> $2.49 </td> <td style="text-align:left;"> $0.07 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> greatValue </td> <td style="text-align:right;"> 16 </td> <td style="text-align:right;"> 25 </td> <td style="text-align:left;"> $1.98 </td> <td style="text-align:left;"> $0.08 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> solo </td> <td style="text-align:right;"> 18 </td> <td style="text-align:right;"> 25 </td> <td style="text-align:left;"> $3.05 </td> <td style="text-align:left;"> $0.12 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> upAndUp </td> <td style="text-align:right;"> 18 </td> <td style="text-align:right;"> 28 </td> <td style="text-align:left;"> $2.99 </td> <td style="text-align:left;"> $0.11 </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> FALSE </td> </tr> <tr> <td style="text-align:left;"> worldCentric </td> <td style="text-align:right;"> 16 </td> <td style="text-align:right;"> 1000 </td> <td style="text-align:left;"> $181.00 </td> <td style="text-align:left;"> $0.18 </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> </tr> <tr> <td style="text-align:left;"> ecoProducts </td> <td style="text-align:right;"> 16 </td> <td style="text-align:right;"> 1000 </td> <td style="text-align:left;"> $279.85 </td> <td style="text-align:left;"> $0.28 </td> <td style="text-align:left;"> TRUE </td> <td style="text-align:left;"> FALSE </td> <td style="text-align:left;"> TRUE </td> </tr> </tbody> </table> ] --- class: center, middle # More `kable()` formatting options:<br>[{kableExtra} package](https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.html) --- # References **Simple approach**: Insert a footnote with `^[]` ### markdown `The Eiffel Tower is 324 meters tall^[From the [Eiffel Tower wikipedia page](https://en.wikipedia.org/wiki/Eiffel_Tower)]` ### render The Eiffel Tower is 324 meters tall<sup>1</sup> .font70[<sup>1</sup>From the [Eiffel Tower wikipedia page](https://en.wikipedia.org/wiki/Eiffel_Tower)] --- # References **Complex (but more complete) approach**: Use bibtex https://bookdown.org/yihui/rmarkdown-cookbook/bibliography.html You can insert citations with `[@citekey]`, and a "References" table will be automatically created. -- <br> **Footnotes are perfectly fine for this class** --- class: inverse, middle # Week 6: .fancy[Conjoint Questions] ### 1. Defining choice questions in R ### 2. Displaying choice questions in RMarkdown ### BREAK ### 3. Choice questions in formr --- class: inverse, middle # Week 6: .fancy[Conjoint Questions] ### 1. .orange[Defining choice questions in R] ### 2. Displaying choice questions in RMarkdown ### BREAK ### 3. Choice questions in formr --- class: center ## Download the [logitr-cars](https://github.com/emse-madd-gwu/logitr-cars) repo from GitHub <center> <img src="images/logitr-cars.png" width=900> </center> --- ## .center[We'll be using the [{conjontTools} package](https://jhelvy.github.io/conjointTools/) today] ```r install.packages("remotes") remotes::install_github("jhelvy/conjointTools") ``` --- # Choice question components ### 1. Define the attributes and levels ### 2. Define a "design of experiment" data frame ### 3. Define a "survey" data frame ??? (A list of every attribute and level in your survey) (A data frame of all possible combinations of every attribute & level) (Randomly assigned questions drawn from the design of experiment) -- <br> # Open `logitr-cars.Rproj` --- class: center # Basic survey Any combination of attributes can be shown in each choice question .leftcol[.font90[ ## Question 1 <table> <tbody> <tr> <td style="text-align:left;"> Option: </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 2 </td> <td style="text-align:left;"> 3 </td> </tr> <tr> <td style="text-align:left;"> Price: </td> <td style="text-align:left;"> $15 </td> <td style="text-align:left;"> $20 </td> <td style="text-align:left;"> $25 </td> </tr> <tr> <td style="text-align:left;"> Fuel Economy: </td> <td style="text-align:left;"> 20 (mpg) </td> <td style="text-align:left;"> 30 (mpg) </td> <td style="text-align:left;"> 25 (mpg) </td> </tr> <tr> <td style="text-align:left;"> Accel. Time: </td> <td style="text-align:left;"> 8 (s) </td> <td style="text-align:left;"> 6 (s) </td> <td style="text-align:left;"> 8 (s) </td> </tr> <tr> <td style="text-align:left;"> Powertrain: </td> <td style="text-align:left;"> Electric </td> <td style="text-align:left;"> Gasoline </td> <td style="text-align:left;"> Gasoline </td> </tr> </tbody> </table> ]] .rightcol[.font90[ ## Question 2 <table> <tbody> <tr> <td style="text-align:left;"> Option: </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 2 </td> <td style="text-align:left;"> 3 </td> </tr> <tr> <td style="text-align:left;"> Price: </td> <td style="text-align:left;"> $15 </td> <td style="text-align:left;"> $15 </td> <td style="text-align:left;"> $25 </td> </tr> <tr> <td style="text-align:left;"> Fuel Economy: </td> <td style="text-align:left;"> 20 (mpg) </td> <td style="text-align:left;"> 25 (mpg) </td> <td style="text-align:left;"> 20 (mpg) </td> </tr> <tr> <td style="text-align:left;"> Accel. Time: </td> <td style="text-align:left;"> 7 (s) </td> <td style="text-align:left;"> 8 (s) </td> <td style="text-align:left;"> 8 (s) </td> </tr> <tr> <td style="text-align:left;"> Powertrain: </td> <td style="text-align:left;"> Gasoline </td> <td style="text-align:left;"> Electric </td> <td style="text-align:left;"> Electric </td> </tr> </tbody> </table> ]] --- class: center # Labeled survey One attribute is used as the "label" - choice options are fixed according to the label .leftcol[.font90[ ## Question 1 <table> <tbody> <tr> <td style="text-align:left;"> Option: </td> <td style="text-align:left;"> Electric </td> <td style="text-align:left;"> Gasoline </td> </tr> <tr> <td style="text-align:left;"> Price: </td> <td style="text-align:left;"> $25 </td> <td style="text-align:left;"> $25 </td> </tr> <tr> <td style="text-align:left;"> Fuel Economy: </td> <td style="text-align:left;"> 30 (mpg) </td> <td style="text-align:left;"> 20 (mpg) </td> </tr> <tr> <td style="text-align:left;"> Accel. Time: </td> <td style="text-align:left;"> 7 (s) </td> <td style="text-align:left;"> 7 (s) </td> </tr> </tbody> </table> ]] .rightcol[.font90[ ## Question 2 <table> <tbody> <tr> <td style="text-align:left;"> Option: </td> <td style="text-align:left;"> Electric </td> <td style="text-align:left;"> Gasoline </td> </tr> <tr> <td style="text-align:left;"> Price: </td> <td style="text-align:left;"> $25 </td> <td style="text-align:left;"> $20 </td> </tr> <tr> <td style="text-align:left;"> Fuel Economy: </td> <td style="text-align:left;"> 20 (mpg) </td> <td style="text-align:left;"> 30 (mpg) </td> </tr> <tr> <td style="text-align:left;"> Accel. Time: </td> <td style="text-align:left;"> 6 (s) </td> <td style="text-align:left;"> 7 (s) </td> </tr> </tbody> </table> ]] --- class: center # Survey with an "Outside Good" An "outside good" means they can choose an "other" option (usually "None") .leftcol[.font90[ ## Question 1 <table> <tbody> <tr> <td style="text-align:left;"> Option: </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 2 </td> <td style="text-align:left;"> 3 </td> <td style="text-align:left;"> None </td> </tr> <tr> <td style="text-align:left;"> Price: </td> <td style="text-align:left;"> $15 </td> <td style="text-align:left;"> $20 </td> <td style="text-align:left;"> $15 </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> Fuel Economy: </td> <td style="text-align:left;"> 30 (mpg) </td> <td style="text-align:left;"> 30 (mpg) </td> <td style="text-align:left;"> 20 (mpg) </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> Accel. Time: </td> <td style="text-align:left;"> 6 (s) </td> <td style="text-align:left;"> 7 (s) </td> <td style="text-align:left;"> 7 (s) </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> Powertrain: </td> <td style="text-align:left;"> Gasoline </td> <td style="text-align:left;"> Gasoline </td> <td style="text-align:left;"> Gasoline </td> <td style="text-align:left;"> </td> </tr> </tbody> </table> ]] .rightcol[.font90[ ## Question 2 <table> <tbody> <tr> <td style="text-align:left;"> Option: </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 2 </td> <td style="text-align:left;"> 3 </td> <td style="text-align:left;"> None </td> </tr> <tr> <td style="text-align:left;"> Price: </td> <td style="text-align:left;"> $15 </td> <td style="text-align:left;"> $20 </td> <td style="text-align:left;"> $20 </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> Fuel Economy: </td> <td style="text-align:left;"> 25 (mpg) </td> <td style="text-align:left;"> 25 (mpg) </td> <td style="text-align:left;"> 30 (mpg) </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> Accel. Time: </td> <td style="text-align:left;"> 7 (s) </td> <td style="text-align:left;"> 8 (s) </td> <td style="text-align:left;"> 6 (s) </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> Powertrain: </td> <td style="text-align:left;"> Electric </td> <td style="text-align:left;"> Electric </td> <td style="text-align:left;"> Electric </td> <td style="text-align:left;"> </td> </tr> </tbody> </table> ]] --- # Attribute-specific features Some attributes may only be valid for certain levels of other attributes > **Example**: The driving range of an electric vehicle (EV) only applies to EVs and not gasoline-powered vehicles. -- <br> To implement this, set the attribute to `0` for the non-applicable cases (do this _after_ using `makeSurvey()`) --- class: inverse
20
:
00
## Your Turn 1. With your team, discuss the specific choice question design for your project - Regular or labeled? - Include a "none" option (outside good) or not? 2. Edit the `make_choice_questions.R` file to design your choice questions. --- class: inverse, middle # Week 6: .fancy[Conjoint Questions] ### 1. Defining choice questions in R ### 2. .orange[Displaying choice questions in RMarkdown] ### BREAK ### 3. Choice questions in formr --- # .center[Displaying your choice questions online] ### 1. Export your choice questions as a .csv file ### 2. Upload your .csv file somewhere ### 3. Use R code to extract the values to display ### 4. Use RMarkdown to display the values --- ### 1. Export your choice questions as a .csv file ```r write_csv(survey, here('choice_questions.csv')) ``` -- ### 2. Upload your .csv file somewhere .leftcol[.center[ ### Inside a formr run (private) <center> <img src="images/upload.png" width=500> </center> ]] .rightcol[.center[ ### github.com (public) .font200[[<svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 496 512"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>](https://github.com/)] [apples example](https://github.com/jhelvy/formr4conjoint) ]] --- ## .center[Use R code to extract the values to display] ### - Read `choice_questions.csv` from web ### - Randomly choose a respondent ID ### - Filter rows for that respondent ID ### - Serialize the data frame to json format --- # .center[Side note on serializing a data frame] .center[Converts a data frame to one long string] ```r df ``` ``` #> altID price fuelEconomy accelTime powertrain #> 1 1 15 20 8 Electric #> 2 2 20 30 6 Gasoline #> 3 3 25 25 8 Gasoline ``` ```r df_json <- jsonlite::toJSON(df) df_json ``` ``` #> [{"altID":1,"price":15,"fuelEconomy":20,"accelTime":8,"powertrain":"Electric"},{"altID":2,"price":20,"fuelEconomy":30,"accelTime":6,"powertrain":"Gasoline"},{"altID":3,"price":25,"fuelEconomy":25,"accelTime":8,"powertrain":"Gasoline"}] ``` --- # .center[Use RMarkdown to display the values] .leftcol[ Create separate data frames for each alternative ```r library(dplyr) alts <- jsonlite::fromJSON(df_json) alt1 <- alts %>% filter(altID == 1) alt2 <- alts %>% filter(altID == 2) alt3 <- alts %>% filter(altID == 3) ``` ] -- .rightcol[ Use RMarkdown formatting to display content in each alternative ```r ***Option 1** ***Price**: $ `r alt1$price` ***Powertrain**: $ `r alt1$powertrain` ***Fuel Economy**: `r alt1$fuelEconomy` mpg ***0-60 Accel. Time**: `r alt1$accelTime` s ``` **Option 1** **Price**: $ 15<br> **Powertrain**: $ Electric<br> **Fuel Economy**: 20 mpg<br> **0-60 Accel. Time**: 8 s ] --- ## .center[Show options in a table with `kable()`] .leftcol[ ```r library(dplyr) alts <- jsonlite::fromJSON(df_json) %>% # Add units to attributes mutate( price = scales::dollar(price), fuelEconomy = paste(fuelEconomy, "(mpg)"), accelTime = paste(accelTime, "(s)")) %>% # Make nicer attribute labels select( `Option:` = altID, `Powertrain:` = powertrain, `Price:` = price, `Fuel Economy:` = fuelEconomy, `Accel. Time:` = accelTime) # Drop row names row.names(alts) <- NULL ``` ] .rightcol[ Display the _transpose_, `t(alts)` ```r kable(t(alts)) ``` <table> <tbody> <tr> <td style="text-align:left;"> Option: </td> <td style="text-align:left;"> 1 </td> <td style="text-align:left;"> 2 </td> <td style="text-align:left;"> 3 </td> </tr> <tr> <td style="text-align:left;"> Powertrain: </td> <td style="text-align:left;"> Electric </td> <td style="text-align:left;"> Gasoline </td> <td style="text-align:left;"> Gasoline </td> </tr> <tr> <td style="text-align:left;"> Price: </td> <td style="text-align:left;"> $15 </td> <td style="text-align:left;"> $20 </td> <td style="text-align:left;"> $25 </td> </tr> <tr> <td style="text-align:left;"> Fuel Economy: </td> <td style="text-align:left;"> 20 (mpg) </td> <td style="text-align:left;"> 30 (mpg) </td> <td style="text-align:left;"> 25 (mpg) </td> </tr> <tr> <td style="text-align:left;"> Accel. Time: </td> <td style="text-align:left;"> 8 (s) </td> <td style="text-align:left;"> 6 (s) </td> <td style="text-align:left;"> 8 (s) </td> </tr> </tbody> </table> ] --- class: center ## Download the [formr4conjoint](https://github.com/jhelvy/formr4conjoint) repo from GitHub (code used in the related [blog post](https://www.jhelvy.com/posts/2021-09-18-choice-based-conjoint-surveys-in-r-with-formr/)) <center> <img src="images/formr4conjoint.png" width=870> </center> --- class: inverse
20
:
00
## Your Turn .leftcol80[ 1. With your team, upload your `choice_questions.csv` file somewhere online, like inside a formr run or on a github repo. 2. Edit the `p2-choice-questions.Rmd` or `p2-choice-questions-table.Rmd` file to implement your choice questions in RMarkdown. You should be able to knit the file to visually test how one of your choice questions is rendering. ] --- class: inverse, middle # Week 6: .fancy[Conjoint Questions] ### 1. Defining choice questions in R ### 2. Displaying choice questions in RMarkdown ### BREAK ### 3. .orange[Choice questions in formr] --- # Your first few rows <br> ### - Read `choice_questions.csv` from web ### - Randomly choose a respondent ID ### - Filter rows for that respondent ID ### - Serialize the data frame to json format --- ### Using the `calculate` type ([example sheet](https://docs.google.com/spreadsheets/d/1Ih3Pt6uz-gp5vc0SBxBzl4K0aZoRLwI6dtdtZiXSLz0/edit#gid=1611481919)) .leftcol[ RMarkdown ```r # Read in the choice questions library(tidyverse) survey <- read_csv("https://raw.githubusercontent.com/jhelvy/formr4conjoint/master/survey/choice_questions.csv") # Define the respondent ID respondentID <- sample(survey$respID, 1) # Create the subset of rows for that respondent ID df <- survey %>% filter(respID == respondentID) %>% mutate(image = paste0("https://raw.githubusercontent.com/jhelvy/formr4conjoint/master/survey/images/", image)) # Convert df to json df_json <- jsonlite::toJSON(df) ``` ] .rightcol[ Google sheet <center> <img src="images/calculate.png" width=100%> </center> ] --- ## Random choice questions as buttons ([example sheet](https://docs.google.com/spreadsheets/d/1Ih3Pt6uz-gp5vc0SBxBzl4K0aZoRLwI6dtdtZiXSLz0/edit#gid=1611481919)) Use the `mc_button` question type .leftcol[ ### `label` - Show your question text - Insert a code chunk to create one-row data frame for each alternative ### `choice` columns - Insert RMarkdown code to display each alternative ] .rightcol[ <center> <img src="images/cbc_buttons.png" width=100%> </center> ] --- ## Random choice questions as table ([example sheet](https://docs.google.com/spreadsheets/d/1EG14Eh9kDBvE_iETfm6l6g90mrQ5sl_zbWaXkwIOGLU)) - Use the `mc_button` question type .leftcol[ ### `label` - Show your question text - Insert a code chunk to modify `alts` data frame & display it using `kable()` - Use [kableExtra](https://haozhu233.github.io/kableExtra/awesome_table_in_html.html#Basic_HTML_table) to control table styling ### `choice` columns - Simple text / number for each option ] .rightcol[ <center> <img src="images/cbc_table.png" width=100%> </center> ] --- class: inverse ## Your Turn 1. Discuss the layout you would prefer to implement for your choice questions (buttons or table). 2. Make a Google Sheet using your team Google account to start implementing your conjoint questions. .leftcol[.center[ ## [buttons example sheet](https://docs.google.com/spreadsheets/d/1Ih3Pt6uz-gp5vc0SBxBzl4K0aZoRLwI6dtdtZiXSLz0/edit#gid=1611481919) ]] .rightcol[.center[ ## [table example sheet](https://docs.google.com/spreadsheets/d/1EG14Eh9kDBvE_iETfm6l6g90mrQ5sl_zbWaXkwIOGLU) ]]