Part_time_job Major Commute Housing
1 Yes Business Car With family
2 No Arts Bike Off campus
3 No Arts Car Off campus
4 No Science Car On campus
5 Yes Arts Bike Off campus
6 Yes Science Car With family
Perform MCA on this data set, setting ncp= to the number of dimensions you specified in part B. Verify that the sum of the eigenvalues equal your answer to part A.
In this problem, we consider the hobbies data set which comes preloaded with the FactoMineR package. The data used here concern a questionnaire on hobbies. 8403 individuals were asked questions about their hobbies, as well as demographic information. Use the following subset of the data, called hobbies_use:
Perform MCA on this data set. For each of the first two dimensions of the MCA, find the top-10 variables contributing to these dimensions. Discuss your findings.
Dimension 1 is primarily built by Show_1, Playing music_1, Exhibition_1, Cinema_1, and Computer_1. which shows us Levels for participating in hobbies (_1) have positive coordinates, while levels for non-participation (_0, such as Listening music_0) have negative coordinates. This axis separates individuals who participate in many cultural and leisure activities from those who do not.
Dimension 2 is primarily driven by Knitting_1, Gardening_1, and Fishing_1 on the positive side, and Computer_1 and Cinema_1 on the negative side. its shows that It contrasts home-based and outdoor activities (positive coordinates) against screen and entertainment based activities (negative coordinates).
C)
Use fviz_mca_var() with repel=TRUE to plot the coordinates of the active variables and supplementary variables. Discuss the shortcomings of this plot.
fviz_mca_var(hobbies_mca, repel =TRUE)
There are too many labels on the biplot, so even with repel = TRUE they overlap and become illegible.
Most of the non-participation levels (_0) sit right near the origin (0, 0) because they are the baseline, meaning they contribute very little to inertia and only clutter the display.
fviz_mca_var() lumps all the supplementary categories together under one color instead of using separate colors to distinguish the different demographic variables (Sex, Age, Marital status).
D)
Note that the plot from C has too many labels and isn’t doing a good job repelling them even with repel = TRUE. Let’s use ggplot layers to improve this plot; unfortunately this will require some data wrangling to create the data set we need “from scratch.”
Use the MCA() output to create active_df and supp_df, containing the coordinates of the active and supplementary variables, respectively. Keep only the “top 10” levels of the active variables, as measured by the sum-of-squared coordinates. The first 6 rows of each data frame are shown:
What does this plot suggest about the relationships between hobbies, age, marital status, and sex? Credit will be awarded proportional to thoroughness of response.
Age:
Moving from left to right along Dimension 1, age decreases from (85,100] on the far left to [15,25] on the right. Older individuals on the left with Listening music_0 (fewer hobbies), while younger and middle aged individuals sit on the right with active hobby levels (_1).
Moving from bottom to top along Dimension 2, age increases from [15,25] and (25,35] at the bottom to (45,55], (55,65], and (65,75] near the top. Younger respondents tend to be together with Computer_1 and Cinema_1 in the bottom-right, while older adults align with Knitting_1, Gardening_1, and Fishing_1 at the top.
Marital status:
Single sits in the bottom-right near [15,25] and (25,35], tending to occur together with Cinema_1 and Computer_1.
Married and Remarried sit near the center top alongside (45,55] and (55,65], closer to Gardening_1 and Knitting_1.
Widower sits in the upper-left near (65,75] and (75,85], tending to occur together with Listening music_0. Divorcee sits right near the origin (0, 0), it contributes very little to the inertia on these first two dimensions.
Sex:
Both M and F sit very close to the origin (0, 0) (F slightly positive on Dimension 2 toward Knitting_1/Gardening_1, M slightly negative), showing that sex is not responsible for much inertia compared to age and marital status.
Problem 3
On the public television show The Joy of Painting Bob Ross taught people how to paint lovely scenic landscapes consisting of “snowcapped peaks” and “happy little clouds.” This dataset is a table consisting of different elements (e.g. mountain, river, waterfall, etc.) commonly found within in his paintings. Thus each painting can be thought of as survey respondent where they are asked a series of yes (1) or no (0) questions. This data set contains characteristics of paintings created in 316 of the 403 “Joy of Painting” episodes. Note that MCA requires everything to be factors (aka “categorical”) variables, hence the mutate() command below.
Our goal is to understand what elements Ross tended to use together in paintings, and to find representative paintings with various characteristics.
A)
Perform MCA on the data set, and plot the first two dimensions of the variable coordinates. How would you characterize paintings in each of the four quadrants of this plot? Where are the “summer” and “winter” paintings?
Quadrant I (Dim.1 > 0, Dim.2 > 0): DECIDUOUS_1, GRASS_1, FLOWERS_1, PATH_1, RIVER_1, ROCKS_1, and WATERFALL_1 tend to occur together here. These are warm weather forest, stream, and meadow paintings without snow or mountains.
Quadrant II (Dim.1 < 0, Dim.2 > 0): WINTER_1, SNOW_1, CABIN_1, STRUCTURE_1, FENCE_1, and SUN_1 tend to occur together here along with MOUNTAIN_0. These are snow covered winter paintings featuring cabins and fences rather than mountains.
Quadrant III (Dim.1 < 0, Dim.2 < 0): WINTER_1, SNOW_1, SNOWY_MOUNTAIN_1, MOUNTAIN_1, CONIFER_1, LAKE_1, and CLOUDS_1 tend to occur together here (along with DECIDUOUS_0). These are winter mountain paintings with snow capped peaks, conifers, and lakes.
Quadrant IV (Dim.1 > 0, Dim.2 < 0): SNOWY_MOUNTAIN_1, MOUNTAIN_1, CUMULUS_1, CLOUDS_1, BUSHES_1, WATERFALL_1, ROCKS_1, and RIVER_1 tend to occur together here (along with WINTER_0 and SNOW_0). These are non winter mountain paintings with cumulus clouds, bushes, and waterfalls.
Winter paintings sit on the left side (Dim.1 < 0), where WINTER_1 and SNOW_1 have strong negative coordinates.
Summer (non-winter) paintings sit on the right side (Dim.1 > 0), where WINTER_0, SNOW_0, GRASS_1, FLOWERS_1, RIVER_1, ROCKS_1, and WATERFALL_1 have positive coordinates.
B)
Plot the MCA scores, the coordinates of the individual paintings, filtering to paintings that are “most representative” of each quadrant using the cos2 values. From here, Google image search to find one painting that is representative of each quadrant. Include screenshots of these in your submission, along with discussion of how your selected paintings exemplify the quadrant.
Lazy River has positive coordinates on both Dimension 1 and Dimension 2 (Dim.1 = 0.33, Dim.2 = 0.37) and is well represented by the first two dimensions (cos2 = 0.57).
The painting shows a winding river bordered by green grass and deciduous trees, with no snow and no mountains. This exemplifies Quadrant I because RIVER_1, GRASS_1, DECIDUOUS_1, MOUNTAIN_0, and WINTER_0 all cluster together in the top-right quadrant.
Quadrant II: Winter Hideaway
Winter Hideaway sits in the top-left quadrant (Dim.1 = -0.97, Dim.2 = 0.47, cos2 = 0.68).
The painting shows a snow-covered winter scene centered around a wooden cabin and fence with conifers and deciduous trees, and no mountains in the background.
This exemplifies Quadrant II because WINTER_1, SNOW_1, CABIN_1, STRUCTURE_1, FENCE_1, and MOUNTAIN_0 tend to occur together here.
Quadrant III: Arctic Winter Day
Arctic Winter Day sits in the bottom-left quadrant (Dim.1 = -0.89, Dim.2 = -0.36) and has the highest two-dimensional cos2 (0.80) in the data set.
The painting shows snow capped mountains under a cloudy sky, a frozen lake, heavy snow, evergreen conifers, and a cabin, with no deciduous trees.
This exemplifies Quadrant III because WINTER_1, SNOW_1, SNOWY_MOUNTAIN_1, MOUNTAIN_1, CONIFER_1, LAKE_1, and CLOUDS_1 all sit together in the bottom-left.
Quadrant IV: Mountain Waterfall
Mountain Waterfall sits in the bottom-right quadrant (Dim.1 = 0.16, Dim.2 = -0.72, cos2 = 0.53).
The painting shows mountains in the background feeding a waterfall framed by green conifers and bushes, with no winter snow on the ground.
This exemplifies Quadrant IV because MOUNTAIN_1, WATERFALL_1, CONIFER_1, BUSHES_1, WINTER_0, and SNOW_0 tend to occur together here.