の続きです。
今回はR言語のboxplot関数で男性と女性の行動の違いを見てみましょう。
まず、どういうデータフレームだったか、str関数で確認します。
このような観測数が28, 変数が16のデータフレームでした。
R言語のboxplot関数で箱ひげ図が作成できます。今回は男女別に作成します。
まずは、Sample_size, 調査した人数ですね。
女性のほうが平均値が大きいです。
次は、Population, 推定人口です。
女性にひとつ大きな外れ値があります。女性のどこかの年齢層がどこか突出していますね。
次は、Totalです。いずれかの行動をした人の割合ですね。
平均値では女性が高いですが、下のひげは女性のほうがずっと低いですね。
次は、Foreign_languagesです。外国語学習です。
平均値はほとんど変わらないです。女性に一つ大きな外れ値があります。
次は、English_languageです。
平均値は男性のほうが高いですが、女性に二つ大きな外れ値があります。
Other_foreign_languages, その他の外国語はどうでしょうか?
男性にも女性にも外れ値があります。
次は、Commerce_and_business_total, 商業実務・ビジネス関係(総数)です。
これは明らかに男性のほうの行動者率が高いですね。
次は、Computing_etc, パソコンなどの情報処理です。
これも男性のほうが行動者率は高いです。
次は、Commerce_and_business, 商業実務・ビジネス関係です。
これも男性のほうが高いです。
次は、Caring, 介護です。
介護は女性が高いですね。
次は、Home_economics_and_housework, 家政・家事(料理・裁縫・家庭経営など)です。
圧倒的に女性が高いです。
次は、Humanities_social_and_natural_science, 人文・社会・自然科学(歴史・経済・数学・生物など)です。
男性のほうが高いです。
次は、Arts_and_culture, 芸術・文化です。
芸術・文化は女性のほうが高いですね。
最後はOther, その他です。
その他は平均値は同じくらいですね。
こうしてみると、やっぱり男性と女性では行動がかなり違いますね。介護が家事は女性、商業実務・ビジネス関係は男性などです。
今回は以上です。
次回は
です。
今回のR言語のコマンドを記載しておきます。
# データフレームの構造を確認
str(dfnew)
# Sample_sizeの箱ひげ図
boxplot(dfnew$Sample_size ~ dfnew$Sex,
main = "Sample_size")
# Populationの箱ひげ図
boxplot(dfnew$Population ~ dfnew$Sex,
main = "Population")
# Totalの箱ひげ図
boxplot(dfnew$Total ~ dfnew$Sex,
main = "Total")
# Foreign_languagesの箱ひげ図
boxplot(dfnew$Foreign_languages ~ dfnew$Sex,
main = "Foreign_languages")
# English_languageの箱ひげ図
boxplot(dfnew$English_language ~ dfnew$Sex,
main = "English_language")
# Other_foreign_languagesの箱ひげ図
boxplot(dfnew$Other_foreign_languages ~ dfnew$Sex,
main = "Other_foreign_languages")
# Commerce_and_business_totalの箱ひげ図
boxplot(dfnew$Commerce_and_business_total ~ dfnew$Sex,
main = "Commerce_and_business_total")
# Computing_etcの箱ひげ図
boxplot(dfnew$Computing_etc ~ dfnew$Sex,
main = "Computing_etc")
# Commerce_and_businessの箱ひげ図
boxplot(dfnew$Commerce_and_business ~ dfnew$Sex,
main = "Commerce_and_business")
# Caringの箱ひげ図
boxplot(dfnew$Caring ~ dfnew$Sex, main = "Caring")
# Home_economics_and_houseworkの箱ひげ図
boxplot(dfnew$Home_economics_and_housework ~ dfnew$Sex,
main = "Home_economics_and housework")
# Humanities_social_and_natural_scienceの箱ひげ図
boxplot(dfnew$Humanities_social_and_natural_science ~ dfnew$Sex,
main = "Humanities_social_and_natural_science")
# Arts_and_cultureの箱ひげ図
boxplot(dfnew$Arts_and_culture ~ dfnew$Sex,
main = "Arts_and_culture")
# Otherの箱ひげ図
boxplot(dfnew$Other ~ dfnew$Sex, main = "Other")