Last active
December 11, 2015 05:08
-
-
Save joho/3ac03891b2f0c42ecd9d to your computer and use it in GitHub Desktop.
First cut of analysis of 2015 RubyAU Developer Survey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_this_survey_were_you_previously_aware_of_ruby_australia_as_an_organisation | |
{"Yes"=>256, "No"=>48} | |
how_old_are_you | |
{"25 - 32"=>126, | |
"33 - 38"=>93, | |
"39 - 46"=>47, | |
"19 - 24"=>17, | |
"47 - 58"=>19, | |
"12 - 18"=>1, | |
"59 - 65"=>1} | |
whats_your_highest_level_of_education_completed | |
{"Bachelors"=>161, | |
"High School"=>46, | |
"TAFE"=>36, | |
"Masters"=>46, | |
"Other"=>10, | |
"PhD"=>5} | |
what_is_your_australian_residency_status | |
{"Citizen"=>221, | |
"Naturalised Citizen"=>7, | |
"Temporary Resident"=>18, | |
"Permanent Resident"=>49, | |
"Other/prefer not to say"=>9} | |
which_state_or_territory_do_you_live_in | |
{"VIC"=>112, "NSW"=>101, "ACT"=>7, "QLD"=>34, "WA"=>23, "TAS"=>3, "SA"=>24} | |
what_is_your_current_state_of_employment | |
{"Employee, Full Time"=>207, | |
"Director/Owner"=>26, | |
"Self Employed, Contractor/Freelance"=>31, | |
"Self Employed, Own Product"=>14, | |
"Employee, Part Time"=>9, | |
"Unemployed"=>10, | |
"Student"=>6, | |
"Other"=>1} | |
what_industry_is_your_employer_in | |
{"Internet & Telecom"=>47, | |
"Real Estate"=>5, | |
"Finance"=>10, | |
"Business & Industrial"=>16, | |
"News"=>2, | |
"Arts & Entertainment"=>6, | |
"Jobs & Education"=>10, | |
"Food & Groceries"=>2, | |
"Travel & Tourism"=>11, | |
"Health"=>2, | |
"Occasions & Gifts"=>1, | |
"Computers & Consumer Electronics"=>7, | |
"Apparel"=>3, | |
"Retailers & General Merchandise"=>3, | |
"Family & Community"=>2, | |
"Home & Garden"=>1, | |
"Hobbies & Leisure"=>1, | |
"Sports & Fitness"=>1} | |
what_work_location_policy_do_you_work_under | |
{"Full time in office"=>40, | |
"Usually in office, occasionally remote"=>56, | |
"Full time remote"=>25, | |
"Usually remote, occasionally in office"=>7, | |
"Other"=>2} | |
is_your_employer_actively_hiring_ruby_developers_right_now | |
{"No"=>62, "Yes"=>68} | |
have_you_attended_a_rubyconf_or_railscamp_in_australia_in_the_last_2_years | |
{"RubyConf, RailsCamp"=>82, "RubyConf"=>64, "Neither"=>128, "RailsCamp"=>30} | |
gender | |
{"male"=>89, "female"=>7, "other"=>1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: | |
# - [ ] put in a real git repo for ruby australia | |
# - [ ] get some review by survey people on validity of interpretation of some things | |
# - [ ] figure out if i can safely/anonymously share raw csv, or how to filter it | |
# - [ ] make mad professional pdf of report to launch at rubyconf | |
# | |
require 'csv' | |
require 'pp' | |
def column_values_by_count(rows, header_key) | |
rows.each_with_object(Hash.new(0)) { |r, h| v=r[header_key].to_s; h[v] += 1 if v != "" } | |
end | |
def normalise_values_and_combine_counts(values_by_count, &normalise_function) | |
values_by_count.each_with_object(Hash.new(0)) { |r, h| k,v=*r; nk=normalise_function.call(k); h[nk] += v } | |
end | |
rows = File.open('ruby_survey.csv', 'r') { |f| CSV.new(f.read, :headers => true, :header_converters => :symbol, :converters => :all) }.to_a.map(&:to_hash) | |
# Auto report! | |
auto_report_keys = [ | |
:before_this_survey_were_you_previously_aware_of_ruby_australia_as_an_organisation, | |
:how_old_are_you, | |
:whats_your_highest_level_of_education_completed, | |
:what_is_your_australian_residency_status, | |
:which_state_or_territory_do_you_live_in, | |
:what_is_your_current_state_of_employment, | |
:what_industry_is_your_employer_in, | |
:what_work_location_policy_do_you_work_under, | |
:is_your_employer_actively_hiring_ruby_developers_right_now, | |
:have_you_attended_a_rubyconf_or_railscamp_in_australia_in_the_last_2_years | |
] | |
auto_report_keys.map { |k| puts k; pp column_values_by_count(rows, k); puts } | |
# Need Normalisation and/or care of interpretation | |
puts "gender" | |
gender_counts = normalise_values_and_combine_counts(column_values_by_count(rows, :whats_your_gender_identity)) do |k| | |
case k | |
when /female|woman|^f/i | |
"female" | |
when /male|mail|^m|bloke/i | |
"male" | |
else | |
"other" | |
end | |
end | |
pp gender_counts | |
# :what_country_are_you_from, | |
# :approximately_how_many_people_work_for_your_employer, | |
# :approximately_how_many_people_write_ruby_for_your_employer, | |
# :approximately_how_many_ruby_developers_has_your_employer_hired_in_the_past_12_months, | |
# :how_many_years_has_your_employer_been_in_business, | |
# :how_many_years_have_you_been_programming_with_ruby, | |
# :how_many_years_have_you_been_working_professionally_with_ruby, | |
# :what_is_your_pretax_income, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment