目的

エンタメ班のデータをもとに、どのようなSNSを使うが各種満足感が高いのかを分析する。

データ成型

library(tidyverse)
## -- Attaching packages -------------------------------------- tidyverse 1.2.1 --
## √ ggplot2 3.2.1     √ purrr   0.3.2
## √ tibble  2.1.3     √ dplyr   0.8.3
## √ tidyr   1.0.0     √ stringr 1.4.0
## √ readr   1.3.1     √ forcats 0.4.0
## -- Conflicts ----------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
read_csv("9259000003_Rawdata_2.csv") %>% mutate(
  SEX2 = recode_factor(SEX,`1` = "男",
                       `2` = "女",
                       .default = NA_character_),
  eduyear = recode(q3,
                   `1` = 9,
                   `2` = 12,
                   `3` = 14,
                   `4` = 12,
                   `5` = 14,
                   `6` = 16,
                   `7` = 18,
                   .default = NA_real_),
  work_manzoku = na_if(q20s1, 6),
  work_manzoku = 6 - work_manzoku,
  income_manzoku = na_if(q20s2, 6),
  income_manzoku = 6 - income_manzoku,
  relation_manzoku = na_if(q20s3, 6),
  relation_manzoku = 6 - relation_manzoku,
  life_manzoku = na_if(q20s4, 6),
  life_manzoku = 6 - life_manzoku,
  SNS = recode_factor(q23,`1` = "Twitter",
                      `2` = "Istagram",
                      `3` = "Facebook",
                      .default = NA_character_)
  ) -> data
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   MID = col_character(),
##   DAY = col_character(),
##   q5t19 = col_character(),
##   q5t19_coded = col_character(),
##   q6t7 = col_character(),
##   q6t7_coded = col_character(),
##   q11_coded = col_character(),
##   q11t11 = col_character(),
##   q11t11_coded = col_character(),
##   q12_coded = col_character(),
##   q12t7 = col_character(),
##   q12t7_coded = col_character(),
##   q17t9 = col_character(),
##   q18_coded = col_character(),
##   q18t8 = col_character(),
##   q18t8_coded = col_character(),
##   q31t6 = col_character(),
##   q32t1 = col_character()
## )
## See spec(...) for full column specifications.

基礎分析

どのSNSを一番よく使うか

barplot(table(data$SNS,useNA = "always"))

男女別の違い

prop.table(table(data$SEX2,data$SNS),1)
##     
##         Twitter   Istagram   Facebook
##   男 0.60629921 0.27952756 0.11417323
##   女 0.43911439 0.46863469 0.09225092
mosaicplot(~ SEX2 + SNS, data = data)

SNSによる各満足感の違い

boxplot(work_manzoku ~ SNS, data = data)

boxplot(income_manzoku ~ SNS, data = data)

boxplot(relation_manzoku ~ SNS, data = data)

boxplot(life_manzoku ~ SNS, data = data)

棒グラフで比較

data %>% group_by(SNS) %>%
  summarise(work = mean(work_manzoku,na.rm = TRUE),
            income = mean(income_manzoku,na.rm = TRUE),
            relation = mean(relation_manzoku,na.rm = TRUE),
            life = mean(life_manzoku,na.rm = TRUE)) %>% 
  filter(SNS != "NA") %>% 
  gather(key = satis, value = value, -SNS) %>% 
  ggplot(aes(x=satis,y=value,fill = SNS)) +
  geom_bar(stat="identity",position = "dodge")
## Warning: Factor `SNS` contains implicit NA, consider using
## `forcats::fct_explicit_na`

SNSの違いによる満足感の違いに有意な効果はあるか

統制変数として年齢・性別・教育年数をぶち込む。

summary(lm(work_manzoku ~ AGE + SEX2 + eduyear +  SNS, data = data))
## 
## Call:
## lm(formula = work_manzoku ~ AGE + SEX2 + eduyear + SNS, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.49127 -0.87374  0.06846  0.77304  2.08457 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.117562   0.497625   4.255 2.52e-05 ***
## AGE         -0.005372   0.009845  -0.546  0.58560    
## SEX2女      -0.074969   0.111078  -0.675  0.50006    
## eduyear      0.085270   0.026511   3.216  0.00139 ** 
## SNSIstagram  0.158870   0.118430   1.341  0.18041    
## SNSFacebook  0.137625   0.185762   0.741  0.45914    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.182 on 472 degrees of freedom
##   (186 observations deleted due to missingness)
## Multiple R-squared:  0.02645,    Adjusted R-squared:  0.01614 
## F-statistic: 2.565 on 5 and 472 DF,  p-value: 0.02643
summary(lm(income_manzoku ~ AGE + SEX2 + eduyear +  SNS, data = data))
## 
## Call:
## lm(formula = income_manzoku ~ AGE + SEX2 + eduyear + SNS, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.02476 -0.96332  0.05163  1.03344  2.67882 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.215594   0.505399   2.405 0.016530 *  
## AGE         -0.003561   0.010104  -0.352 0.724662    
## SEX2女      -0.052311   0.115322  -0.454 0.650312    
## eduyear      0.101925   0.026964   3.780 0.000176 ***
## SNSIstagram  0.192782   0.122816   1.570 0.117129    
## SNSFacebook  0.285196   0.192410   1.482 0.138916    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.252 on 494 degrees of freedom
##   (164 observations deleted due to missingness)
## Multiple R-squared:  0.03565,    Adjusted R-squared:  0.02589 
## F-statistic: 3.653 on 5 and 494 DF,  p-value: 0.002962
summary(lm(relation_manzoku ~ AGE + SEX2 + eduyear +  SNS, data = data))
## 
## Call:
## lm(formula = relation_manzoku ~ AGE + SEX2 + eduyear + SNS, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.65209 -0.71267  0.01017  0.78686  2.36154 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.884443   0.470305   4.007 7.08e-05 ***
## AGE         -0.003998   0.009527  -0.420 0.674948    
## SEX2女       0.114801   0.109254   1.051 0.293864    
## eduyear      0.093995   0.025439   3.695 0.000244 ***
## SNSIstagram  0.010552   0.116494   0.091 0.927864    
## SNSFacebook  0.292832   0.183845   1.593 0.111827    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.2 on 505 degrees of freedom
##   (153 observations deleted due to missingness)
## Multiple R-squared:  0.03362,    Adjusted R-squared:  0.02406 
## F-statistic: 3.514 on 5 and 505 DF,  p-value: 0.003926
summary(lm(life_manzoku ~ AGE + SEX2 + eduyear +  SNS, data = data))
## 
## Call:
## lm(formula = life_manzoku ~ AGE + SEX2 + eduyear + SNS, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.57717 -0.57563  0.04835  0.74857  2.04964 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.7980157  0.4427605   4.061 5.66e-05 ***
## AGE         -0.0005142  0.0089562  -0.057    0.954    
## SEX2女       0.1043824  0.1028951   1.014    0.311    
## eduyear      0.0974430  0.0239350   4.071 5.42e-05 ***
## SNSIstagram  0.1285376  0.1095632   1.173    0.241    
## SNSFacebook  0.1263852  0.1736365   0.728    0.467    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.135 on 510 degrees of freedom
##   (148 observations deleted due to missingness)
## Multiple R-squared:  0.03459,    Adjusted R-squared:  0.02513 
## F-statistic: 3.655 on 5 and 510 DF,  p-value: 0.002937

結論から言えば有意差はない。