About this rpubs document - Heteropraxia and Homopraxia

The goal in this Rpubs document is to show how I combined variables from two different questions about parental practices to create a space of parental practices. The practices are gathered from a respondent (mother or father), who then answers questions about which organizations he or she either is active in (cultural organization, voluntary organization etc) or has previously been active in, and supplies the same for his or her spouse or cohabitor (what I term “The second adult in the household”). There are single parent households also, but these have been excluded for this particular analysis. Organizational history is then analysed together with audience consuption habits from the past four months, for first parent and for second parent (as reported by first parent). This results in a space of organized and audience activities.

The main goal is to look into how practices are structured, and especially look for gendered differences in roles in the household.

The academic use of this excercise is to analyse if there is a homologous relationship between parental practices and children’s practices, and secondly to investigate whether or not parental practices form mostly similar or dissimilar practices between parents (What Octobre 2008 terms Homopraxia and Heteropraxia), which she identifies as strengthening or weakening reproduction of spatial positions.

To do this I will

  • Contruct data on organized activities
  • Construct data on audience participation
  • Combine data and run MCA
  • Check if the logic structuring the space for men and women is the same using Class Specific Analysis
  • Run HCPC-clustering to further analyse the dimensions of the MCA
  • Use the clusters to explore Homopraxia and Heteropraxia
  • … which could perhaps be used in my actual analysis of childrens space of organized activities and cultural transmission

Packages and data

library(tidyverse)
library(FactoMineR)
library(factoextra)
library(janitor)
library(corrplot)
library(haven)
library(kableExtra)
library(grid)
library(gridExtra)

# Henter inn omkodinger fra bfp runde1.
source("C:/Andreas/R/Rpubs/Source_RMD.R")
source_rmd("C:/Andreas/R/Rpubs/Grunnomkodinger bfp.Rmd") # Loads bfp and recodes it.
gdata::keep(bfp, sure = TRUE)

df <- read_sav("C:/Andreas/R/Rpubs/BFP/BKKN - kulturkonsum i barnefamilier - r1.sav")
df2 <- read_sav("C:/Andreas/R/Rpubs/BFP2/BKKN - kulturkonsum i barnefamilier - r2.sav")
df3 <- read_sav("C:/Andreas/R/Rpubs/BFP3/BKKN - kulturkonsum i barnefamilier - r3.sav")

Constructing data for MCA

Participation in organizations for parents

praxis_f1 <- df %>% 
  filter(status == 1, r1reg2==2) %>% 
  haven::zap_label() %>% haven::zap_formats() %>% haven::zap_labels() %>%
  select(ID_resp, voksen_kjonn, contains("r1q12_1_now"), contains("r1q12_1_prev")) %>% 
  mutate(`Cultural org` = ifelse(r1q12_1_now_1==1, "Active", 
                                 ifelse(r1q12_1_prev_1==1, "Previously active", "Never")),
         `Religious org` = ifelse(r1q12_1_now_2==1, "Active", 
                                 ifelse(r1q12_1_prev_2==1, "Previously active", "Never")),
         `Voluntary org` = ifelse(r1q12_1_now_3==1, "Active", 
                                  ifelse(r1q12_1_prev_3==1, "Previously active", "Never")),
         `Political org` = ifelse(r1q12_1_now_4==1, "Active", 
                                  ifelse(r1q12_1_prev_4==1, "Previously active", "Never")),
         `Athletics org` = ifelse(r1q12_1_now_5==1, "Active", 
                                  ifelse(r1q12_1_prev_5==1, "Previously active", "Never")),
         `Outdoors org` = ifelse(r1q12_1_now_6==1, "Active", 
                                  ifelse(r1q12_1_prev_6==1, "Previously active", "Never")),
         `Physical excercise` = ifelse(r1q12_1_now_7==1, "Active", 
                                  ifelse(r1q12_1_prev_7==1, "Previously active", "Never"))) %>% 
  mutate(FID = "F1") %>% 
  select(ID_resp, FID, voksen_kjonn, contains("org"), contains("exercise"))  


praxis_f2 <- df %>% 
  filter(status == 1, r1reg2==2) %>% 
  haven::zap_label() %>% haven::zap_formats() %>% haven::zap_labels() %>%
  select(ID_resp, voksen_kjonn, contains("r1q12_2_now"), contains("r1q12_2_prev")) %>% 
  mutate(`Cultural org` = ifelse(r1q12_2_now_1==1, "Active", 
                                 ifelse(r1q12_2_prev_1==1, "Previously active", "Never")),
         `Religious org` = ifelse(r1q12_2_now_2==1, "Active", 
                                  ifelse(r1q12_2_prev_2==1, "Previously active", "Never")),
         `Voluntary org` = ifelse(r1q12_2_now_3==1, "Active", 
                                  ifelse(r1q12_2_prev_3==1, "Previously active", "Never")),
         `Political org` = ifelse(r1q12_2_now_4==1, "Active", 
                                  ifelse(r1q12_2_prev_4==1, "Previously active", "Never")),
         `Athletics org` = ifelse(r1q12_2_now_5==1, "Active", 
                                  ifelse(r1q12_2_prev_5==1, "Previously active", "Never")),
         `Outdoors org` = ifelse(r1q12_2_now_6==1, "Active", 
                                 ifelse(r1q12_2_prev_6==1, "Previously active", "Never")),
         `Physical excercise` = ifelse(r1q12_2_now_7==1, "Active", 
                                       ifelse(r1q12_2_prev_7==1, "Previously active", "Never"))) %>% 
  mutate(FID = "F2") %>% 
  select(ID_resp, FID, voksen_kjonn, contains("org"), contains("exercise")) %>% 
  mutate(voksen_kjonn = ifelse(voksen_kjonn==2, 1, 2))


# Key is made from respondent-ID and FIC, which denotes if this row is 
# a respondent (Called F1) or the second adult as reported by the respondent (called F2).
# When F1 is female, F2 is assumed to be male, and vice versa. 
praxis <- bind_rows(praxis_f1, praxis_f2) %>% 
  mutate(Key = paste0(ID_resp, FID))

# Quick glance at initial MCA shows that the MCA struggles with
# Active and previously active, and that this dominates axis 1 
# In the analysis. 
# Recoding needed
res.praxis <- MCA(praxis %>% select(-c(ID_resp, voksen_kjonn, FID, Key)))
fviz_mca_var(res.praxis)
GDAtools::modif.rate(res.praxis)


# Recoding involves flattening of "Active" and "Previously active"
# Generating Yes and No
praxis_flat <- praxis %>% 
  mutate_at(vars(contains( names(praxis)[4:9]  )), ~ifelse(. == "Never", "No", "Yes"))

# Generate a numerical version for use in paran:paran, a parallell analysis. 
praxis_flat_num <- praxis %>% 
  mutate_at(vars(contains( names(praxis)[4:9]  )), ~ifelse(. == "Never", 0, 1))

Parrallel analysis with paran

Checking the data with a parallel analysis.

paran::paran(praxis_flat_num %>% select(-c(ID_resp, voksen_kjonn, FID, Key)))
## 
## Using eigendecomposition of correlation matrix.
## Computing: 10%  20%  30%  40%  50%  60%  70%  80%  90%  100%
## 
## 
## Results of Horn's Parallel Analysis for component retention
## 180 iterations, using the mean estimate
## 
## -------------------------------------------------- 
## Component   Adjusted    Unadjusted    Estimated 
##             Eigenvalue  Eigenvalue    Bias 
## -------------------------------------------------- 
## 1           1.503497    1.540563      0.037066
## 2           1.005988    1.026642      0.020654
## -------------------------------------------------- 
## 
## Adjusted eigenvalues > 1 indicate dimensions to retain.
## (2 components retained)

Eigenvalues

GDAtools::modif.rate(res.praxis.flat)
## $raw
##           eigen     rate  cum.rate
## dim 1 0.2567606 25.67606  25.67606
## dim 2 0.1711071 17.11071  42.78677
## dim 3 0.1598462 15.98462  58.77139
## dim 4 0.1536742 15.36742  74.13881
## dim 5 0.1330831 13.30831  87.44712
## dim 6 0.1255288 12.55288 100.00000
## 
## $modif
##            mrate cum.mrate
## dim 1 99.7576683  99.75767
## dim 2  0.2423317 100.00000

Visually checking the MCA

Contributions

Var Ctr.1 Ctr.2
Voluntary org_Yes 23.4643676 0.0453990
Cultural org_Yes 18.7587424 3.1999372
Religious org_Yes 17.5662852 9.3975732
Political org_Yes 17.2294714 1.9594617
Voluntary org_No 6.4119764 0.0124059
Outdoors org_Yes 5.6538272 27.1969929
Cultural org_No 3.9448962 0.6729353
Athletics org_Yes 2.0977381 29.9996626
Athletics org_No 1.5717664 22.4777630
Religious org_No 1.5364959 0.8219913
Political org_No 0.9095216 0.1034375
Outdoors org_No 0.8549117 4.1124404

       

Audience participation data

##### Consumption ####
# First parent (F1)
consumpt_f1 <- df %>% 
  filter(status == 1, r1reg2==2) %>% 
  haven::zap_label() %>% haven::zap_formats() %>% haven::zap_labels() %>%
  select(ID_resp, voksen_kjonn, contains("r1q17_1_")) %>% 
  mutate(FID = "F1")

# Gathering variable names from dataframe-labels. 
la_b <- df %>% 
  select(ID_resp, contains("r1q17_1_")) %>% 
  labelled::var_label() 
la <- tibble(Var = names(la_b), Values = unlist(la_b)) %>% 
  mutate(labels = gsub("\\s*\\([^\\)]+\\)","", Values))

la$labels[la$Var == "r1q17_1_1"] = "Classical-Jazz"
la$labels[la$Var == "r1q17_1_2"] = "Pop-etc"

names(consumpt_f1)[3:17] <- la$labels[2:16]

# Second adult in the household (F2)
consumpt_f2 <- df %>% 
  filter(status == 1, r1reg2==2) %>% 
  haven::zap_label() %>% haven::zap_formats() %>% haven::zap_labels() %>%
  select(ID_resp, voksen_kjonn, contains("r1q17_2_")) %>% 
  mutate(voksen_kjonn = ifelse(voksen_kjonn==2, 1, 2),
         FID = "F2")

la_b <- df %>% 
  select(ID_resp, contains("r1q17_2_")) %>% 
  labelled::var_label() 
la <- tibble(Var = names(la_b), Values = unlist(la_b)) %>% 
  mutate(labels = gsub("\\s*\\([^\\)]+\\)","", Values))

la$labels[la$Var == "r1q17_2_1"] = "Classical-Jazz"
la$labels[la$Var == "r1q17_2_2"] = "Pop-etc"

names(consumpt_f2)[3:17] <- la$labels[2:16]

# Same Key as above
consumpt <- bind_rows(consumpt_f1, consumpt_f2) %>% 
  mutate(Key = paste0(ID_resp, FID))

Frequencies of the categories

Category Share
Kino 0.5145656
Idretts- eller sportsarrangement 0.4347770
Folkefest eller annet offentlig utendørsarrangement 0.3029131
Låne bøker på bibliotek 0.2958237
Teater 0.2626966
Pop-etc 0.2481310
Museum eller kulturminne 0.1992782
Stand-up eller revy 0.1469451
Classical-Jazz 0.1223253
Kunstutstilling 0.1161382
Festival 0.1113689
Dans 0.0766950
Arrangement på bibliotek 0.0653519
Litteraturarrangement 0.0540088
Åpent verksted 0.0339005
# Recode to character
consumpt_chr <- consumpt %>% 
  mutate_at(vars(contains( names(consumpt)[3:17]  )), ~ifelse(. == 0, "No", "Yes"))
# Cloud of individuals reveal something that resembles a comet tail.
# Needs some recoding
res_cons <- MCA(consumpt_chr %>% select(-c(ID_resp, voksen_kjonn, FID, Key)))
fviz_mca_var(res_cons)
fviz_mca_ind(res_cons, geom.ind = "point", alpha.ind = .2)
GDAtools::modif.rate(res_cons)

# Joining some categories to eliminate the comet tail. 
cons_chr_rec <- consumpt_chr %>% 
  select(-(`Åpent verksted`)) %>% 
  mutate(Literature = ifelse(`Arrangement på bibliotek`=="Yes" | Litteraturarrangement == "Yes", "Yes", "No"),
         Festival = ifelse(`Folkefest eller annet offentlig utendørsarrangement`=="Yes" | Festival == "Yes", "Yes", "No")) %>% 
  select(-c(`Arrangement på bibliotek`, Litteraturarrangement, `Låne bøker på bibliotek`, `Folkefest eller annet offentlig utendørsarrangement`))

Parallel analysis with paran

# Paran
cons_num <- cons_chr_rec %>% 
  mutate_at(vars(contains( names(cons_chr_rec)[c(3:13,15)]  )), ~ifelse(. == "Yes", 1, 0)) %>% 
  select(-c(ID_resp, voksen_kjonn, FID, Key))
paran::paran(cons_num)
## 
## Using eigendecomposition of correlation matrix.
## Computing: 10%  20%  30%  40%  50%  60%  70%  80%  90%  100%
## 
## 
## Results of Horn's Parallel Analysis for component retention
## 330 iterations, using the mean estimate
## 
## -------------------------------------------------- 
## Component   Adjusted    Unadjusted    Estimated 
##             Eigenvalue  Eigenvalue    Bias 
## -------------------------------------------------- 
## 1           2.198644    2.258030      0.059386
## 2           1.195131    1.239192      0.044060
## -------------------------------------------------- 
## 
## Adjusted eigenvalues > 1 indicate dimensions to retain.
## (2 components retained)

MCA for audience participation

res_cons <- MCA(cons_chr_rec %>% select(-c(ID_resp, voksen_kjonn, FID, Key)))
res.cons.df <- inspect.mca(res_cons) %>% 
  mutate(fontfam = ifelse((Ctr.1>mean(Ctr.1) & Ctr.2>mean(Ctr.2)), 4,
                          ifelse(Ctr.1>mean(Ctr.1), 3, 
                                 ifelse(Ctr.2>mean(Ctr.2), 2, 1))))

Eigenvalues

GDAtools::modif.rate(res_cons)
## $raw
##             eigen      rate  cum.rate
## dim 1  0.20527553 20.527553  20.52755
## dim 2  0.11265386 11.265386  31.79294
## dim 3  0.08931687  8.931687  40.72463
## dim 4  0.08754506  8.754506  49.47913
## dim 5  0.08117247  8.117247  57.59638
## dim 6  0.07779041  7.779041  65.37542
## dim 7  0.07724911  7.724911  73.10033
## dim 8  0.07436538  7.436538  80.53687
## dim 9  0.07131104  7.131104  87.66797
## dim 10 0.06950664  6.950664  94.61863
## dim 11 0.05381365  5.381365 100.00000
## 
## $modif
##           mrate cum.mrate
## dim 1 96.511092  96.51109
## dim 2  3.488908 100.00000

Visualizing MCA for audience participation

fviz_mca_var(res_cons)

fviz_mca_ind(res_cons, geom.ind = "point", alpha.ind = .2)

Contributions, audience participation

Var Ctr.1 Ctr.2
Kunstutstilling_Yes 16.7551793 4.4359820
Museum eller kulturminne_Yes 13.8342861 2.3051126
Teater_Yes 10.1724437 0.8091202
Literature_Yes 9.4301526 5.5346252
Classical-Jazz_Yes 8.1498980 4.6246517
Pop-etc_Yes 6.1987379 9.8151584
Festival_Yes 5.8650939 0.1093031
Dans_Yes 4.6415734 0.5483173
Teater_No 3.6243777 0.2882844
Museum eller kulturminne_No 3.4429823 0.5736806
Kino_No 3.2436547 7.6036403
Festival_No 3.1845080 0.0593471
Kino_Yes 3.0600209 7.1731737
Kunstutstilling_No 2.2016066 0.5828817
Pop-etc_No 2.0457004 3.2391874
Stand-up eller revy_Yes 1.1889509 25.2873112
Classical-Jazz_No 1.1358868 0.6445579
Literature_No 1.0510972 0.6168966
Dans_No 0.3855558 0.0455464
Stand-up eller revy_No 0.2048057 4.3559285
Idretts- eller sportsarrangement_Yes 0.1037116 12.0659814
Idretts- eller sportsarrangement_No 0.0797763 9.2813125

       

Data on volunteering added

## Done volunteer work recently #####

friv <- df %>% select(ID_resp, r1q30_1, r1q30_2)

friv_F1 <- friv %>% 
  select(ID_resp, r1q30_1) %>% 
  mutate(`Volunteered` = ifelse(r1q30_1==1, "Yes", "No")) %>% 
  select(-r1q30_1) %>% 
  mutate(FID = "F1")


friv_F2 <- friv %>% 
  select(ID_resp, r1q30_2) %>% 
  mutate(`Volunteered` = ifelse(r1q30_2==1, "Yes", "No")) %>% 
  select(-r1q30_2) %>% 
  mutate(FID = "F2")

friv.comb <- bind_rows(friv_F1, friv_F2) %>% 
  mutate(Key = paste0(ID_resp, FID))

       

MCA for the whole space

Combining the data sources

comb.all <- left_join(praxis_flat, cons_chr_rec, by = c("Key" = "Key")) %>% 
  left_join(friv.comb, by = c("Key" = "Key"))

comb.run <- select(comb.all, -c(contains("ID_resp"), contains("FID"), Key)) %>% 
  select(-voksen_kjonn.y) %>% 
  rename(VK = voksen_kjonn.x) %>% 
  mutate(VK = ifelse(VK==1, "Mann", "Kvinne"))

Run MCA full space

res.comb <- MCA(comb.run, quali.sup = 1, graph=FALSE)

Eigenvalues full space

GDAtools::modif.rate(res.comb)
## $raw
##             eigen      rate  cum.rate
## dim 1  0.14213286 14.213286  14.21329
## dim 2  0.08556556  8.556556  22.76984
## dim 3  0.07785418  7.785418  30.55526
## dim 4  0.05907273  5.907273  36.46253
## dim 5  0.05779534  5.779534  42.24207
## dim 6  0.05454356  5.454356  47.69642
## dim 7  0.05032264  5.032264  52.72869
## dim 8  0.04941781  4.941781  57.67047
## dim 9  0.04904059  4.904059  62.57453
## dim 10 0.04812520  4.812520  67.38705
## dim 11 0.04670440  4.670440  72.05749
## dim 12 0.04500707  4.500707  76.55819
## dim 13 0.04364425  4.364425  80.92262
## dim 14 0.04221457  4.221457  85.14407
## dim 15 0.04213663  4.213663  89.35774
## dim 16 0.03957265  3.957265  93.31500
## dim 17 0.03447042  3.447042  96.76204
## dim 18 0.03237955  3.237955 100.00000
## 
## $modif
##             mrate cum.mrate
## dim 1 84.11805014  84.11805
## dim 2 10.10678718  94.22484
## dim 3  5.58003891  99.80488
## dim 4  0.13882548  99.94370
## dim 5  0.05629829 100.00000

Contributions and coordinates full space

res.comb.df <- inspect.mca(res.comb) %>% 
  mutate(fontfam = ifelse((Ctr.1>mean(Ctr.1) & Ctr.2>mean(Ctr.2)), 4,
                          ifelse(Ctr.1>mean(Ctr.1), 3, 
                                 ifelse(Ctr.2>mean(Ctr.2), 2, 1))))

res.comb.df %>%  
  select(Var, Ctr.1, Ctr.2, Ctr.3, Coord.1, Coord.2, Coord.3) %>% 
  arrange(desc(Ctr.1)) %>% 
  kbl() %>%
  kable_classic()
Var Ctr.1 Ctr.2 Ctr.3 Coord.1 Coord.2 Coord.3
Kunstutstilling_Yes 12.0480409 4.7439841 0.0643384 1.6291242 -0.7931765 0.0881099
Museum eller kulturminne_Yes 10.1614985 3.1488343 0.0064140 1.1421747 -0.4933224 0.0212379
Classical-Jazz_Yes 7.1299544 1.1622668 1.9384619 1.2211490 -0.3825432 0.4712460
Teater_Yes 7.0037984 2.8880600 1.8561317 0.8258917 -0.4114922 -0.3146693
Literature_Yes 6.9686589 3.9955703 0.7135870 1.3333470 -0.7833579 0.3157808
Voluntary org_Yes 6.0909663 7.8661292 4.0645046 0.8521075 0.7513357 0.5151679
Cultural org_Yes 6.0128524 1.7457027 5.5677967 0.9409222 0.3933696 0.6701142
Festival_Yes 5.0123937 0.0499787 0.1246716 0.6036701 -0.0467705 -0.0704619
Pop-etc_Yes 4.1540321 0.4686538 8.1583109 0.6544522 -0.1705577 -0.6787922
Political org_Yes 3.6033348 1.8310683 5.4898536 1.3559257 0.7499600 1.2386759
Dans_Yes 3.3782516 1.1037537 0.0003674 1.0615633 -0.4708019 0.0081936
Festival_No 2.7215264 0.0271364 0.0676916 -0.3277684 0.0253945 0.0382580
Volunteered_Yes 2.5891097 17.8429078 0.0493458 0.4751683 0.9678484 -0.0485502
Museum eller kulturminne_No 2.5289241 0.7836603 0.0015963 -0.2842566 0.1227747 -0.0052855
Teater_No 2.4954093 1.0289976 0.6613280 -0.2942600 0.1466121 0.1121147
Kino_No 2.1534928 0.2124828 4.9521176 -0.3368914 0.0821074 0.3781007
Kino_Yes 2.0315767 0.2004535 4.6717623 0.3178189 -0.0774591 -0.3566952
Voluntary org_No 1.6644443 2.1495331 1.1106844 -0.2328506 -0.2053133 -0.1407770
Kunstutstilling_No 1.5830954 0.6233527 0.0084540 -0.2140646 0.1042223 -0.0115775
Religious org_Yes 1.3951445 5.9215238 12.3171591 0.6661556 1.0648418 1.4649240
Pop-etc_No 1.3709089 0.1546646 2.6923965 -0.2159816 0.0562873 0.2240142
Cultural org_No 1.2644813 0.3671150 1.1708877 -0.1978726 -0.0827242 -0.1409226
Volunteered_No 1.0749387 7.4079639 0.0204872 -0.1972789 -0.4018283 0.0201569
Classical-Jazz_No 0.9937328 0.1619902 0.2701719 -0.1701969 0.0533167 -0.0656796
Athletics org_Yes 0.7784618 7.8754484 5.4952313 0.2156313 0.5321488 -0.4240137
Literature_No 0.7767359 0.4453515 0.0795373 -0.1486166 0.0873141 -0.0351973
Stand-up eller revy_Yes 0.6530794 0.0017922 13.8030116 0.3372011 -0.0137055 -1.1473254
Athletics org_No 0.5832759 5.9008151 4.1173965 -0.1615655 -0.3987217 0.3176996
Outdoors org_Yes 0.3839587 3.4532292 0.4046476 0.2734724 0.6363356 0.2077799
Idretts- eller sportsarrangement_Yes 0.3563742 8.5963748 9.2219531 0.1448116 0.5518361 -0.5451994
Dans_No 0.2806170 0.0916841 0.0000305 -0.0881796 0.0391075 -0.0006806
Idretts- eller sportsarrangement_No 0.2741277 6.6124452 7.0936483 -0.1113910 -0.4244797 0.4193746
Political org_No 0.1902154 0.0966597 0.2898023 -0.0715776 -0.0395894 -0.0653881
Religious org_No 0.1220311 0.5179466 1.0773630 -0.0582676 -0.0931401 -0.1281346
Stand-up eller revy_No 0.1124978 0.0003087 2.3776720 -0.0580854 0.0023609 0.1976354
Outdoors org_No 0.0580582 0.5221606 0.0611865 -0.0413516 -0.0962199 -0.0314183

Visual inspection of MCA

fviz_mca_ind(res.comb, geom.ind = "point", alpha.ind = .1)

fviz_mca_var(res.comb)

My own visualizations

ggplot() + 
  geom_hline(yintercept = 0, linetype = "dashed", alpha = .5) +
  geom_vline(xintercept = 0, linetype = "dashed", alpha = .5) +
  geom_point(data = res.comb.df, aes(Coord.1, Coord.2), shape = 2) +
  ggrepel::geom_text_repel(data = res.comb.df, aes(Coord.1, Coord.2, label = Var, fontface = fontfam), max.overlaps = Inf, min.segment.length = 0, seed = 42, box.padding = 0.5) +
  labs(title = "Axis 1 and 2") +
  coord_fixed()

ggplot() + 
  geom_hline(yintercept = 0, linetype = "dashed", alpha = .5) +
  geom_vline(xintercept = 0, linetype = "dashed", alpha = .5) +
  geom_point(data = res.comb.df, aes(Coord.2, Coord.3), shape = 2) +
  ggrepel::geom_text_repel(data = res.comb.df, aes(Coord.2, Coord.3, label = Var, fontface = fontfam), max.overlaps = Inf, min.segment.length = 0, seed = 42, box.padding = 0.5) +
  labs(title = "Axis 2 and 3") +
  coord_fixed()

       

HCPC for the space

res.hcpc <- HCPC(res.comb, nb.clust = -1)

Cluster visualization

fviz_cluster(res.hcpc, geom = "point")

Tabyl of clusters

res.hcpc$data.clust$clust %>% tabyl() %>% kbl() %>% kable_classic()
. n percent
1 3792 0.4887858
2 2518 0.3245682
3 1448 0.1866460

Cluster tables

cl1 <- make.clust(res.hcpc, 1)
cl2 <- make.clust(res.hcpc, 2)
cl3 <- make.clust(res.hcpc, 3)

Cluster 1 - “Less active”

The first and largest cluster is mainly characterized in the lack of volunteering, and a smaller investment into legitime culture. One simplification could be that while cluster 2 attends sports events and cluster 3 attend highly legitimate arts events, cluster 1 rarely attend either of these. As with the difference in attendance, cluster 1 less frequently see a history of organizational participation, and very little volunteering.

Cluster 1 is in fact not only underrepresented in highly legitimate events and sports event, it is underrepresented in all event types, and all organizational types. The category with greates distance from cluster 1 to global is Arts exhibitions-yes.

Men are ever so slightly overrepresented, with 51.3 to 48.6.

It is tempting to label cluster 1 “Less active”, but there is also a greater aversion towards highly legitimate events.

Variable Cla/Mod Mod/Cla Global v.test p.value
Volunteered=Volunteered_No 64.155 92.748 70.663 Inf 0.000
Idretts-.eller.sportsarrangement=Idretts- eller sportsarrangement_No 71.152 82.278 56.522 Inf 0.000
Athletics.org=Athletics org_No 68.568 80.195 57.167 Inf 0.000
Volunteered=Volunteered_Yes 12.083 7.252 29.337 -Inf 0.000
Idretts-.eller.sportsarrangement=Idretts- eller sportsarrangement_Yes 19.923 17.722 43.478 -Inf 0.000
Athletics.org=Athletics org_Yes 22.600 19.805 42.833 -Inf 0.000
Kunstutstilling=Kunstutstilling_No 54.003 97.653 88.386 26.588 0.000
Kunstutstilling=Kunstutstilling_Yes 9.878 2.347 11.614 -26.588 0.000
Museum.eller.kulturminne=Museum eller kulturminne_No 55.618 91.113 80.072 24.415 0.000
Museum.eller.kulturminne=Museum eller kulturminne_Yes 21.798 8.887 19.928 -24.415 0.000
Voluntary.org=Voluntary org_No 55.818 89.689 78.538 23.905 0.000
Voluntary.org=Voluntary org_Yes 23.483 10.311 21.462 -23.905 0.000
Pop-etc=Pop-etc_No 56.129 86.340 75.187 22.586 0.000
Pop-etc=Pop-etc_Yes 26.909 13.660 24.813 -22.586 0.000
Festival=Festival_No 57.220 75.870 64.811 20.084 0.000
Festival=Festival_Yes 33.516 24.130 35.189 -20.084 0.000
Kino=Kino_No 60.409 59.995 48.543 19.811 0.000
Kino=Kino_Yes 38.001 40.005 51.457 -19.811 0.000
Teater=Teater_No 55.507 83.729 73.730 19.781 0.000
Teater=Teater_Yes 30.275 16.271 26.270 -19.781 0.000
Cultural.org=Cultural org_No 53.526 90.480 82.624 18.161 0.000
Cultural.org=Cultural org_Yes 26.780 9.520 17.376 -18.161 0.000
Classical-Jazz=Classical-Jazz_No 52.475 94.225 87.767 17.396 0.000
Classical-Jazz=Classical-Jazz_Yes 23.077 5.775 12.233 -17.396 0.000
Literature=Literature_No 51.633 95.042 89.972 14.875 0.000
Literature=Literature_Yes 24.165 4.958 10.028 -14.875 0.000
Stand-up.eller.revy=Stand-up eller revy_No 52.312 91.297 85.305 14.783 0.000
Stand-up.eller.revy=Stand-up eller revy_Yes 28.947 8.703 14.695 -14.783 0.000
Dans=Dans_No 50.845 96.044 92.330 12.277 0.000
Dans=Dans_Yes 25.210 3.956 7.670 -12.277 0.000
Political.org=Political org_No 50.156 97.468 94.986 10.018 0.000
Political.org=Political org_Yes 24.679 2.532 5.014 -10.018 0.000
Outdoors.org=Outdoors org_No 50.185 89.188 86.865 5.938 0.000
Outdoors.org=Outdoors org_Yes 40.236 10.812 13.135 -5.938 0.000
Religious.org=Religious org_No 49.678 93.460 91.957 4.774 0.000
Religious.org=Religious org_Yes 39.744 6.540 8.043 -4.774 0.000
VK=Mann 50.193 51.345 50.000 2.316 0.021
VK=Kvinne 47.564 48.655 50.000 -2.316 0.021

Cluster 2 - Sports and fun

Cluster 2 is a cluster oriented towards sports. The cluster is twice as likely to have attended a sports event, and almost twice as likely to have a history of involvement in an sports or athletics organization (Athletics org). The cluster does’nt only have this history and participation structure, they are also very likely to volunteer, with 56 % versus the global 29 %.

In addition, there is an aversion towards traditional high culture expressions, with low attendence in categories Literature, Arts exhibitions, Museums, Classical and jazz concerts, but they are not inactive in the participation realm. Cluster 2 has above average attendence in Stand-up performances, and pop (electonica, metal, rock etc) concerts. These are all categories which have lower traditional legitimacy (even more purely oriented towards Having fun). Cluster 2 is closer to average in the categories Theatre and Dance.

Cluster 2 is only slighter lower than average when it comes to a history of participation in a cultural organization, but half the average for history in a political organization.

It is tempting to label the cluster Sports and fun.

Variable Cla/Mod Mod/Cla Global v.test p.value
Idretts-.eller.sportsarrangement=Idretts- eller sportsarrangement_Yes 62.467 83.678 43.478 Inf 0
Athletics.org=Athletics org_Yes 57.478 75.854 42.833 Inf 0
Idretts-.eller.sportsarrangement=Idretts- eller sportsarrangement_No 9.373 16.322 56.522 -Inf 0
Athletics.org=Athletics org_No 13.709 24.146 57.167 -Inf 0
Volunteered=Volunteered_Yes 62.522 56.513 29.337 35.847 0
Volunteered=Volunteered_No 19.974 43.487 70.663 -35.847 0
Kunstutstilling=Kunstutstilling_No 35.774 97.419 88.386 19.188 0
Kunstutstilling=Kunstutstilling_Yes 7.214 2.581 11.614 -19.188 0
Literature=Literature_No 35.158 97.458 89.972 16.854 0
Literature=Literature_Yes 8.226 2.542 10.028 -16.854 0
Museum.eller.kulturminne=Museum eller kulturminne_No 36.140 89.158 80.072 14.473 0
Museum.eller.kulturminne=Museum eller kulturminne_Yes 17.658 10.842 19.928 -14.473 0
Stand-up.eller.revy=Stand-up eller revy_Yes 50.000 22.637 14.695 13.329 0
Stand-up.eller.revy=Stand-up eller revy_No 29.435 77.363 85.305 -13.329 0
Classical-Jazz=Classical-Jazz_No 34.880 94.321 87.767 12.940 0
Classical-Jazz=Classical-Jazz_Yes 15.068 5.679 12.233 -12.940 0
Political.org=Political org_No 33.370 97.657 94.986 7.941 0
Political.org=Political org_Yes 15.167 2.343 5.014 -7.941 0
Pop-etc=Pop-etc_Yes 39.429 30.143 24.813 7.454 0
Pop-etc=Pop-etc_No 30.156 69.857 75.187 -7.454 0
Kino=Kino_Yes 36.298 57.546 51.457 7.448 0
Kino=Kino_No 28.386 42.454 48.543 -7.448 0
VK=Mann 36.324 55.957 50.000 7.279 0
VK=Kvinne 28.590 44.043 50.000 -7.279 0
Teater=Teater_No 34.720 78.872 73.730 7.221 0
Teater=Teater_Yes 26.104 21.128 26.270 -7.221 0
Cultural.org=Cultural org_No 33.682 85.743 82.624 5.090 0
Cultural.org=Cultural org_Yes 26.632 14.257 17.376 -5.090 0
Dans=Dans_No 33.184 94.400 92.330 4.862 0
Dans=Dans_Yes 23.697 5.600 7.670 -4.862 0
Voluntary.org=Voluntary org_Yes 36.937 24.424 21.462 4.371 0
Voluntary.org=Voluntary org_No 31.233 75.576 78.538 -4.371 0
Outdoors.org=Outdoors org_Yes 37.684 15.250 13.135 3.784 0
Outdoors.org=Outdoors org_No 31.666 84.750 86.865 -3.784 0
Religious.org=Religious org_No 33.011 93.527 91.957 3.578 0
Religious.org=Religious org_Yes 26.122 6.473 8.043 -3.578 0

Cluster 3 - Very active and culturally oriented

Cluster 3 is five times more likely to have participated in an Art exhibition, three times more likely to have attended a Museum, a literature event and a classical or jazz concert or a theatre event, and doble the likelihood for a Dance event and a Festival event.

Cluster 3 is culturally engaged, and especially engaged with traditionally legitimate forms of culture. Cluster 3 have twice the likelihood of having a history of participation in a cultural organization.

There are no special aversions, as participation in less legitimate art forms are at average, even sports events.

Women are overrepresented in the cluster by 63 % vs 36 % men.

It is tempting to label the cluster Very active and culturally oriented.

Variable Cla/Mod Mod/Cla Global v.test p.value
Museum.eller.kulturminne=Museum eller kulturminne_Yes 60.543 64.641 19.928 Inf 0.000
Kunstutstilling=Kunstutstilling_Yes 82.908 51.588 11.614 Inf 0.000
Museum.eller.kulturminne=Museum eller kulturminne_No 8.242 35.359 80.072 -Inf 0.000
Kunstutstilling=Kunstutstilling_No 10.223 48.412 88.386 -Inf 0.000
Literature=Literature_Yes 67.609 36.326 10.028 32.218 0.000
Literature=Literature_No 13.209 63.674 89.972 -32.218 0.000
Classical-Jazz=Classical-Jazz_Yes 61.855 40.539 12.233 32.193 0.000
Classical-Jazz=Classical-Jazz_No 12.645 59.461 87.767 -32.193 0.000
Teater=Teater_Yes 43.621 61.395 26.270 31.843 0.000
Teater=Teater_No 9.773 38.605 73.730 -31.843 0.000
Cultural.org=Cultural org_Yes 46.588 43.370 17.376 26.506 0.000
Cultural.org=Cultural org_No 12.793 56.630 82.624 -26.506 0.000
Festival=Festival_Yes 34.212 64.503 35.189 25.339 0.000
Festival=Festival_No 10.223 35.497 64.811 -25.339 0.000
Voluntary.org=Voluntary org_Yes 39.580 45.511 21.462 23.146 0.000
Voluntary.org=Voluntary org_No 12.949 54.489 78.538 -23.146 0.000
Dans=Dans_Yes 51.092 20.994 7.670 18.746 0.000
Dans=Dans_No 15.971 79.006 92.330 -18.746 0.000
Political.org=Political org_Yes 60.154 16.160 5.014 18.706 0.000
Political.org=Political org_No 16.474 83.840 94.986 -18.706 0.000
Pop-etc=Pop-etc_Yes 33.662 44.751 24.813 18.578 0.000
Pop-etc=Pop-etc_No 13.715 55.249 75.187 -18.578 0.000
Kino=Kino_Yes 25.701 70.856 51.457 16.602 0.000
Kino=Kino_No 11.206 29.144 48.543 -16.602 0.000
VK=Kvinne 23.846 63.881 50.000 11.772 0.000
VK=Mann 13.483 36.119 50.000 -11.772 0.000
Religious.org=Religious org_Yes 34.135 14.710 8.043 9.616 0.000
Religious.org=Religious org_No 17.311 85.290 91.957 -9.616 0.000
Volunteered=Volunteered_Yes 25.395 39.917 29.337 9.590 0.000
Volunteered=Volunteered_No 15.870 60.083 70.663 -9.590 0.000
Outdoors.org=Outdoors org_Yes 22.080 15.539 13.135 2.951 0.003
Outdoors.org=Outdoors org_No 18.148 84.461 86.865 -2.951 0.003
Athletics.org=Athletics org_Yes 19.922 45.718 42.833 2.455 0.014
Athletics.org=Athletics org_No 17.723 54.282 57.167 -2.455 0.014
Stand-up.eller.revy=Stand-up eller revy_Yes 21.053 16.575 14.695 2.216 0.027
Stand-up.eller.revy=Stand-up eller revy_No 18.253 83.425 85.305 -2.216 0.027
Idretts-.eller.sportsarrangement=Idretts- eller sportsarrangement_No 19.475 58.978 56.522 2.092 0.036
Idretts-.eller.sportsarrangement=Idretts- eller sportsarrangement_Yes 17.610 41.022 43.478 -2.092 0.036

               

CSA

Create a MCA with package soc.ca

# SOC MCA
soc.data <- comb.all
soc.active <- soc.data[, c(4:9, 13:22, 24, 26)]
soc.sups <- soc.data[, c(1:3, 10:12, 23, 25, 27)]
soc.sups <- select(soc.sups, voksen_kjonn.x, FID) %>% rename(VK = voksen_kjonn.x)
soc.result <- soc.ca::soc.mca(soc.active)

CSA on gender

Is the logic of the space the same for men and for women?

# CSA på kjønn
class.kjonn <- which(soc.sups$VK == "1")
csa.res.menn <- soc.ca::soc.csa(soc.result, class.kjonn)
class.kjonn <- which(soc.sups$VK == "2")
csa.res.kvinner <- soc.ca::soc.csa(soc.result, class.kjonn)

Cosine similarity

Cosine similarity is very high for men. The axes are close to 100 percent in similarity.

Cosine similarity for the Women CSA show that axes 1 and 3 are very much the same as in the global MCA, but that axis 2 is structured a little bit differently for women. While similarity between axes 2 is 95 % for men, it is 87 % for women. Still, this is not very much.

Next, lets visualize the modalities between the CSAs and the global space.

## 
##                Measures for Class Specific Multiple Correspondence Analysis:                
##  
## 
##  Cosine similarity: 
##  
##                MCA: 1       MCA: 2       MCA: 3       MCA: 4       MCA: 5  
##   CSA: 1    0.988319406 -0.084060127 -0.061454473 -0.057024618 -0.035779008
##   CSA: 2    0.028603388  0.874333816 -0.478996477 -0.035579411  0.149052633
##   CSA: 3    0.049666198  0.430700449  0.865567760 -0.000252663  0.153994351
##   CSA: 4   -0.011945528 -0.105744061 -0.013199737 -0.631904154  0.475312143
##   CSA: 5    0.013829052 -0.134472777 -0.017541201  0.418722315  0.698378232
##              MCA: 1&2     MCA: 1&3     MCA: 1&4     MCA: 1&5     MCA: 2&3  
##   CSA: 1    0.991887772  0.990228206  0.989963158  0.988966827  0.104128561
##   CSA: 2    0.874801564  0.479849746  0.045651378  0.151772333  0.996943954
##   CSA: 3    0.433554619  0.866991510  0.049666841  0.161805413  0.966804232
##   CSA: 4    0.106416644  0.017802491  0.632017053  0.475462227  0.106564720
##   CSA: 5    0.135181990  0.022336884  0.418950618  0.698515138  0.135612025
##              MCA: 2&4     MCA: 2&5     MCA: 3&4     MCA: 3&5     MCA: 4&5  
##   CSA: 1    0.101577123  0.091357771  0.083835907  0.071111108  0.067319718
##   CSA: 2    0.875057436  0.886947749  0.480316062  0.501651585  0.153240275
##   CSA: 3    0.430700523  0.457402598  0.865567796  0.879159716  0.153994559
##   CSA: 4    0.640690772  0.486932685  0.632042002  0.475495391  0.790711384
##   CSA: 5    0.439785522  0.711206779  0.419089574  0.698598489  0.814285289
##            MCA: 1&2&3   MCA: 2&3&4   MCA: 3&4&5  
##   CSA: 1    0.993789719  0.118720530  0.091151504
##   CSA: 2    0.997354201  0.997578640  0.502911729
##   CSA: 3    0.968079105  0.966804265  0.879159753
##   CSA: 4    0.107232155  0.640826731  0.790821551
##   CSA: 5    0.136315311  0.440135205  0.814474202
## 
##  
## 
##  Cosine angles: 
##  
##                MCA: 1     MCA: 2     MCA: 3     MCA: 4     MCA: 5   MCA: 1&2
##   CSA: 1        8.8       85.2       86.5       86.7       87.9        7.3  
##   CSA: 2       88.4       29.0       61.4       88.0       81.4       29.0  
##   CSA: 3       87.2       64.5       30.1       90.0       81.1       64.3  
##   CSA: 4       89.3       83.9       89.2       50.8       61.6       83.9  
##   CSA: 5       89.2       82.3       89.0       65.2       45.7       82.2  
##              MCA: 1&3   MCA: 1&4   MCA: 1&5   MCA: 2&3   MCA: 2&4   MCA: 2&5
##   CSA: 1        8.0        8.1        8.5       84.0       84.2       84.8  
##   CSA: 2       61.3       87.4       81.3        4.5       28.9       27.5  
##   CSA: 3       29.9       87.2       80.7       14.8       64.5       62.8  
##   CSA: 4       89.0       50.8       61.6       83.9       50.2       60.9  
##   CSA: 5       88.7       65.2       45.7       82.2       63.9       44.7  
##              MCA: 3&4   MCA: 3&5   MCA: 4&5 MCA: 1&2&3 MCA: 2&3&4 MCA: 3&4&5
##   CSA: 1       85.2       85.9       86.1        6.4       83.2       84.8  
##   CSA: 2       61.3       59.9       81.2        4.2        4.0       59.8  
##   CSA: 3       30.1       28.5       81.1       14.5       14.8       28.5  
##   CSA: 4       50.8       61.6       37.7       83.8       50.1       37.7  
##   CSA: 5       65.2       45.7       35.5       82.2       63.9       35.5  
## 
## 
## 
##                Measures for Class Specific Multiple Correspondence Analysis:                
##  
## 
##  Cosine similarity: 
##  
##                MCA: 1       MCA: 2       MCA: 3       MCA: 4       MCA: 5  
##   CSA: 1    0.967775238  0.234598229  0.141429796  0.111596073 -0.017697155
##   CSA: 2   -0.161835666  0.951034517  0.136116489 -0.057491133 -0.117010829
##   CSA: 3   -0.051505596 -0.130609505  0.957798094 -0.185250888 -0.009345486
##   CSA: 4   -0.046255709 -0.027440169  0.152959324  0.825879607  0.041791809
##   CSA: 5   -0.032375348  0.062823175  0.062336626  0.200481993  0.836281528
##              MCA: 1&2     MCA: 1&3     MCA: 1&4     MCA: 1&5     MCA: 2&3  
##   CSA: 1    0.995803816  0.978054855  0.974188172  0.967937034  0.273931956
##   CSA: 2    0.964705881  0.211467448  0.171744034  0.199705576  0.960725950
##   CSA: 3    0.140398252  0.959181951  0.192277711  0.052346580  0.966662316
##   CSA: 4    0.053782465  0.159800329  0.827173933  0.062338960  0.155401150
##   CSA: 5    0.070674709  0.070242566  0.203079277  0.836907974  0.088502013
##              MCA: 2&4     MCA: 2&5     MCA: 3&4     MCA: 3&5     MCA: 4&5  
##   CSA: 1    0.259788399  0.235264783  0.180155685  0.142532721  0.112990587
##   CSA: 2    0.952770635  0.958205712  0.147759700  0.179497167  0.130371640
##   CSA: 3    0.226664365  0.130943426  0.975548605  0.957843686  0.185486468
##   CSA: 4    0.826335337  0.049995181  0.839924806  0.158565790  0.826936322
##   CSA: 5    0.210094695  0.838637911  0.209949719  0.838601604  0.859976642
##            MCA: 1&2&3   MCA: 2&3&4   MCA: 3&4&5  
##   CSA: 1    1.005797011  0.295791142  0.181022816
##   CSA: 2    0.974261328  0.962444587  0.188479344
##   CSA: 3    0.968033501  0.984252978  0.975593368
##   CSA: 4    0.162139163  0.840372919  0.840963873
##   CSA: 5    0.094237835  0.219147521  0.862232961
## 
##  
## 
##  Cosine angles: 
##  
##                MCA: 1     MCA: 2     MCA: 3     MCA: 4     MCA: 5   MCA: 1&2
##   CSA: 1       14.6       76.4       81.9       83.6       89.0        5.3  
##   CSA: 2       80.7       18.0       82.2       86.7       83.3       15.3  
##   CSA: 3       87.0       82.5       16.7       79.3       89.5       81.9  
##   CSA: 4       87.3       88.4       81.2       34.3       87.6       86.9  
##   CSA: 5       88.1       86.4       86.4       78.4       33.3       85.9  
##              MCA: 1&3   MCA: 1&4   MCA: 1&5   MCA: 2&3   MCA: 2&4   MCA: 2&5
##   CSA: 1       12.0       13.0       14.5       74.1       74.9       76.4  
##   CSA: 2       77.8       80.1       78.5       16.1       17.7       16.6  
##   CSA: 3       16.4       78.9       87.0       14.8       76.9       82.5  
##   CSA: 4       80.8       34.2       86.4       81.1       34.3       87.1  
##   CSA: 5       86.0       78.3       33.2       84.9       77.9       33.0  
##              MCA: 3&4   MCA: 3&5   MCA: 4&5 MCA: 1&2&3 MCA: 2&3&4 MCA: 3&4&5
##   CSA: 1       79.6       81.8       83.5        NaN       72.8       79.6  
##   CSA: 2       81.5       79.7       82.5       13.0       15.8       79.1  
##   CSA: 3       12.7       16.7       79.3       14.5       10.2       12.7  
##   CSA: 4       32.9       80.9       34.2       80.7       32.8       32.8  
##   CSA: 5       77.9       33.0       30.7       84.6       77.3       30.4  
## 
## 
a <- soc.ca::map.active(csa.res.menn) + labs(title = "CSA, menn", subtitle = "Map of active modalities")
b <- soc.ca::map.active(csa.res.kvinner) + labs(title = "CSA, kvinner", subtitle = "Map of active modalities")
c <- soc.ca::map.active(soc.result) + labs(title = "MCA - hele rommet", subtitle = "Map of active modalities")
a

b

c

Comparison between the male and female space

Having trouble interpreting comparisons between soc.ca::map.active on the CSA’s. The following maps the CSA’s in the same space, using color and geom_path to draw lines showing changes in the space by gender.

inspect.csa <- function(csa.object){
  temp.df <- tibble(Var = csa.object[["names.mod"]],
                    VarQ = csa.object[["variable"]],
                    Dim.1 = csa.object[["coord.mod"]][,1],
                    Dim.2 = csa.object[["coord.mod"]][,2],
                    Dim.3 = csa.object[["coord.mod"]][,3],
                    Ctr.1 = csa.object[["ctr.mod"]][,1],
                    Ctr.2 = csa.object[["ctr.mod"]][,2],
                    Ctr.3 = csa.object[["ctr.mod"]][,3],
                    Cor.1 = csa.object[["cor.mod"]][,1],
                    Cor.2 = csa.object[["cor.mod"]][,2],
                    Cor.3 = csa.object[["cor.mod"]][,3])
}

ins.csa <- inspect.csa(csa.res.kvinner) %>% 
  mutate(fontfam = ifelse((Ctr.1>mean(Ctr.1) & Ctr.2>mean(Ctr.2)), 4,
                          ifelse(Ctr.1>mean(Ctr.1), 3, 
                                 ifelse(Ctr.2>mean(Ctr.2), 2, 1))),
         alpvar = ifelse(fontfam==1, .5, 1),
         sizevar = ifelse(fontfam==1, 1, 2))

ins.csa.menn <- inspect.csa(csa.res.menn) %>% 
  mutate(fontfam = ifelse((Ctr.1>mean(Ctr.1) & Ctr.2>mean(Ctr.2)), 4,
                          ifelse(Ctr.1>mean(Ctr.1), 3, 
                                 ifelse(Ctr.2>mean(Ctr.2), 2, 1))),
         alpvar = ifelse(fontfam==1, .5, 1),
         sizevar = ifelse(fontfam==1, 1, 2))

csa.comp <- bind_rows(ins.csa %>% mutate(CSA = "Kvinner"),
          ins.csa.menn %>% mutate(CSA = "Menn")) %>% 
  filter(fontfam!=1)

csa.comp.lj <- left_join(ins.csa %>% mutate(CSA = "Kvinner"),
                      ins.csa.menn %>% mutate(CSA = "Menn"),
                      by = c("Var" = "Var"))

### Main space
# ggplot() + 
#   geom_hline(yintercept = 0, linetype = "dashed", alpha = .5) +
#   geom_vline(xintercept = 0, linetype = "dashed", alpha = .5) +
#   geom_point(data = ins.csa, aes(Dim.1, Dim.2, alpha = alpvar), shape = 2) +
#   ggrepel::geom_text_repel(data = ins.csa, aes(Dim.1, Dim.2, label = Var, fontface = fontfam, alpha = alpvar, size = sizevar), 
#                            max.overlaps = Inf, min.segment.length = 0, seed = 42, box.padding = 0.5) +
#   coord_fixed() +
#   scale_alpha_continuous(range = c(.4,1)) +
#   scale_size_continuous(range = c(3,4)) +
#   theme_minimal() +
#   theme(legend.position = "none") 

iterate.ggp <- ggplot()
for (u in unique(csa.comp$Var)){
  iterate.ggp <- iterate.ggp + geom_path(data = csa.comp[csa.comp$Var==u, ], aes(Dim.1, Dim.2), linetype = "dotted", size = 1)
}


iterate.ggp +
  geom_hline(yintercept = 0, linetype = "dashed", alpha = .5) +
  geom_vline(xintercept = 0, linetype = "dashed", alpha = .5) +
  geom_point(data = csa.comp, aes(Dim.1, Dim.2, alpha = alpvar, color = CSA, shape = as.character(fontfam+10), size = ifelse(Ctr.1>Ctr.2, Ctr.1, Ctr.2))) +
  ggrepel::geom_text_repel(data = csa.comp, aes(Dim.1, Dim.2, label = Var, fontface = fontfam, alpha = alpvar), 
                           max.overlaps = Inf, min.segment.length = 0, seed = 42, box.padding = 0.5) +
  scale_size_continuous(range = c(2,6)) +
  scale_alpha_continuous(range = c(.7, 1)) +
  coord_fixed() +
  scale_shape_manual(name = "Contributions",
                     labels = c("Axis 1", "Axis 2", "Both axes"),
                     values = c(15, 16, 17)) +
  scale_color_manual(name = "CSA Type",
                     labels = c("CSA:Women", "CSA:Men"),
                     values = c("red", "blue")) +
  guides(shape = guide_legend(override.aes = list(size = 5)),
         size = "none",
         alpha = "none")

# Array
soc.ca::map.csa.mca.array(csa.res.menn, ndim = 3)

soc.ca::map.csa.mca.array(csa.res.kvinner, ndim = 3)

# mindre like i andre og tredjeaksen. Kvinnene avviker litt, men ikke mye. Det ser ut som om menn er mer orientert mot organisasjoner. 

# soc.ca::map.csa.mca(csa.res, mca.dim = 1, csa.dim = 1)
# soc.ca::map.csa.mca(csa.res, mca.dim = 2, csa.dim = 2)

# soc.ca::csa.measures(csa.res.kvinner)
# soc.ca::csa.measures(csa.res.menn)

# Cosine similarity er svært nært 1 for alle tre dimensjonene. Svært små forskjeller på menn og kvinner. (rommets logikk)

Using CSA to validate

# Hva om vi kun bruker respondenten som har svart for seg selv?
# Bare F1
# Det er det samme rommet. Det ser ut som om kvinnene har svart godt for mennene sine, og omvendt. 
# Greit å ha en statistisk god indikasjon på. 

f1.soc <- bind_cols(soc.active, soc.sups)
f1.soc <- filter(f1.soc, FID == "F1")

f1.active <- f1.soc[, c(1:18)]
f1.sup <- f1.soc[, c(20)]

f1.res <- soc.ca::soc.mca(f1.active, f1.sup)

class.kjonn <- which(f1.sup$VK == "1")
f1.csa.res.menn <- soc.ca::soc.csa(f1.res, class.kjonn)
class.kjonn <- which(f1.sup$VK == "2")
f1.csa.res.kvinner <- soc.ca::soc.csa(f1.res, class.kjonn)

soc.ca::csa.measures(f1.csa.res.kvinner)
soc.ca::csa.measures(f1.csa.res.menn)

Homopraxia and Heteropraxia

Making new variables to look at if the practices differ strongly between parents.

# Bind clusters from hcpc to original dataframe for the MCA, along with the ID_resp, the ID of respondents.
cl.binded <- bind_cols(tibble(Cluster = res.hcpc[["data.clust"]][["clust"]]),
          comb.all %>% select(ID_resp),
          comb.run)

# Making a for loop. 
# For every couple in the dataframe (recall that each
# ID_resp has answered key questionnarie items for their partner)
# And within each partner-couple, we check if they belong to the 
# same cluster of practices. 

empty.list = list() #To store result from for loop
indices <- 1 # Counter to place each result in the previously empty list. 
for (resp in unique(cl.binded$ID_resp)){
  temp.df <- cl.binded[cl.binded$ID_resp==resp, ]
  temp.df$NumCl <- as.numeric(temp.df$Cluster) # Save a numerical version of the clusters
  little.df <- tibble(ID_resp = resp,
                      Praxia = ifelse(temp.df$Cluster[1]==temp.df$Cluster[2], "Homopraxia", "Heteropraxia"),
                      ClusterComp = paste0(temp.df$Cluster[1], ":", temp.df$Cluster[2]),
                      F_A = paste0(temp.df$VK[1],":",temp.df$Cluster[1]),
                      F_B = paste0(temp.df$VK[2],":",temp.df$Cluster[2]))
  empty.list[[indices]] <- little.df
  indices <- indices + 1
}

praxia <- data.table::rbindlist(empty.list) # Nifty little function from data.table package
praxia$ClusterComp2 <- praxia$ClusterComp
praxia$ClusterComp2[praxia$ClusterComp2=="1:2"] <- "2:1" 
praxia$ClusterComp2[praxia$ClusterComp2=="1:3"] <- "3:1"
praxia$ClusterComp2[praxia$ClusterComp2=="2:3"] <- "3:2"

# Make some refined variables with the results. 
praxia <- praxia %>% 
  mutate(
    PraxiaComposite = 
      ifelse(Praxia=="Homopraxia" & ClusterComp2 == "3:3", "Homopraxia Cultured",
          ifelse(Praxia=="Homopraxia" & ClusterComp2 == "2:2", "Homopraxia Sports",
                 ifelse(Praxia=="Homopraxia" & ClusterComp2 == "1:1", "Homopraxia Less active",
                        ifelse(Praxia!="Homopraxia" & ClusterComp2 == "2:1", "Heteropraxia Sports-Less active",
                               ifelse(Praxia!="Homopraxia" & ClusterComp2 == "3:1", "Heteropraxia Cultured-Less active", 
                                      ifelse(Praxia!="Homopraxia" & ClusterComp2 == "3:2", "Heteropraxia Cultured-Sports", "Mistake"))))))) %>% 
  mutate(Mor = ifelse(grepl("Kvinne", F_A), F_A, F_B),
         Far = ifelse(grepl("Mann", F_A), F_A, F_B)) %>% 
  mutate(Mother = ifelse(grepl("1", Mor), "Less active",
                         ifelse(grepl("2", Mor), "Sports", "Cultured")),
         Father = ifelse(grepl("1", Far), "Less active",
                         ifelse(grepl("2", Far), "Sports", "Cultured")))

     

Homopraxia most common

The majority of parent couples are in the homopraxia category, meaning they occupy the same cluster of practices.

The largest category is the homopraxis of less active. It’s biggest in the detailed Praxia variable at 34 percent. Homopraxia Cultured, Heteropraxia Sports-Cultured and Heteropraxia Cultured-Less active are almost equal in size at 10, 9 and 8 percent. These are good conditions to examine the differential structuring of these parental practices on children’s practices.

praxia$PraxiaComposite n percent
Heteropraxia Cultured-Less active 353 0.0910028
Heteropraxia Cultured-Sports 305 0.0786285
Heteropraxia Sports-Less active 785 0.2023717
Homopraxia Cultured 395 0.1018304
Homopraxia Less active 1327 0.3420985
Homopraxia Sports 714 0.1840681
praxia$Praxia n percent
Heteropraxia 1443 0.3720031
Homopraxia 2436 0.6279969
## `summarise()` has grouped output by 'Mother'. You can override using the `.groups` argument.
Mother Father N Frequency
Cultured Cultured 395 0.1018304
Cultured Less active 277 0.0714102
Cultured Sports 253 0.0652230
Less active Cultured 76 0.0195927
Less active Less active 1327 0.3420985
Less active Sports 442 0.1139469
Sports Cultured 52 0.0134055
Sports Less active 343 0.0884249
Sports Sports 714 0.1840681

               

Part II - presenting children’s space

Now to the point. Am I able to use clusters from parent’s space to predict children’s belonging in cluster’s in the space of organized lifestyles for children?

Run analysis of the Children’s space of lifestyles in background (no echo), and displaying modalities and cloud of individuals.

Cloud of modalities - Childrens’s organized lifestyles

Cloud of individuals - Children’s organized lifestyles

Does parent’s practices explain children’s practices?

Clusters from the above MCA on the Space of Organized Lifestyles for Children.

## 
## Call:
## glm(formula = Dep_var ~ Kjonn + PC, family = "binomial", data = prax)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6362  -0.6189  -0.4405  -0.3963   2.2729  
## 
## Coefficients:
##                                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                         -2.50462    0.15895 -15.758  < 2e-16 ***
## KjonnJente                           0.88695    0.12596   7.041 1.90e-12 ***
## PCHeteropraxia Sports-Less active    0.06224    0.19935   0.312    0.755    
## PCHomopraxia Sports                  0.22056    0.19435   1.135    0.256    
## PCHeteropraxia Cultured-Less active  2.30876    0.21874  10.555  < 2e-16 ***
## PCHomopraxia Cultured                2.65212    0.20362  13.025  < 2e-16 ***
## PCHeteropraxia Cultured-Sports       1.68654    0.21206   7.953 1.82e-15 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 2088.1  on 1884  degrees of freedom
## Residual deviance: 1693.3  on 1878  degrees of freedom
##   (10 observations deleted due to missingness)
## AIC: 1707.3
## 
## Number of Fisher Scoring iterations: 4
## Joining, by = "RID"

## 
## Call:
## glm(formula = Dep_var ~ Kjonn + Mother * Father, family = "binomial", 
##     data = prax)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6357  -0.6646  -0.4407  -0.3785   2.3116  
## 
## Coefficients:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                   -2.50336    0.15895 -15.750  < 2e-16 ***
## KjonnJente                     0.88507    0.12604   7.022 2.18e-12 ***
## MotherSports                   0.23695    0.24695   0.960    0.337    
## MotherCultured                 2.31970    0.23480   9.880  < 2e-16 ***
## FatherSports                  -0.09671    0.24906  -0.388    0.698    
## FatherCultured                 2.26300    0.40607   5.573 2.51e-08 ***
## MotherSports:FatherSports      0.08031    0.35292   0.228    0.820    
## MotherCultured:FatherSports   -0.52779    0.36071  -1.463    0.143    
## MotherSports:FatherCultured   -0.86152    0.61434  -1.402    0.161    
## MotherCultured:FatherCultured -1.93097    0.47313  -4.081 4.48e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 2088.1  on 1884  degrees of freedom
## Residual deviance: 1692.0  on 1875  degrees of freedom
##   (10 observations deleted due to missingness)
## AIC: 1712
## 
## Number of Fisher Scoring iterations: 4
## Joining, by = "RID"
## 
## Call:
## glm(formula = Dep_var ~ Kjonn * Mother + Kjonn * Father, family = "binomial", 
##     data = prax)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7477  -0.6229  -0.4368  -0.3562   2.3619  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)               -2.30176    0.19116 -12.041  < 2e-16 ***
## KjonnJente                 0.76055    0.23861   3.187  0.00144 ** 
## MotherSports               0.29670    0.27220   1.090  0.27572    
## MotherCultured             1.91615    0.25223   7.597 3.03e-14 ***
## FatherSports              -0.42409    0.23151  -1.832  0.06697 .  
## FatherCultured             0.73474    0.26877   2.734  0.00626 ** 
## KjonnJente:MotherSports   -0.07304    0.33887  -0.216  0.82935    
## KjonnJente:MotherCultured -0.19651    0.32778  -0.600  0.54883    
## KjonnJente:FatherSports    0.36760    0.29429   1.249  0.21162    
## KjonnJente:FatherCultured  0.36919    0.37184   0.993  0.32077    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 2088.1  on 1884  degrees of freedom
## Residual deviance: 1708.1  on 1875  degrees of freedom
##   (10 observations deleted due to missingness)
## AIC: 1728.1
## 
## Number of Fisher Scoring iterations: 5

## Mother = Less active:
##  contrast               odds.ratio    SE  df null z.ratio p.value
##  Sports / Less active        0.908 0.226 Inf    1  -0.388  0.6978
##  Cultured / Less active      9.612 3.903 Inf    1   5.573  <.0001
##  Cultured / Sports          10.588 4.621 Inf    1   5.407  <.0001
## 
## Mother = Sports:
##  contrast               odds.ratio    SE  df null z.ratio p.value
##  Sports / Less active        0.984 0.246 Inf    1  -0.066  0.9477
##  Cultured / Less active      4.061 1.877 Inf    1   3.033  0.0024
##  Cultured / Sports           4.128 1.801 Inf    1   3.249  0.0012
## 
## Mother = Cultured:
##  contrast               odds.ratio    SE  df null z.ratio p.value
##  Sports / Less active        0.536 0.140 Inf    1  -2.395  0.0166
##  Cultured / Less active      1.394 0.339 Inf    1   1.366  0.1720
##  Cultured / Sports           2.603 0.606 Inf    1   4.107  <.0001
## 
## Results are averaged over the levels of: Kjonn 
## Tests are performed on the log odds ratio scale