|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "metadata": { |
6 | | - "collapsed": false |
7 | | - }, |
| 5 | + "metadata": {}, |
8 | 6 | "source": [ |
9 | | - "We are going to replacte the results in this paper: http://www.ruf.rice.edu/~lane/papers/male_female.pdf Take a minute to read the paper. They found that small biases in evalutations of men and women in the workplace can result in a significan underrepresntation of women in top roles.\n", |
| 7 | + "### Male/Female promotions simulation (TEMPLATE)" |
| 8 | + ] |
| 9 | + }, |
| 10 | + { |
| 11 | + "cell_type": "markdown", |
| 12 | + "metadata": {}, |
| 13 | + "source": [ |
| 14 | + "We are going to replicate the results in this paper: http://www.ruf.rice.edu/~lane/papers/male_female.pdf. Take a minute to read the paper. They found that small biases in evalutations of men and women in the workplace can result in a significant underrepresntation of women in top roles.\n", |
10 | 15 | "\n", |
11 | 16 | " Even more dramatic is the finding that when\n", |
12 | 17 | " sex differences explained but 1% of the variance,\n", |
13 | 18 | " an estimate that might be dismissed as\n", |
14 | 19 | " trivial, only 35% of the highest-level positions\n", |
15 | | - " were filled by women\n", |
| 20 | + " were filled by women.\n", |
16 | 21 | "\n", |
17 | | - "Essentially we are going to set up a company hierarchy simulation with a modifiable bias factor. Then play out a attrition and promotion cycle to see how this affects gender distribution at different levels.\n", |
| 22 | + "Essentially, we are going to set up a simulation of a company hierarchy with a modifiable bias factor. Then we will play out an attrition and promotion cycle to see how this affects gender distribution at different levels of the hierarchy.\n", |
18 | 23 | "\n", |
19 | | - "I've started you off with genrateRandomPerson function which will be used to generate all the employees of this company. As well as `levels` which is a list of the number of employees at each level and `attrition` which is the percentage of\n", |
20 | | - "employees who are replaced each cycle.\n", |
| 24 | + "<b>Template:</b>I've started you off with a `genrateRandomPerson` function, which will be used to generate all the employees of this company. In addition, I have defined a list `levels`, which contains the number of employees at each level, and a variable `attrition`, which is the percentage of employees who are replaced each cycle.\n", |
21 | 25 | "\n", |
22 | | - "Fill in the functions and the main program and see the results of the simulation. Do you come up with the same results?\n" |
| 26 | + "<b>Task:</b> Fill in the remaining functions and the main program, run the simulation and compare your results to those in the paper. Do you come up with the same results?" |
23 | 27 | ] |
24 | 28 | }, |
25 | 29 | { |
|
36 | 40 | { |
37 | 41 | "cell_type": "code", |
38 | 42 | "execution_count": null, |
39 | | - "metadata": { |
40 | | - "collapsed": false |
41 | | - }, |
| 43 | + "metadata": {}, |
42 | 44 | "outputs": [], |
43 | 45 | "source": [ |
44 | 46 | "def generateRandomPerson(level=0, new=True):\n", |
|
66 | 68 | { |
67 | 69 | "cell_type": "code", |
68 | 70 | "execution_count": null, |
69 | | - "metadata": { |
70 | | - "collapsed": false |
71 | | - }, |
| 71 | + "metadata": {}, |
72 | 72 | "outputs": [], |
73 | 73 | "source": [ |
74 | 74 | "def generateStaff(levels):\n", |
|
85 | 85 | { |
86 | 86 | "cell_type": "code", |
87 | 87 | "execution_count": null, |
88 | | - "metadata": { |
89 | | - "collapsed": false |
90 | | - }, |
| 88 | + "metadata": {}, |
91 | 89 | "outputs": [], |
92 | 90 | "source": [ |
93 | 91 | "def allAreNew(staff):\n", |
|
115 | 113 | { |
116 | 114 | "cell_type": "code", |
117 | 115 | "execution_count": null, |
118 | | - "metadata": { |
119 | | - "collapsed": false |
120 | | - }, |
| 116 | + "metadata": {}, |
121 | 117 | "outputs": [], |
122 | 118 | "source": [ |
123 | 119 | "def pickBest(staff_level):\n", |
|
131 | 127 | { |
132 | 128 | "cell_type": "code", |
133 | 129 | "execution_count": null, |
134 | | - "metadata": { |
135 | | - "collapsed": false |
136 | | - }, |
| 130 | + "metadata": {}, |
137 | 131 | "outputs": [], |
138 | 132 | "source": [ |
139 | 133 | "def promote(staff):\n", |
|
149 | 143 | { |
150 | 144 | "cell_type": "code", |
151 | 145 | "execution_count": null, |
152 | | - "metadata": { |
153 | | - "collapsed": false |
154 | | - }, |
| 146 | + "metadata": {}, |
155 | 147 | "outputs": [], |
156 | 148 | "source": [ |
157 | 149 | "def mfratio(staff_level):\n", |
|
164 | 156 | { |
165 | 157 | "cell_type": "code", |
166 | 158 | "execution_count": null, |
167 | | - "metadata": { |
168 | | - "collapsed": false |
169 | | - }, |
| 159 | + "metadata": {}, |
170 | 160 | "outputs": [], |
171 | 161 | "source": [ |
172 | 162 | "# Main program\n", |
173 | 163 | "\n", |
| 164 | + "# Number of employes at each level (500 at the lowes, 10 at the highest)\n", |
174 | 165 | "levels = [500, 350, 200, 150, 100, 75, 40, 10]\n", |
| 166 | + "\n", |
175 | 167 | "attrition = 0.15\n", |
176 | 168 | "# Generate staff\n", |
177 | 169 | "# Start with a set number of iterations (5)\n", |
|
183 | 175 | ], |
184 | 176 | "metadata": { |
185 | 177 | "kernelspec": { |
186 | | - "display_name": "Python 2", |
| 178 | + "display_name": "Python 3", |
187 | 179 | "language": "python", |
188 | | - "name": "python2" |
| 180 | + "name": "python3" |
189 | 181 | }, |
190 | 182 | "language_info": { |
191 | 183 | "codemirror_mode": { |
192 | 184 | "name": "ipython", |
193 | | - "version": 2 |
| 185 | + "version": 3 |
194 | 186 | }, |
195 | 187 | "file_extension": ".py", |
196 | 188 | "mimetype": "text/x-python", |
197 | 189 | "name": "python", |
198 | 190 | "nbconvert_exporter": "python", |
199 | | - "pygments_lexer": "ipython2", |
200 | | - "version": "2.7.11" |
| 191 | + "pygments_lexer": "ipython3", |
| 192 | + "version": "3.6.1" |
201 | 193 | } |
202 | 194 | }, |
203 | 195 | "nbformat": 4, |
204 | | - "nbformat_minor": 0 |
| 196 | + "nbformat_minor": 1 |
205 | 197 | } |
0 commit comments