SOLUTIONS MANUAL. Labor Economics 9th Edition by George J. Borjas
TABLE OF CONTENTS CHAPTER 1: Introduction CHAPTER 2: Labor Supply CHAPTER 3: Labor Demand CHAPTER 4: Labor Market Equilibrium CHAPTER 5: Compensating Wage Differentials CHAPTER 6: Education CHAPTER 7: The Wage Distribution CHAPTER 8: Labor Mobility CHAPTER 9: Labor Market Discrimination CHAPTER 10: Labor Unions CHAPTER 11: Incentive Pay CHAPTER 12: Unemployment
CHAPTER 2 2-1. It is costly to commute to work, and the cost typically involves both time and money. (a) Suppose that a worker’s commute involves traveling a long distance on a highway that is about to start charging toll fees of $Y. There is no other way for the person to get to their job. What will happen to hours of work as a result of this increase in commuting costs?
In the absence of the toll fees, the worker would choose point P and work T − L0 hours. If it costs $Y to get to work, the budget line shifts down by $Y, and the worker would then choose point R and would work T − L1 hours. The introduction of toll fees, therefore, acts like an income effect, reducing the demand for leisure and lengthening the work week.
(b) Suppose a worker’s current job is located very near to their house, so that the time it takes to commute to work is essentially zero. The firm is considering a move to another town, and it will then take the worker 10 hr per week to get to and from work, regardless of how many hours the worker actually decides to work. What will happen to the worker’s
1 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
hours of work (defined as hours actually spent on the job) as a result of this increase in commuting costs?
To determine what happens to hours of work, it is important to distinguish between hours actually spent at work and hours spent commuting. In the absence of time commuting costs, the worker would choose point P and work T L0 hours. If it takes 10 hr to commute, the worker would then choose point R and would spend a total of T L1 hours either commuting or working. Note, however, that the number of hours actually spent working declines from T L0 to (T 10) L1 . Even though the commuting costs induce an income effect, reducing the total number of hours spent consuming leisure, hours spent at work actually decline because so much of the leisure time released by the income effect is spent commuting. (c) Why do the different types of commuting costs have different effects on hours of work? A toll increases hours of work, while an increase in ―time‖ commuting costs decreases hours of work. The one common result in both parts of the problem is that hours of leisure declines. In the presence of time commuting costs, however, the reduction in leisure time is ―consumed away‖ by the increase in the amount of time that it takes to get to work.
2-2. Charlie and Larry both face the same budget line for consumption and leisure. At every possible consumption–leisure bundle on the budget line, Charlie always requires marginally more leisure than does Larry in order to be equally happy when asked to forego a dollar of consumption. Using a standard budget line, graph several indifference curves 2 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
and the optimal consumption–leisure bundle for both people. Which person optimally chooses more consumption? Which feature of indifference curves guarantees this result? Because Charlie requires receiving more leisure than Larry when giving up consumption, Charlie’s indifference curves are flatter relative to Larry’s. This feature—shallower or flatter indifference curves—results in that person (Charlie) optimally choosing more of the Y-axis good. Similarly, Larry’s indifference curves are steeper relative to Charlie’s, because Larry does not need to receive as much leisure when giving up consumption. This feature—steeper indifference curves—results in that person (Larry) optimally choosing more of the X-axis good. These ideas are all incorporated in the graph below where the solid lines represent an assortment of indifference curves for Charlie and the dashed lines represent an assortment of indifference curves for Larry.
2-3. Tom earns $15 per hour for up to 40 hr of work each week and $30 per hour for every hour in excess of 40. Tom also faces a 20% tax rate, pays $4 per hour in childcare expenses for each hour he works, and receives $80 in child support payments each week. There are 110 (non-sleeping) hours in the week. Graph Tom’s weekly budget line.
If Tom does not work, he leisures for 110 hr and consumes $80. For all hours Tom works up to his first 40, his after-tax and after-childcare wage equals (80%of $15) $4 $8 per hour. Thus, if he works for 40 hr, he will be able to leisure for 70 hr and consume $80 $8(40) $400 . For all hours Tom works over 40, his after-tax and after-childcare wage equals (80%of $30) $4 $20 . Thus, if he works for 110 hr (70 hr at the overtime wage), he will not leisure at all, but he will consume $80 $8(40) $20(70) $1,800 . Tom’s weekly budget line is pictured below.
3 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
2-4. Cindy gains utility from consumption C and leisure L. The most leisure she can consume in any given week is 110 hr. Her utility function is U (C, L) C L . This functional form implies that Cindy’s marginal rate of substitution is C L . Cindy receives $660 each week from her great-grandmother—regardless of how much Cindy works. What is Cindy’s reservation wage? The reservation wage is the MRS when not working at all. Thus, wRES MRS at maximum leisure equals C / L $660 /110 $6.00. 2-5. Currently, a firm pays 10% of each employee’s salary into a retirement account, regardless of whether the employee also contributes to the account. The firm is considering changing this system to a 10% match, meaning that the firm will match the employee’s contribution into the account up to 10% of each employee’s salary. Some people at the firm think this change will lead employees to save more and therefore be more able to afford to retire at a younger age, while others believe this change will lead employees to save less for retirement and therefore be less able to afford to retire. Explain why either point of view could be correct. Either point of view may be correct. The first assumes that the new matching system will encourage workers to save at least 10% of their salary into the retirement account, because it is matched. In essence, each dollar of personal savings receives an automatic and immediate 100% return. Alternatively, if the workers feel that they simply cannot save for retirement, then the change to a matching system may result in fewer dollars saved for retirement as the workers save very little (say 2%) and the firm then only matches the 2%. With this example, a worker’s retirement account is receiving 4% of their salary each year compared to the 10% it received before the change. Clearly, the matching system provides fewer funds for retirement if the workers are not ―savers‖ during their work-life. 4 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
2-6. Shelly’s preferences for consumption and leisure can be expressed as
U C , L (C 100) ( L 40). This utility function implies that Shelly’s marginal utility of leisure is C 100 and her marginal utility of consumption is L 40 . There are 110 hr in the week available to split between work and leisure. Shelly earns $10 per hour after taxes. She also receives $320 worth of assistance benefits each week regardless of how much she works. (a) Graph Shelly’s budget line. If Shelly does not work, she leisures for 110 hr and consumes $320. If she does not leisure at all, she consumes $320 $10(110) $1, 420 . Shelly’s weekly budget line, therefore, is:
(b) What is Shelly’s marginal rate of substitution when L = 100 and she is on her budget line? If Shelly leisures for 100 hr, she works for 10 hr and consumes $320 $10(10) $420 . Thus, her MRS when doing this is: MRS
MU L C 100 420 100 320 $5.33 . MUC L 40 100 40 60
(c) What is Shelly’s reservation wage? The reservation wage is defined as the MRS when working no hours. When working no hours, Shelly leisures for 110 hr and consumes $320. Thus, wRES
MU L C 100 320 100 220 $3.14 . MUC L 40 110 40 70
(d) Find Shelly’s optimal amount of consumption and leisure. 5 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Her optimal mix of consumption and leisure is found by setting her MRS equal to her wage and solving for hours of leisure given the budget line: C 320 10(110 L) .
w MRS C 100 10 L 40 320 10(110 L) 100 10 L 40 10L 400 1,320 10 L L 86 . Thus, Shelly will choose to leisure 86 hr, work 24 hr, and consume $320 $10(24) $560 each week. 2-7. Explain why receiving a cash grant from the government can entice some workers to stop working (and entices no one to start working) while the earned income tax credit can entice some people who otherwise would not work to start working (and entices no one to stop working). A lump-sum transfer is associated with an income effect but not a substitution effect, because it doesn’t affect the wage rate. Thus, if leisure is a normal good, a lump-sum transfer will likely cause workers to work fewer hours (and certainly not cause them to work more hours) while possibly enticing some workers to exit the labor force altogether. On the other hand, the Earned Income Tax Credit raises the effective wage of low-income workers by 40% (at least for the poorest workers). Thus, someone who had not been working faces a wage that is 40% higher than it otherwise was. This increase may be enough to encourage the person to start working. For example, if a worker’s reservation wage is $10.00 per hour but the only job they can find pays $8.00 per hour, they will not work. Under the earned income tax credit, however, the worker views this same job as paying $11.20 per hour, which exceeds their reservation wage. Furthermore, the EITC cannot encourage a worker to exit the labor force, as the benefits of the EITC are received only by workers. 2-8. In 1999, 4,860 TANF recipients were asked how many hours they worked in the previous week. In 2000, 4,392 of these recipients were again subject to the same TANF rules and were again asked their hours of work during the previous week. The remaining 468 individuals were randomly assigned to a ―Negative Income Tax‖ (NIT) experiment which gave out financial incentives for welfare recipients to work and were subject to its rules. Like the other group, they were asked about their hours of work during the previous week. The data from the experiment are contained in the table below.
6 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Number of Recipients Number Who Worked of at Some Recipients Time in the Survey Week
TANF NIT Total
1999 1,217 131 1,348
4,392 468 4,860
Total Hours of Work by All Recipients in the Survey Week 2000 1,568 213 1,781
1999 15,578 1,638 17,216
2000 20,698 2,535 23,233
(a) What effect did the NIT experiment have on the employment rate of public assistance recipients? Develop a standard difference-in-differences table to support your answer. Employment Rate Blank cell TANF NIT
1999
2000
Diff.
Diff.-in-Diff.
27.7% 28.0%
35.7% 45.5%
8.0% 17.5%
9.5%
The NIT increased the probability of employment by 9.5 percentage points. Note that the percent numbers are found by dividing the ―Number of Recipient‖ columns (second and third columns of the original table) by the Number of Recipients column (first column of the original table). (b) What effect did the NIT experiment have on the weekly hours worked of public assistance recipients who worked positive hours during the survey week? Develop a standard difference-in-differences table to support your answer. Weekly Hours Worked per Working Person
TANF NIT
1999 12.8 12.5
2000 13.2 11.9
Diff. 0.4 −0.6
Diff.-inDiff. −1.0
The NIT decreased weekly hours worked, of those working, by 1 hr. Note that the average weekly hours of work per person is found by dividing the ―Total Hours of Work‖ columns (fourth and fifth columns of the original table) by the Number of Recipients column (first column of the original table). 2-9. Consider two workers with identical preferences, Phil and Bill. Both workers have the same life cycle wage path in that they face the same wage at every age, and they know what their future wages will be. Leisure and consumption are both normal goods. 7 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(a) Compare the life cycle path of hours of work between the two workers if Bill receives a one-time, unexpected inheritance at the age of 35. Because the workers have the same life cycle wage path and the same preferences, they will have the same life cycle path of hours of work up to the unexpected event. An inheritance provides an income effect for Bill with no substitution effect, and thus, he will work fewer hours (or at least not more hours) than Phil from the age of 35 forward. See the following graph.
(b) Compare the life cycle path of hours of work between the two workers if Bill had always known he would receive (and, in fact, does receive) a one-time inheritance at the age of 35. In this case, because the inheritance is fully anticipated, and because it offers the same income effect with no substitution effect, Bill will work fewer hours (or at least not more hours) than Phil over their entire work-lives. See the following graph.
2-10. Under current law, most social security recipients do not pay federal or state income taxes on their social security benefits. Suppose the government proposes to tax these benefits at the same rate as other types of income. What is the impact of the proposed tax on the optimal retirement age? 8 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Suppose social security benefits are the only pension benefits available to a retiree. The tax, therefore, can be interpreted as a cut in pension benefits. The cut in pension benefits shifts the budget line from FH to FE in the figure below, shifting the worker from Point P to Point R. (Note that FE and FH are both downward sloping, indicating that total retirement consumption is greater the later in life one retires meaning that one has fewer years of retirement.) This shift from FH to FE generates both income and substitution effects. Both of these effects, however, work in the same direction. First, the tax reduces the retiree’s wealth, reducing their demand for leisure, and leading them to retire later (the income effect). At the same time, the tax reduces the ―wage‖ that retirees receive when retired, effectively increasing (in relative terms) the wage they earn while working and generating a substitution effect that leads to more work hours, thus further delaying retirement. Under normal conditions, therefore, a tax on pension benefits will increase the optimal retirement age (i.e., workers will delay retirement and have fewer years of retirement).
2-11. A worker plans to retire at the age of 65, at which time they will start collecting their retirement benefits. Then there is a sudden change in the forecast of inflation when the worker is 63 years old. In particular, inflation is now predicted to be higher than it had been expected so that the average price level of market goods and wages is now expected to be higher. What effect does this announcement have on the person’s preferred retirement age: (a) if retirement benefits are fully adjusted for inflation? There will be no effect on the person’s retirement decision if retirement benefits are fully adjusted for inflation as nothing changes in the person’s calculations in real terms: The relative magnitudes of prices, wages, and retirement benefits are the same with or without inflation. The person faces the same choice set, so their decision does not change.
9 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) if retirement benefits are not fully adjusted for inflation? If retirement benefits are not adjusted for inflation, the purchasing power of retirement benefits falls. If the person does not retire, they can enjoy the same consumption as they would without inflation as wages are assumed to fully adjust for inflation. If they retires at 65, their benefits are worth less in real terms (they can buy them less consumption) with inflation than without, so they cannot afford the same consumption path as before. Hence, their choice set over the years of retirement and consumption lies below the original (preinflation) choice set except at one point—where they do not retire at all. Thus, as long as leisure (i.e., years of retirement) and consumption are normal goods, the income and substitution effects both lead to the individual retiring later in life. 2-12. Presently, there is a minimum and maximum social security benefit paid to retirees. Between these two bounds, a retiree’s benefit level depends on how much they contributed to the system over their work-life. Suppose social security was changed so that everyone aged 65 or older was paid $12,000 per year regardless of how much they earned over their working life or whether they continued to work after the age of 65. How would this likely affect the number of hours worked by retirees? Labor force participation is likely greatest for those retirees whose social security income is low (below $12,000 per year). Thus, the change in benefits offers these retirees a pure (positive) income effect. These retirees should reduce their hours worked if not leave the labor force altogether after the age of 65. In contrast, the policy change offers all retirees who would have earned more than $12,000 per month a pure (negative) income effect. These retirees will become more likely to work, or, if already working, more likely to work more hours after the age of 65. 2-13. Over the last 100 years, real household income and standards of living have increased substantially in the United States. At the same time, the total fertility rate, given by the average number of children born to a woman during her lifetime, has fallen from about three children per woman in the early 20th century to about two children per woman in the early 21st century. Does this suggest that children are inferior goods? The conventional wisdom (and empirical evidence) suggests that children are normal goods. Economically, children are a lot more expensive today than they were 100 years ago (consider education, housing, clothing, entertainment expenses, etc.). Children also produce less for the household in the 21st century than they did 100 years ago. There is also a biology/evolution argument that infant mortality rates have fallen dramatically over the last 100 years, so a woman needs to have fewer children to be more confident that some of her children will reach adulthood. This argues against children being an inferior good as the ―good‖ in question can be thought of as the number of offspring who live long enough to procreate.
10 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
2-14. Consider a person who can work up to 80 hr each week at a pretax wage of $20 per hour but faces a constant 20% payroll tax. Under these conditions, the worker maximizes their utility by choosing to work 50 hr each week. The government proposes a NIT whereby everyone is given $300 each week and anyone can supplement their income further by working. To pay for the NIT, the payroll tax rate will be increased to 50%. (a) On a single graph, draw the worker’s original budget line and their budget line under the NIT. Under the original scenario, let I be total weekly income, L be hours of leisure, and H be hours worked. The worker’s after-tax wage rate is 80% of $20 which equals $16 per hour. Thus, when the worker works all 80 hr in the week, they earn $16 80 $1, 280 and their budget line is described by I 1, 280 16 L . Notice that when L = 80, the worker earns $0. And when L = 30, the worker earns $16 50 $800 . Under the NIT, the worker is given $300 each week, but now their after-tax wage rate is 50% of $20 which equals $10 per hour. In this case, when the worker works all 80 hr in the week, they earn $10 80 $300 $1,100 and their budget line is properly described by I = 1, 100 10L . Notice that when L = 80, the worker receives $300. And when L = 30, the worker receives $300 $10 50 $800 . The two budget lines for both scenarios are graphed on the next page. Weekly Budget Lines
11 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) Show that the worker will choose to work fewer hours if the NIT is adopted.
12 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
To answer this question, one needs to find where the budget lines intersect. Setting the budget lines equal and solving for L reveals that the budget lines intersect at L = 30. Thus, the indifference curve that is tangent to the original budget line at L = 30 must not be tangent to the budget line under the NIT (because L = 30 was the optimal choice without the NIT). In particular, the worker’s original indifference curve must be below the new budget line to the right of L = 30. Therefore, when faced with the NIT, the worker will move in that direction, which requires them to increase L (hours of leisure) and concurrently decrease H (hours of work). (c) Will the worker’s utility be greater under the NIT? In this particular case, the worker’s utility will increase under the NIT because they could have continued to leisure 30 hr each week and receive $800 (which was their outcome before the NIT) but instead the worker decides to leisure more (and consume less). This change in behavior must increase their utility. 2-15. The absolute value of the slope of the consumption–leisure budget line is the after-tax real wage, w. Suppose some workers earn w for up to 40 hr of work each week, and then earn 2w for any hours worked thereafter (called overtime). Other workers earn w for up to 40 hr of work each week, and then only earn 0.5w thereafter as working more than 40 hr requires getting a second job which pays an hourly wage less than their primary job. Both types of workers experience a ―kink‖ in their consumption–leisure budget line. (a) Graph in general terms the budget line for each type of worker. Weekly Budget Lines
13 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) Which type of worker is likely to work up to the point of the kink, and which type of worker is likely to choose a consumption–leisure bundle far away from the kink? The worker who experiences a decrease in their wage after working 40 hr is more likely to work exactly 40 hr as the marginal benefit of working experiences a negative jump down at this point. In contrast, the worker who experiences an overtime premium after working 40 hr is more likely to not work exactly 40 hr. Because of the overtime premium, once the worker hits 40 hr of work, the worker experiences a positive jump up in the marginal benefit of working. Put differently, this worker may opt to only work 20 or 30 hr, but if they find themself having worked 40 hr because the T 40th hour of leisure was not as valuable as w, then it is very likely that they will also find that the T 41st hour of leisure is not as valuable as 2w, and therefore they work the 41st hour (and possibly quite more).
14 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
CHAPTER 3 3-1. Suppose there are two inputs in the production function, labor and capital, and these two inputs are perfect substitutes. The existing technology permits one machine to do the work of three workers. The firm wants to produce 100 units of output. Suppose the price of capital is $750 per machine per week. What combination of inputs will the firm use if the weekly salary of each worker is $300? What combination of inputs will the firm use if the weekly salary of each worker is $225? What is the elasticity of labor demand as the wage falls from $300 to $225? Because labor and capital are perfect substitutes, the isoquant for producing 100 units of output (in bold in the figure below) is linear and the firm will use only labor or only capital, depending on which is relatively cheaper in producing 100 units of output. The (absolute value of the) slope of the isoquant ( MPE / MPK ) is one third because one machine does the work of three workers. When the wage is $300, the slope of the isocost is 300 750. The isocost curve, therefore, is steeper than the isoquant, and the firm only hires capital (at Point A). To calculate this in a different way, one machine does the work of three workers. The one machine costs $750; the three workers cost $300 3 $900 . Clearly, the firm should hire only machines. When the weekly wage is $225, the isoquant is steeper than the isocost and the firm hires only labor (at Point B). To calculate this in a different way, one machine does the work of three workers. The one machine costs $750; the three workers cost $225 3 $675 . Clearly, the firm should hire only workers.
The elasticity of labor demand is defined as the percent change in labor divided by the percent change in the wage. Because the demand for labor goes from 0 to a positive quantity when the wage drops to $225, the (absolute value of the) elasticity of labor demand is infinity. 15 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
3-2. What happens to the long-run demand curve for labor if the demand for the firm’s output increases? What happens to the long-run demand curve for labor if the price of capital increases? Decompose the changes into scale and substitution effects. If the demand for the firm’s output increases, the price of the output will increase. The labor demand curve is given by the VMPE curve (which is the product of output price and the marginal product of labor). Therefore, the increase in the price of the output will shift the labor demand curve to the right.
To determine how an increase in the price of capital changes the demand for labor, suppose that initially the firm is at Point P in the figure, producing 200 units of output. The increase in the price of capital (assuming capital is a normal input) increases the marginal costs of the firm and will reduce the profitmaximizing level of output to say 100 units. The increase in the price of capital also flattens out the isocost curve, moving the firm to Point R. The move from Point P to Point R can be decomposed into a substitution effect (P to Q) which reduces the demand for capital, but increases the demand for labor, and into a scale effect (Q to R) which reduces the demand for both labor and capital. The direction of the shift in the demand curve for labor, therefore, will depend on which effect is stronger: the scale effect or the substitution effect.
3-3. Firm A would hire 20,000 workers if the wage rate is $12 but would hire 10,000 workers if the wage rate is $15. Firm B would hire 30,000 workers if the wage is $20 but would hire 33,000 workers if the wage is $15. Which firm is more likely to end up being unionized? The union will be more likely to attract the workers’ support when the elasticity of labor demand (in absolute value) is small. The elasticity of labor demand facing Firm A is given by:
16 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
A
%E (20,000 10,000) 20,000 2. %w (12 15) 12
The elasticity of labor demand facing Firm B is given by:
B
%E (33, 000 30, 000) 33, 000 0.45. %w (15 20) 15
Workers at Firm B, therefore, are more likely to organize as 0.45 2 .
3-4. Consider a firm for which production depends on two normal inputs, labor and capital, with prices w and r, respectively. Initially the firm faces market prices of w = 6 and r = 4. These prices then shift to w = 4 and r = 2. (a) In which direction will the substitution effect change the firm’s employment and capital stock? Prior to the price shift, the absolute value of the slope of the isocost line w / r was 1.5. After the price shift, the slope is 2. In other words, labor has become relatively more expensive than capital. As a result, there will be a substitution away from labor and toward capital (the substitution effect).
(b) In which direction will the scale effect change the firm’s employment and capital stock? Because both prices fall, the marginal cost of production falls, and the firm will want to expand. The scale effect, therefore, increases the demand for both labor and capital as both are normal inputs.
(c) Can we say conclusively whether the firm will use more or less labor? More or less capital? The firm will certainly use more capital as the substitution and scale effects reinforce each other in the direction of using more capital. The change in labor hired, however, will depend on whether the substitution or the scale effect dominates for labor.
3-5. What happens to employment in a competitive firm that experiences a technology shock such that its output is 200 units/hour larger at every level of employment? Because output increases by the same amount at every level of employment, the marginal product of labor does not change (and hence, the value of the marginal product of labor does not change). Therefore, as the value of the marginal product of labor will equal the wage rate at the same level of employment as before, the level of employment will not change.
17 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
3-6. Consider each of the following, and explain why it may or may not be a valid instrument for estimating labor supply elasticity and/or labor demand elasticity in the United States. (1) Variation in state income tax rates. (2) Variation in state corporate tax rates. (3) Changes in federal income tax rates over time. A valid instrumental variable for estimating labor supply elasticity must be something that shifts labor demand but not labor supply. Similarly, a valid instrumental variable for estimating labor demand elasticity must be something that shifts labor supply but not labor demand. For each of the options above: (1) State income taxes affect labor supply (because income taxes affect the wage), and therefore variation in state income taxes would be a valid instrument for estimating the elasticity of labor demand but not for estimating labor supply. (2) State corporate taxes affect labor demand (because corporate taxes affect profits and the value of marginal product of labor), and therefore variation in state corporate taxes would be a valid instrument for estimating the elasticity of labor supply but not for estimating labor demand. (3) Changes in the federal income tax rate over time are not a valid instrument for estimating either elasticity. The goal is to estimate either elasticity for the United States. Therefore, one needs something that changes within the United States for different workers or firms. One cannot use a nationwide variable to do this. Moreover, using time as the variation is dangerous as it requires assuming everything else is constant over time, which likely is not the case. 3-7. Suppose a firm hires labor in a competitive labor market and sells its product in a competitive product market. The firm’s elasticity of demand for labor is −0.4. Suppose the wage increases by 5%. What will happen to the amount of labor hired by the firm? What will happen to the marginal productivity of the last worker hired by the firm? Given the estimates of the elasticity of labor demand and the change in the wage, we have that
%E %E 0.4 0.4 %E 2%. %w 5%
Thus, the firm hires 2% fewer workers when wages increase by 5%. Furthermore, because fewer workers are hired, under normal conditions the marginal productivity of the last worker hired will increase. (More formally, because the labor market is competitive, the marginal worker is paid the value of his marginal product. As the product market is competitive, we also know that the output price does not change so that the marginal productivity of the marginal worker increases by 5% as well.)
3-8. A firm’s technology requires it to combine five person-hours of labor with three machine-hours to produce one unit of output. The firm has 15 machines in place when the 18 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
wage rate rises from $10 per hour to $20 per hour. What is the firm’s short-run elasticity of labor demand? Unless the firm shuts down (i.e., goes out of business in the short run), it will combine 25 persons with the 15 machines it has in place regardless of the wage rate. Therefore, employment will not change in response to the movement of the wage rate, and the short-run elasticity of labor demand is zero.
3-9. In a particular industry, labor supply is E S 10 w and labor demand is
E D 40 4w , where E is the level of employment and w is the hourly wage. (a) What is the equilibrium wage and employment if the labor market is competitive? What is the unemployment rate? In equilibrium, the quantity of labor supplied equals the quantity of labor demanded, so that ES ED . This implies that 10 w 40 4w . The wage rate that equates supply and demand is $6. When the wage is $6, 16 persons are employed. There is no unemployment because the number of persons looking for work equals the number of persons employers are willing to hire at the going wage rate of $6 per hour.
(b) Suppose the government sets a minimum hourly wage of $8. How many workers would lose their jobs? How many additional workers would want a job at the minimum wage? What is the unemployment rate? If employers must pay an hourly wage of $8, employers would only want to hire ED 40 4 8 8 workers, while ES 10 8 18 persons would like to work. Thus, eight workers lose their job following the minimum wage as 16 workers used to be employed but now only eight are, and two additional people enter the labor force following the minimum wage as 16 workers used to want a job but now 18 do. Under the minimum wage, the unemployment rate would be 10 8 or 55.6%.
3-10. Suppose the hourly wage is $10 and the price of each unit of capital is $25. The price of output is constant at $50 per unit. The production function is
f E, K E½ K ½ , so that the marginal product of labor is
MPE ½ K / E . ½
If the current capital stock is fixed at 1,600 units, how much labor should the firm employ in the short run? How much profit will the firm earn? 19 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
The firm’s labor demand curve is its value of marginal product curve, VMPE , which equals the marginal productivity of labor, MPE , times the marginal revenue of the firm’s product. But as price is fixed at $50, MR = 50. Thus, we have:
1, 000 1 1, 600 VMPE MPE MR 50 . E E 2 Now, by setting VMPE w and solving for E, we find that the optimal number of workers for the firm to hire is 10,000 workers (i.e., 1,000 sqrt E 10 solves as E = 10,000). The firm then makes
1, 600 10, 000 4, 000 units of output and earns a profit of ½
½
4,000 $50 1,600 $25 10,000 $10 $60,000. 3-11. Several states set their own minimum hourly wage above the federal minimum wage. To offset the potential employment impact of higher minimum wages, many of these states offer firms tax incentives that lower the cost of borrowing and/or lower the firm’s tax liability on profits. In general, how do these kinds of state policies (i.e., higher minimum wages and lower taxes) distort the firm’s profit-maximization decisions? Why might we expect to see such policies attract firms in ―high-tech‖ industries? High minimum wages provide an incentive to hire fewer low-skilled workers than the firm would otherwise choose to hire if it faced the lower federal minimum wage. Similarly, receiving tax incentives that lower the cost of borrowing or the firm’s tax liability provides an incentive for firms to invest more in nonlabor inputs, such as capital and technology. As “high-tech” firms tend to hire very skilled workers (paid well in excess of the minimum wage) and employ a lot of capital/technology while employing very little minimum wage labor, it is exactly these kinds of firms that would find a state that offered these kinds of tax incentives appealing (and who don’t really care about the higher minimum wage).
3-12. How does the amount of unemployment created by an increase in the minimum wage depend on the elasticity of labor demand? Do you think an increase in the minimum wage will have a greater unemployment effect in the fast-food industry or in the lawn care/landscaping industry? The elasticity of demand (for low-skill workers) is the percent change in labor demanded over the percent change in the wage. When this is low (in absolute value), labor demand is not very responsive to increases in the (minimum) wage. In this case, there will be very small unemployment effects from increasing the minimum wage. When the elasticity of demand is large in absolute value, however, there will be substantial unemployment effects when the minimum wage is increased. It is probably likely that the unemployment effect from an increase in the minimum wage would be more pronounced in the fast-food industry than in the lawn care/landscaping industry. The fast-food 20 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
industry has witnessed a large amount of automation (and even outsourcing) and could experience more. Such possible reactions make labor demand more elastic. In contrast, the lawn care/landscaping industry requires workers to cut lawns, install sprinklers, and so on. Such reliance on labor, therefore, may result in more inelastic demand for labor.
3-13. Which one of Marshall’s rules suggests that labor demand should be relatively inelastic for public school teachers and nurses? Explain. Public school teachers and nurses both help produce a good that is price inelastic—in the United States, at least, society will always purchase education and health care. Likewise, education and health care do not face strong competition from substitute goods. Finally, the production processes for education and health care both require teachers and nurses. And though these talents can be substituted for to some degree by other forms of labor or capital, both are crucial to the production process. Thus, other inputs (computers, doctors, etc.) cannot readily replace teaching or nursing services, and therefore the supply elasticity of other factors of production is not very elastic for teachers or nurses. For all three of these rules, therefore, the labor demand for public school teachers and nurses is likely fairly inelastic. As an aside, however, we can make a distinction between teachers and nurses. These two occupations likely differ in Marshall’s fourth rule. Public school teacher salaries are estimated to be between 50% and 80% of all expenditures on primary and secondary education. In contrast, expenditures on nursing are a much lower percentage of the total cost of heath care. For this rule, therefore, the demand for nurses is likely to be even more inelastic than the demand for public school teachers.
3-14. Many large cities have recently enacted living wage ordinances that require paying a minimum wage that is higher than the state or federal minimum wage. Sometimes the living wage ordinances specify two different minimum wages—one for workers who also receive employer-paid health insurance and one for workers who do not receive health insurance. (a) Why would living wages distinguish between workers based on their health insurance? In particular, what ―problem‖ might the local government be trying to solve? Living wage ordinances came about (largely in the 1990s) as advocates argued that people could not live in the city on the federal minimum wage. Therefore, these advocate groups tried to change the discussion from an hourly wage issue to discussing what it takes to actually live—wages, housing, education, health care, and so on. When making these arguments, it quickly becomes clear that there is a huge difference between people with health care insurance and those without. Therefore, in recognition of this difference, living wage advocates started proposing a policy of, say, $18 per hour if health insurance is not provided and $15 per hour if health insurance is provided, in order to remain true to their goals. Put differently, without this provision it isn’t a stretch to think that many firms would stop providing health insurance in order to save money now that they are being asked to pay a much higher minimum wage. 21 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) Sometimes living wage ordinances apply only to hiring by the city government, meaning that the city is required to pay all city workers a high minimum wage while private firms are only subject to state or federal minimum wages. In this case, the living wage creates a covered sector and an uncovered sector. Which workers are in the covered sector? Which workers are in the uncovered sector? What might city officials, who have to manage to a budget, do in response to a living wage ordinance that only applies to city workers? The covered sector are all city workers. The uncovered sector is everyone else working in the city. City officials who are trying to make the budget work out may decide to layoff any city worker whose job can be replaced with contracted work. For example, a city may hire 1,000 landscapers at $10 per hour to maintain all of the natural patches of grass, trees, and flowers throughout the city. But should it be forced to pay a minimum wage of $18 per hour, the city could (optimally) respond by firing those 1,000 workers and rather contract out landscaping work. These 1,000 workers then flow to the uncovered sector where they are paid $10 per hour (or even less if the flow of labor competes down the wage). In response to this shift by the city, some living wage ordinances apply to all city workers as well as to all firms that do business with the city. This doesn’t completely prevent the labor migration issue discussed in this paragraph, but it is thought to reduce the abuse somewhat. As a side note, many colleges and universities have done exactly the same thing (though not due to a formal living wage ordinance but rather due to accusations of paying staff way too little). Thus, many campuses now contract out food preparation, janitorial services, and lawn care.
3-15. Consider a production model with two inputs—domestic labor ( Edom ) and foreign labor ( Efor ) . The market is originally in equilibrium in that
MPEdom MPEfor . wdom wfor (a) Suppose a shock occurs that increases the marginal product of foreign labor. Assuming no changes in domestic or foreign wages, explain what will happen to domestic and foreign labor in order to restore the above condition. We are told that the marginal productivity of foreign labor has increased. Therefore, before labor adjustments, we will have a situation in which
MPEdom MPEfor . wdom wfor As we are further told that wages don’t adjust, the only way to restore the original equation is to have
MPE dom increase and/or MPE for to decrease. And these changes occur through labor mobility. In particular, for MPE dom to increase, we need Edom to decrease; and similarly for MPE for to decrease, we 22 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
need Efor to increase. Therefore, to answer the question, following a positive shock to the marginal product of foreign labor, firms will respond by employing fewer units of domestic labor and more units of foreign labor.
(b) In the years following the shock, what are three (significantly different) policies that the domestic country could employ if it wanted to reverse the outflow of domestic labor? In order to reverse the outflow of labor, there are generally two things that can be done:
Reverse the change in relative wages, which requires the domestic wage to decrease relative to the foreign wage.
Reverse the previous change in relative marginal products, which requires domestic marginal product to increase relative to foreign marginal product.
The first, therefore, requires lowering wdom or increasing wfor . The second requires increasing MPE dom or decreasing MPE . Of these four options, the only one the domestic country probably would not pursue is decreasing MPE for . To provide an example using the United States, the government could:
Decrease wdom by allowing the minimum wage to be eroded by inflation, by reducing hiring rules and regulations, by allowing firms to cut medical benefits, by offering hiring subsidies, and so on.
Increase wfor by lobbying the WTO and UN to have developing countries adopt minimum wage laws, environmental standards, child labor laws, and so on.
Increase MPE dom by improving K–12 and university education in the United States. (In words, the standard economic argument here is that outsourcing would stop if American workers became more productive.) CHAPTER 4
4-1. Figure 4-9 describes the changes to a labor market equilibrium when the government mandates an employee benefit for which the cost exceeds the worker’s valuation (Panel a) and for which the cost equals the worker’s valuation (Panel b). (a) Provide a similar graph to those in Figure 4-9 when the cost of the benefit is less than the worker’s valuation, and discuss how the equilibrium level of employment and wages changes. Is there a deadweight loss associated with the mandated benefit? The Impact of a Mandated Benefit (C < B)
23 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Without the mandate, the original equilibrium is at Point P with an employment level of E0 and a wage level of w0 . When the government mandates the benefit, labor demand shifts down by C as C is the per employee cost of the mandate. At the same time, however, supply shifts down by B as each worker values the benefit at B. As drawn, the cost is less than the benefit as stipulated in the problem. In this case, the new equilibrium is at R with an employment level of E and a wage level of w . Notice that the mandate has increased employment. It has also lowered the wage, by more than C but not by more than B. Consequently, firms and workers both benefit from this form of government intervention. Thus, there is no deadweight loss but rather new found surplus to be shared by firms and workers. Note: All of this analysis is predicated on firms and workers being unable to recognize the surplus gain without the government’s assistance (see Part b).
(b) Why is the situation in Part (a) in which a mandated benefit would cost less than the worker’s valuation less important for public policy purposes than when the cost of the mandated benefit exceeds the worker’s valuation? The reason why this situation is less important for public policy purposes is that this is a situation of a “free lunch” that is not taken advantage of by firms and workers but it is observed by the government. Economists don’t tend to devote much attention to such problems as it is believed that the firms and workers would come to realize the potential for mutual gain (in which case the above figure would have originally been at Point R with the benefit supplied for the worker by the firm, making the mandate unnecessary).
4-2. In the United States, labor supply tends to be inelastic relative to labor demand. At the same time, payroll taxes are essentially assessed evenly between workers and firms. Given these conditions, are workers or firms more likely to bear the additional burden of an increased payroll tax in the United States? Could this burden be shifted to the firms by 24 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
assessing the increase in payroll taxes on just firms rather than having firms and workers continue to be assessed payroll taxes equally? As labor supply is relatively more inelastic than labor demand, workers will bear a greater percentage of payroll taxes than employers regardless of how the law stipulates the amount be split. Most estimates suggest that workers in the United States bear about 80%–85% of payroll taxes. Again, tax incidence does not depend on who legally is required to pay the tax, so levying a greater percentage of payroll taxes on firms will not have any real economic effect.
4-3. The 1986 Immigration Reform and Control Act (IRCA) made it illegal for employers in the United States to knowingly hire undocumented workers. The legislation did not reduce the flow of undocumented workers into the country. To stem the flow, it has been proposed that the penalties against employers who break the law be increased substantially. Suppose that undocumented workers, who tend to be less skilled, are complements with native workers. What will happen to the wage of native workers if the penalties for hiring undocumented workers are increased? A substantial increase in the penalties will likely reduce the number of undocumented workers who enter the United States. The impact of this shift in the size of the undocumented flow on the marginal product (and hence the demand curve) of native workers hinges on whether the two types of workers are substitutes or complements with natives. If native workers and undocumented workers are substitutes, a cut in the number of undocumented workers increases the value of marginal product of natives, shifting up the demand curve for native workers, and increasing the native wage and employment. If the two groups are complements, a cut in the number of undocumented workers reduces the value of marginal product of natives, shifting down the native demand curve, and decreasing native wages and employment.
25 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
4-4. Suppose labor demand for low-skilled workers in the United States is w 24 0.1E where E is the number of workers (in millions) and w is the hourly wage. There are 120 million domestic U.S. low-skilled workers who supply labor inelastically. If the United States opened its borders to immigration, 20 million low-skill immigrants would enter the United States and supply labor inelastically. What is the market-clearing wage if immigration is not allowed? What is the market-clearing wage with open borders? How much is the immigration surplus when the United States opens its borders? How much surplus is transferred from domestic workers to domestic firms? Without immigration, the market-clearing wage is $12 as 24 0.1(120) $12 , at which all 120 million low-skill U.S. workers are employed. With immigration, the market-clearing wage is $10 as 24 0.1(140) $10 , at which all 120 million low-skill U.S. workers and all 20 million immigrants are employed. Both surplus values are easy to see in Figure 4-15. The additional surplus received by the U.S. economy is the area of triangle BCF in the figure. Thus, the additional surplus received by the United States because of the immigration equals
($12 $10) × (140 million 120 million) / 2 = $20 million. Likewise, the total transfer from U.S. workers to U.S. firms is represented in the figure by the rectangle captured by w0 w1 BF . Thus, the total transfer from U.S. workers to U.S. firms because of the immigration equals
($12 $10) × (120 million) = $240 million.
4-5. There are two reasons why the immigration surplus is greater when immigration is accompanied by human capital externalities compared to when there are no human capital externalities associated with immigration. Both reasons are detailed in Figure 4-16. The first is represented by triangle BCD. The second is represented by trapezoid ABEF. Explain the underlying source of each type of economic gain. Explain why human capital externalities are important. Triangle BCD represents the additional benefit domestic firms receive from employing immigrants. This is compared to the much smaller triangle equal to the change in the number of immigrants times the change in the wage (times one-half) that would have resulted had the demand for high-skilled workers (in this case, high-skilled immigrant labor) had not increased due to the human capital externalities. Trapezoid ABEF represents the additional benefit domestic firms receive from employing high-skilled domestic workers which comes about because of human capital externalities. This trapezoid exists only because demand for high-skilled workers increased because of immigration.
4-6. Let total market demand for labor be represented by E D 1, 000 50w where E D is total employment and w is the hourly wage. 26 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(a) What is the market-clearing wage when total labor supply is represented by E S 100w 800? How many workers are employed? How much producer surplus is received at the equilibrium wage? Set ED ES and solve for w yields w* $12 . At this wage, ED 400 and ES 400 , which is the equilibrium level of employment. Lastly, producer surplus is the area below the demand curve but above the wage. Mathematically, producer surplus (0.5) ($20 $12) 400 $1, 600 where the $20 comes from solving for w when
ED 0 .
27 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) Suppose the government imposes a minimum wage of $16. What is the new level of employment? How much producer surplus is received under the minimum wage? At a minimum wage of $16, labor demand will equal 200 (while labor supply will equal 800). As firms are not required to hire workers if they don’t want to, the new level of employment will be 200 workers. In this case, producer surplus (0.5) ($20 $16) 200 $400 .
4-7. Let total market demand for labor be represented by E D 1, 200 30w where E D is total employment and w is the hourly wage. Suppose 750 workers supply their labor to the market perfectly inelastically. How many workers will be employed? What will be the market-clearing wage? How much producer surplus is received? As the 750 workers supply their labor perfectly inelastically, all 750 will be employed. The wage that the firms must pay satisfies 750 1, 200 30w which solves as w* $15 . In this case, producer
surplus (0.5) ($40 $15) 750 $9,375 where the $40 comes from solving for w when ED 0 .
4-8. A firm faces perfectly elastic demand for its output at a price of $6 per unit of output. The firm, however, faces an upward-sloped labor supply curve of E 20w 120, where E is the number of workers hired each hour and w is the hourly wage rate. Thus, the firm faces an upward-sloped marginal cost of labor curve of
MC E 6 0.1E . Each hour of labor produces five units of output. How many workers should the firm hire each hour to maximize profits? What wage will the firm pay? What are the firm’s hourly profits? First, solve for the labor demand curve: VMPE P MPE $6 5 $30 . Thus, every worker is valued at $30 per hour by the firm. Now, setting VMPE MCE yields 30 6 0.1E which yields E* 240 . Thus, the firm will hire 240 workers every hour. Further, according to the labor supply curve, 240 workers can be hired at an hourly wage of $18 as
240 20w 120 240 20(18) 120 w $18. Finally, as Q 5L 5 240 1, 200 , the firm’s hourly profits are:
p Q wL $5 1, 200 $18 240 $2,880.
28 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
4-9. Ann owns a lawn mowing company. She has 400 lawns she needs to cut each week. Her weekly revenue from these 400 lawns is $20,000. If given an 18-in. deck push mower, a laborer can cut each lawn in 2 hr. If given a 60-in. deck riding mower, a laborer can cut each lawn in 30 min. Labor is supplied inelastically at $10 per hour. Each laborer works 8 hr a day and 5 days each week. (a) If Ann decides to have her workers use push mowers, how many push mowers will Ann rent and how many workers will she hire? As each worker can cut a lawn in 2 hr, it follows that each worker can cut four lawns in a day or 20 lawns in a week. Therefore, Ann would need to hire 20 workers (400 20) and rent 20 push mowers (one for each worker) in order to cut all 400 lawns each week.
(b) If she decides to have her workers use riding mowers, how many riding mowers will Ann rent and how many workers will she hire? As each worker can cut a lawn in 30 min, it follows that each worker can cut 16 lawns in a day or 80 lawns in a week. Therefore, Ann would need to hire five workers (400 80) and rent five riding mowers (one for each worker) to cut all 400 lawns each week.
(c) Suppose the weekly rental cost (including gas and maintenance) for each push mower is $250 and for each riding mower is $2,400. What equipment will Ann rent? How many workers will she employ? How much profit will she earn? If Ann uses push mowers, her weekly cost of mowers is $250(20) $5, 000 while her weekly labor cost is $10(20)(40) $8, 000 . Under this scenario, her weekly profit is $7,000. If Ann uses riding mowers, her weekly cost of mowers is $2, 400(5) $12, 000 while her weekly labor cost is
$10(5)(40) $2, 000 . Thus, under this scenario, her weekly profit is $6,000. Therefore, under these conditions, Ann will rent 20 push mowers and employ 20 workers.
(d) Suppose the government imposes a 20% payroll tax (paid by employers) on all labor and offers a 20% subsidy on the rental cost of capital. What equipment will Ann rent? How many workers will she employ? How much profit will she earn? Under these conditions, the cost of labor has increased to $12 per hour, while the rental costs for a push mower and a riding mower have decreased to 0.8 $250 $200 and 0.8 $2, 400 $1,920 , respectively. Ann’s profits under the two options, therefore, are
Push Profit $20, 000 $200(20) $12(20)(40) $6, 400. Rider Profit $20, 000 $1,920(5) $12(5)(40) $8, 480. Thus, under these conditions, Ann rents riding mowers, hires five workers, and earns a weekly profit of $11,600. 29 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
4-10. Figure 4-6 shows that a payroll tax will be completely shifted to workers when the labor supply curve is perfectly inelastic. In this case, for example, a new $2 payroll tax will lower the wage by $2, will not affect employment, and will not result in any deadweight loss. Suppose instead that labor supply is perfectly elastic at a wage of $10. In this case, what would be the effect on wages, employment, and deadweight loss from a $2 payroll tax? If the labor supply curve is perfectly elastic, the firm will pay the entire tax, so the effective wage earned by workers will remain at $10 but the effective wage paid by firms will increase to $12. However, because the firm pays the entire tax increase, it will respond by reducing employment (from E0 to E1 in the figure below). This reduction in employment results in a substantial deadweight loss.
4-11. Suppose a firm is a perfectly discriminating monopsonist. The government imposes a minimum wage on this market. What happens to wages and employment? A perfectly discriminating monopsonist faces a marginal cost of labor curve which is identical to the supply curve. As a result, the employment level of a perfectly discriminating monopsonist equals the employment level that would be observed in a competitive market (or E ). The imposition of a minimum wage at wMIN leads to the same result as in a competitive market: The firm will only want to hire ED workers, but ES workers will want to find work at the minimum wage.
30 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
4-12. A monopsonist’s demand for labor can be written as VMPE 40 0.005 E D . Labor is supplied to the firm according to w 5 0.01E S . Thus, the firm’s marginal cost of hiring workers is MC E 5 0.02 E S . (a) How much labor does the monopsony firm hire and at what wage when there is no minimum wage? The monopsonist sets MCE equal to VMPE and solves. In this case, 5 0.02E 40 0.005E solves as E* 1400 . At this employment level, the firm pays a wage off of the supply curve, which is 5 0.011, 400 $19 .
(b) How much labor does the monopsony firm hire and at what wage when it must pay a minimum wage of $25? When the minimum wage is $25, the firm’s marginal cost curve also equals $25 until this wage hits the supply curve. When it does, the firm then faces the original marginal cost curve. To check: at a wage of $25, solve 25 5 0.01E E 2, 000 units of labor are supplied. At 2,000 units of labor,
VMPE 40 0.005 2, 000 $30 . Therefore, we know that the minimum wage of $25 hits the supply curve before it hits the demand curve. With the firm facing a marginal cost of $25, set marginal cost equal to the supply curve (see Figure 4-22). In this case, this requires 25 5 0.01E , which solves as E* 2, 000 . Therefore, when facing a wage of $25, the firm pays a wage of $25 and hires 2,000 workers. The lesson here is that, compared to Part (a), a minimum wage can cause a monopsony firm to respond by hiring more workers.
4-13. Suppose the economy’s labor market is competitive and that labor demand can be written as w 50 0.3 E while labor supply can be written as w 8 0.2 E , where E is the total amount of employment in millions. What is the market-clearing wage? How many 31 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
people are employed? What is the total value of producer surplus? What is the total amount of worker surplus? The picture of market-clearing equilibrium is given in Figure 4-1. To find E * , set labor demand equal to labor supply and solve:
8 0.2E 50 0.3E 0.5E 42 E * 84 million workers Use E * and either equation to then solve for the market equilibrium wage:
w* 50 0.3(84) $24.80 or
w* 8 0.2(84) $24.80 Therefore, the market equilibrium is that 84 million workers are hired at an hourly wage of $24.80. Looking at Figure 4-1, producer surplus is the area designate by triangle P. Thus:
P = (½) × ($50 $24.80) × 84 million = $1, 058.4 million. Looking at Figure 4-1 again, worker surplus is the area designate by triangle Q. Thus:
Q = (½) × ($24.80 $8) × 84 million = $705.6 million.
4-14. Suppose the Cobb–Douglas production function given in Equation 4-1 applies to a developing country. Instead of thinking of immigration from a developing to a developed country, suppose a developed country invests large amounts of capital (foreign direct investment or FDI) in a developing country. (a) How does an increase in FDI affect labor productivity in the developing country? How will wages respond in the short run? FDI is an increase in capital, K. As Equation 4-5 shows, the marginal product of labor increases as K increases. Thus, wages (which equal the marginal product of labor in a competitive market) will increase in the developing nation in response to FDI inflows.
(b) What are the long-run implications of FDI, especially in terms of potential future immigration from the developing country? 32 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Intuitively, there will be less migration out of the developing country in the long run due to FDI inflows because the domestic wage (and standards of living) will have increased. Thought of differently, as r is constant in the long run, the capital to labor ratio is also constant in the long run (see the text). Thus,
FDI K L in the long run. There are several ways to increase L in the long run, but an obvious candidate is to have less migration out of the developing country.
4-15. Empirical work suggests that labor demand is very elastic while labor supply is very inelastic. Assume too that payroll taxes are about 15% and legislated to be paid half by the employee and half by the employer. (a) What would happen to worker wages if payroll taxes were eliminated? Because labor supply is relatively inelastic while labor demand is relatively elastic, workers bear most of the tax burden of payroll taxes, regardless of who is legislated to pay the tax. Therefore, a good estimate might be that workers bear 12 percentage points of the tax while firms bear 3 percentage points of the tax. If so, average wages would increase by 12 percentage points if payroll taxes were eliminated.
(b) What would happen to employment costs paid by firms if payroll taxes were eliminated? Using the description from Part (a), it is likely that employer wage costs would fall by only 3 percentage points if payroll taxes were eliminated.
(c) What would happen to producer and worker surplus if payroll taxes were eliminated? Which measure is relatively more sensitive to payroll taxes? Why? Both producer surplus and worker surplus would increase if payroll taxes were eliminated, but in terms of a percent change, the change would be much greater (maybe as much as four times greater) for workers than for firms.
(d) Why might workers not want payroll taxes eliminated? Despite the increase in worker surplus that would accrue from an elimination of payroll taxes, workers may still not want them to be eliminated if workers value the programs these taxes fund—in particular, payroll taxes fund social security, Medicare, and Medicaid.
CHAPTER 5 5-1. Politicians who support the green movement often argue that it is profitable for firms to pursue a strategy that is ―environmentally friendly‖ (e.g., by building factories that do not pollute), because workers will be willing to work in environmentally friendly factories at a lower wage rate. Evaluate the validity of this claim. If it is profitable for firms to build factories that do not pollute, firms would build these factories without government interference as doing so would maximize profits. After all, firms could build these profit33 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
maximizing factories and attract persons to work at these factories at lower wages because no compensating differential would be needed. The fact that compensating differentials exist and that governments attempt to regulate the quality of the workplace implies that providing these amenities to workers is more costly than cost-saving. This idea/argument is related to Part (b) of Question 4-1 in which the government mandates a benefit that costs C to firms but is valued at B by workers where C < B.
5-2. Consider the demand for and supply of risky jobs. (a) Derive the algebra that leads from Equations (5-4) and (5-5) to Equation (5-6).
(5 4) 0 p 0 E * w0 E*,
(5 5) 1 p1E * w1E*, Now,
1 0 ( p1 E * w1E*) ( p 0 E * w0 E*) ( p1 p 0 ) E * ( w1 w0 ) E * w1 w0 E *. This difference in profits, therefore, is positive (which means the firm will offer a risky work environment) if w1 w0 and is negative (which means the firm will offer a safe work environment) if w1 w0 . Thus, we have shown Equation (5-6).
(b) Describe why the supply curve in Figure 5-2 is upward sloping. How does your explanation incorporate θ? Why? The y-axis in Figure 5-2 is the difference in wages between the risky job w1 and the safe job w0 . The higher one is on the y-axis, the greater is this difference. The greater this difference, the more people there are who are willing to work the risky job. For example, when the difference equals $5, maybe only 30 people are willing to work the risky job. When the differential increases to $6, though, these same 30 people plus some others will be willing to work the risky job. The “plus some others” is what makes the supply curve in Figure 5-2 upward sloping. Notice that the explanation of why the supply curve in Figure 5-2 is upward sloping has absolutely nothing to do with where p1 p 0 . In particular, θ is a technology parameter as it is the 34 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
difference (measured in dollars) in worker productivity. This is an important idea for the firm, but it is not important to the worker who is providing the same level of effort in either case.
(c) Using a graph similar to Figure 5-2, demonstrate how the number of dirty jobs changes as technological advances reduce the cost of making worksites cleaner for all firms.
In the above graph, the original market equilibrium is determined by S A and DA . What is important is that the demand for workers in the risky job originally is a function of ˆA , which is a technology parameter. In particular, it is the lowest wage differential at which the worst (or least able firm) becomes willing to offer a safe work environment. Then, suppose that technology improves so that even the worst firms find it profitable to offer a safe environment at a lower differential. This implies that ˆ has been reduced, from ˆA to ˆB . After this shift in the demand for risky jobs, the equilibrium adjusts appropriately: employment in the risky sector falls and the equilibrium wage differential falls.
35 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
5-3. Suppose there are 100 workers in a labor market where all workers must choose to work a risky or a safe job. Worker 1’s reservation price for accepting the risky job is $1; Worker 2’s reservation price is $2, and so on. Because of technological reasons, there are only 10 risky jobs. (a) What is the equilibrium wage differential between safe and risky jobs? Which workers will be employed at the risky firm? The supply curve to the risky job is given by the fact that Worker 1 has a reservation price of $1, Worker 2 has a reservation price of $2, and so on. As the figure below illustrates, this supply curve (given by S) is upward sloping and has a slope of 1. The demand curve (D) for risky jobs is perfectly inelastic at 10 jobs. Market equilibrium is attained where supply equals demand so that 10 workers are employed in risky jobs; the market compensating wage differential is $10 (or, at least some number at least $10 at not yet $11) since this is what it takes to entice the marginal (10th) worker to accept a job offer from a risky firm. Note that the firm employs those workers who least mind being exposed to risk.
(b) Suppose now that an advertising campaign, paid for by the employers who offer risky jobs, stresses the excitement associated with ―the thrill of injury,‖ and this campaign changes the attitudes of the workforce toward being employed in a risky job. Worker 1 now has a reservation price of −$10 (i.e., they are willing to pay $10 for the right to work in the risky job); Worker 2’s reservation price is −$9, and so on. There are still only 10 risky jobs. What is the new equilibrium wage differential? If tastes toward risk change, the supply curve shifts down to S and the market equilibrium is attained when the compensating wage differential is −$1. This is the compensating differential required to hire the marginal worker (i.e., the 10th worker). Note that this compensating differential implies that even though most workers (from Worker 12 onward) dislike risk, the market determines that risky jobs will pay less than safe jobs.
36 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
5-4. Suppose all workers have the same preferences represented by U w 2 x , where w is the wage and x is the proportion of the firm’s air that is composed of toxic pollutants. There are only two types of jobs in the economy, a clean job (x = 0) and a dirty job (x = 1). Let w0 be the wage paid by the clean job and w1 be the wage paid for doing the dirty job. If the clean job pays $16 per hour, what is the wage in dirty jobs? What is the compensating wage differential? If all persons have the same preferences regarding working in a job with polluted air, market equilibrium requires that the utility offered by the clean job be the same as the utility offered by the dirty job, otherwise all workers would move to the job that offers the higher utility. This implies that:
w0 2(0) w1 2(1) 16 w1 2. Solving for w1 implies that w1 $36 . The compensating wage differential, therefore, is $20 as the risky job pays $36 per hour and the clean job pays $16 per hour.
5-5. Suppose a drop in the compensating wage differential between risky jobs and safe jobs has been observed. Two explanations have been put forward:
Engineering advances have made it less costly to create a safe working environment. The phenomenal success of a new reality TV show ―Die on the Job!‖ has imbued millions of viewers with a romantic perception of work-related risks.
Using supply and demand diagrams, show how each of the two developments can explain the drop in the compensating wage differential. Can information on the number of workers employed in the risky occupation help determine which explanation is more plausible? The engineering advances make it cheaper for firms to offer safe jobs and hence reduce the gain from switching from a safe environment to a risky one (or reduce the cost of switching from a risky environment to a safe one). This will decrease (shift in) the demand curve for risky jobs and reduce the compensating wage differential (Figure 1 below). Note that the equilibrium number of workers in risky jobs goes down. The glamorization of job-related risks may make people more willing to take these risks. This increases the supply (shift out) of workers to risky jobs and reduces the compensating differential (Figure 2 below). Note that the equilibrium number of workers in risky jobs goes up. Thus, information on whether employment in the risky sector increased or decreased can help discern between the two competing explanations: If employment in risky jobs went down, then it is likely due to technology; if employment in risky jobs went up, it is likely due to preferences. 37 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Figure 1. Labor Market for Risky Jobs
Figure 2. Labor Market for Risky Jobs
5-6. Consider a competitive labor market that has four different jobs that vary by their wage and risk level. The table below describes each of the four jobs. Job A B C D
Risk (r) 1 5 1 4 1 3 1
Wage (w) $3 $12 $23 $25
All workers are equally productive, but workers vary in their preferences. Consider a worker who values his wage and the risk level according to the utility function:
38 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
u (w, r ) w
1 . r2
Where does the worker choose to work? Suppose the government regulated the workplace and required all jobs to have a risk factor of 1 / 5 (i.e., all jobs become A jobs). What wage would the worker now need to earn in the A job to be equally happy following the regulation? Calculate the utility level for each job by using the wage and the risk level:
U A 28,U B 28,U C 32, and U D 29 . Therefore, the worker chooses a Type C job and receives 32 units of happiness. If they are forced to work a Type A job, the worker needs to receive a wage of $7 in order to maintain their 32 units of happiness as 7 + 25 = 32.
5-7. AB Consulting and DF Partners are two identical consulting firms in all aspects except that AB Consulting fires all new hires who don’t bring in at least $5 million in revenue during their 4-year probationary term while DF Partners fires all new hires who don’t bring in at least $2 million in revenue during their 4-year probationary term. (a) Assuming no worker likes to take on the risk of being fired, what would you expect salaries to look like across the two firms? That is, how do you expect the compensating differential to appear? Assuming no worker likes to take on the risk of being fired, jobs at DF Partners are preferred to jobs at AB Consulting. Therefore, the compensating differential should be that salaries are higher at AB Consulting compared to salaries at DF Partners.
(b) Suppose rather than seeing what you predicted in Part (a), it turns out that salaries are the same in both firms. Provide a few explanations as to why this might be the case. There are several reasons why the expected compensating differential may not come about in the data. First and foremost, preferences may not be as clear-cut as described above. In particular, if workers differ in their ability (and they know their ability), it may be that enough workers are confident in their ability to hit the revenue targets that they are willing to work at AB Consulting without a compensating differential. If the number of such workers is smaller than the number of jobs offered by AB Consulting, we would expect there to be no compensating differential. A second reason could be the labor market itself. If there is an oversupply of workers to the market, the hedonic wage function will be less steeply sloped (or not sloped at all).
5-8. The EPA wants to investigate the value workers place on being able to work in ―clean‖ mines over ―dirty‖ mines. The EPA conducts a study and finds the average annual wage in clean mines to be $42,250 and the average annual wage in dirty mines to be $47,250.
39 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(a) According to the raw data, how much does the marginal worker value working in a clean mine? How much does the average worker value working in a clean mine? The marginal value is $47,250 − $42,250 = $5,000. The average value is unknown as the compensating differential only measures the preferences of the marginal worker.
(b) Suppose the EPA could mandate that all dirty mines become clean mines and that all workers who were in a dirty mine must therefore accept a $5,000 pay decrease. Are these workers helped by the intervention, hurt by the intervention, or indifferent to the intervention? All except the marginal worker are hurt by the intervention. The workers who sort themselves into the dirty jobs are those workers who prefer to work in a dirty mine than in a clean mine when the wage differential is $5,000. These workers, in essence, value working in a dirty job at less than $5,000, and therefore being required to give up $5,000 to have a clean job is a bad deal for them. (Similarly, if all of the workers in the clean jobs were forced to accept dirty jobs for $5,000 more, all of them except the marginal worker would be hurt as they all value working in a clean job at more than $5,000.)
5-9. There are two types of farming tractors on the market, the FT250 and the FT500. The only difference between the two is that the FT250 is more prone to accidents than the FT500. Over their lifetime, 1 in 10 FT250s is expected to result in an accident, as compared to 1 in 25 FT500s. Further, 1 in 1,000 FT250s is expected to result in a fatal accident, as compared to only 1 in 5,000 FT500s. The FT250 sells for $125,000 while the FT500 sells for $137,000. At these prices, 2,000 of each model are purchased each year. What is the statistical value farmers place on avoiding a tractor accident? What is the statistical value of life of a farmer? The FT500 is associated with an extra cost of $12,000, but its accident rate is only 4% compared to the 10% accident rate of the FT250. Also, each farmer who buys the FT250 is willing to accept the additional risk in order to save $12,000. These workers are willing to receive $24 million ($12, 000 2, 000) in exchange for (0.1 0.04) 2, 000 120 more accidents. Thus, the value placed on each accident is
$24 million 120 $200, 000 . Likewise, the 2,000 farmers who buy the FT250 are willing to receive $24 million in exchange for (0.001 0.0002) 2, 000 1.6 more fatal accidents. Thus, the value placed on each life is
24 million ÷ 1.6 = $15 million .
5-10. Consider the labor market for public school teachers. Teachers have preferences over their salary, amenities, and school characteristics.
40 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(a) One would reasonably expect that high-crime school districts pay higher wages than low-crime school districts. But the data consistently reveal that high-crime school districts pay lower wages than low-crime school districts. Why? (Hint: In many cities, the primary source of funding for teacher salaries is local property taxes.) The likely reason for this is not that teachers do not care about crime—they almost certainly do—but rather that school funding is determined in large part by local property taxes. If high-crime schools are located in low-income cities, there is nothing (or at least very little) the local school board can do to raise more money to pay the compensating differential.
(b)Does your discussion suggest anything about the relation between teacher salaries and school quality? In the end, because high-crime schools cannot offer the necessary compensating differential, they will not be able to attract the highest quality workers. Therefore, one would expect that the worst schools with the worst teachers are located in the poorest communities with the most crime. This is the typical story told by proponents of replacing the local property tax scheme to fund public education with state or federal funds.
5-11. (a) On a graph with the probability of injury on the x-axis and the wage level on the y-axis, plot two indifference curves, labeled U A and U B , so that the person associated with U A is less willing to take on risk relative to the person associated with U B . Include an arrow on the graph showing which direction is associated with higher levels of utility. Explain what it is about the indifference curves that reveal Person A is less willing to take on risk relative to Person B.
In the graph above, the person with indifference curves represented by U A is less willing to take on risk than a person with indifference curves represented by U B . This can be seen by looking at the point 41 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
where the two indifference curves intersect. Suppose both workers are offered this job, and then asked how much extra they need to be paid to accept a different job that is associated with some extra risk. Worker A demands a greater payment to take on additional risk (because U A is higher than U B at all points to the right of the intersection) compared to Worker B. The directional arrow points toward the northwest (up and to the left), because both types of workers prefer a higher wage (north) and a lower probability of injury (left).
(b) Consider a third person who doesn’t care about the risk associated with the job. That is, they don’t seek to limit risk or to expose themself to risk. On a new graph, draw several of this person’s indifference curves. Include an arrow on the graph showing which direction is associated with higher levels of utility.
As this worker does not care about risk, the indifference curve increases strictly to the north (up), and not to the northwest as would be the case for someone who disliked risk.
(c) Consider a wage-risk equilibrium that is characterized by an upward sloping hedonic wage function. Now suppose there is a government campaign that successfully alters people’s perception of risk. In particular, each worker adjusts their preferences so that they now need to be more highly compensated to take on risk. Discuss, and show on a single graph, how the government’s campaign affects indifference curves, isoprofit lines, the equilibrium hedonic wage function, and the distribution of workers to firms. The proposed campaign will not alter isoprofit lines, but it will make indifference curves more steeply sloped. In terms of the equilibrium, here are two possible answers as to what will happen to the hedonic wage function, depending on what one considers about the product market. If the product market is competitive, then the hedonic wage function will not change in shape as all firms compete and earn zero long-run profits. However, part of the hedonic wage function will disappear as certain types of firms (i.e., the ones that find it most costly to offer safe jobs) end up going out of business. That is, although the steepness doesn’t change, the top part of the function disappears. As a result of the campaign, more 42 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
workers work in safe environments and the equilibrium differential will fall (simply because the most risky jobs no longer exist). If one assumes that profits can be positive, the result is a more steeply sloped hedonic wage function because of more steeply sloped indifference curves. Moreover, because the hedonic wage function is more steeply sloped (indicating that it is more expensive to offer a risky work environment), more firms will opt to offer safer jobs and more workers will take safer jobs because that is what they now prefer. However, the equilibrium wage differential will increase, meaning that those firms that find it very expensive to offer a safe job will have to pay higher wages.
5-12. Suppose everyone is highly productive, college educated, hardworking, and so on. People still differ in their preferences for jobs—while some would prefer to be doctors than lawyers, others prefer to be lawyers than doctors, and so on—and everyone prefers to be a professional to being a trash collector, but as usual preferences vary across individuals. In order for this economy to function at all, someone needs to choose to be the trash collector. Who will be the trash collector, and in general terms, how much will the job of trash collector pay? In order for this economy to function at all, someone needs to choose to be the trash collector, so the salary paid to the trash collector will adjust until someone willing chooses to do the job. The person will be highly productive, college educated, hardworking, and so on. The person will most likely earn a lot of money, as the salary must be high enough to encourage someone to take the job. Moreover, the person will be, of all people in the economy, the one who least objects to being a trash collector. So, to recap, because of other people’s aversion to collecting trash and the necessity to have someone collect the trash, the person with preferences far from the norm (i.e., most willing to pick up trash) earns a very high wage.
5-13. Consider two identical jobs, but some jobs are located in Ashton while others are located in Benton. Everyone prefers working in Ashton, but the degree of this preference varies across people. In particular, the preference (or reservation price) is distributed uniformly from $0 to $5. Thus, if the Benton wage is $2 more than the Ashton wage, then 40% (or two fifths) of the worker population will choose to work in Benton. Labor supply is perfectly inelastic, but firms compete for labor. There are a total of 25,000 workers to be distributed between the two cities. Demand for labor in both locations is described by the following inverse labor demand functions:
Ashton : wA 20 0.0024 EA . Benton : wB 20 0.0004 EB . Solve for the labor market equilibrium by finding the number of workers employed in both cities, the wage paid in both cities, and the equilibrium wage differential. 43 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
There are five equations that must hold simultaneously to make the equilibrium. In particular, and defining wB wA , the equations are:
(1) wA 20 0.0024 EA , (2) wB 20 0.0004 EB , (3) wB wA , (4) EA EB 25,000, (5) EB 25,000 5 5,000. Equation (5) is the most difficult for most students to see. And once they see it, they wonder why a sixth equation of E A 25,000 5,000 isn’t also included. Of course, this sixth equation plus (4) and (5) are perfectly collinear, so only two of the three can be used. Now consider the following algebraic manipulations:
(2) (1) wB wA 0.0024 EA 0.0004 EB . Substituting in (4) yields: 0.0024(25,000 EB ) 0.0004 EB 60 0.0028EB . Substituting (5) into this last equation yields:
60 0.0028EB . 60 0.0028 5, 000
60 14
15 60 $4. A little more work, now provides the entire equilibrium:
Equation 5 EB 5, 000 5, 000 4 20, 000. Equation 4 EA 5, 000. Equation 2 wB 20 0.0004 EB 20 0.0004 20, 000 $12 Equation 1 wA 20 0.0024 EA 20 0.0024 5, 000 $8.
44 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Thus, the labor market equilibrium is for 20,000 workers to work in Benton, each being paid $12 per hour; for 5,000 workers to work in Ashton, each being paid $8; and for the equilibrium wage differential to be $4.
5-14. U.S. Trucking pays its drivers $40,000 per year, while American Trucking pays its drivers $38,000 per year. For both firms, truck drivers average 240,000 miles per year. Truck driving jobs are the same regardless of which firm one works for, except that U.S. Trucking gives each of its trucks a safety inspection every 50,000 miles while American Trucking gives each of its trucks a safety inspection every 36,000 miles. This difference in safety inspection rates results in a different rate of fatal accidents between the two companies. In particular, one driver for U.S. Trucking dies in an accident every 24 million miles while one driver for American Trucking dies in an accident every 30 million miles. What is the value of a trucker’s life implied by the compensating differential between the two firms? To make things easy, suppose both firms require driving 120 million miles each year. This requires each firm hiring 120 million miles ÷ 240, 000 miles per driver = 500 drivers . U.S. Trucking expects to experience five deaths in a year (120 24) while American Trucking expects to experience four deaths in a year (120 30) . The 500 drivers for U.S. Trucking, therefore, are each paid $2,000 more than drivers for American Trucking to take on the expected risk of having one more death. Thus, the one expected life is worth 500 $2, 000 $1, 000, 000 . Thus, the value of a trucker’s life implied by the compensating differential between the two firms is $1 million.
5-15. When trying to quantify the compensating differential associated with a desirable fringe benefit such as health insurance, it is important to try to collect data on a set of workers who are equally productive. Why? Is it also true that it is important to try to collect data on an equally productive set of workers when trying to quantify the compensating differential associated with a firm characteristic that is disliked by most workers (e.g., exposure to risk of injury on the job)? The issue, as demonstrated in Figure 5-10 in the text, is that workers with higher ability are worth more to the firm. So, for example, a low-skill worker may be worth $50,000 to the firm while a high-skill worker may be worth $100,000. Ultimately, in a competitive labor market, the low-skill worker will be compensated a total of $50,000 in some mixture of salary and fringe benefits, while the high-skill worker will be compensated a total of $100,000 in some mixture of salary and fringe benefits. Assuming that workers value fringe benefits more than cash for some reason (e.g., a tax incentive), it is quite likely that the high-skill worker will be compensated with more salary AND more fringe benefits than the low-skill worker. This is precisely the result in Figure 5-10 of the text between Points Q (the low-skill worker) and Q * (the high-skill worker). There is still a problem when the compensating differential is being paid for something that is disliked for precisely the same reason—different types of workers have different value to the firm, so comparing 45 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
salary or wage compensation to identify compensating differentials is flawed because the observed differences will necessarily take into account differences in ability as well. Using the case above, suppose all workers are willing to forego $10,000 in annual salary to avoid the disliked job amenity, and assume that removing the disliked amenity costs most than $10,000 in the workplace of low-skilled workers (e.g., in the mine) while removal costs must less than $10,000 in the workplace of high-skilled workers (e.g., in the office). In this case, all high-skilled workers will be paid $90,000 and not encounter the bad job amenity while all low-skill workers will be paid $50,000 but have to experience the bad job amenity. In this case, raw data would suggest that the compensating differential to avoid the bad job amenity is $40,000 when in fact it is $10,000 for both types of workers. The $40,000 number, however, comes about largely because of the vast difference in value both types of workers provide the firm.
CHAPTER 6 6-1. Debbie is about to choose a career path. She has narrowed her options to two alternatives. She can either become a marine biologist or a concert pianist. Debbie lives two periods. In the first, she gets an education. In the second, she works in the labor market. If Debbie becomes a marine biologist, she will spend $15,000 on education in the first period and earn $472,000 in the second period. If she becomes a concert pianist, she will spend $40,000 on education in the first period and earn $500,000 in the second period. Suppose Debbie can lend and borrow money at a 5% rate of interest between the two periods. Which career will she pursue? What if she can lend and borrow money at a 15% rate of interest? Describe in general terms how Debbie’s decision depends on the interest rate. Debbie will compare the present value of income for each career choice and choose the career with the greater present value. If the interest rate is 5%,
PVBiologist $15,000 $472,000 / (1.05) $434,523.81 and
PVPianist $40, 000 $500, 000 / (1.05) $436,190.48 . Therefore, she will become a concert pianist. If the rate of interest is 15%, however, the present value calculations become
PVBiologist $15,000 $472,000 / (1.15) $395, 434.78 and
PVPianist $40, 000 $500, 000 / (1.15) $394, 782.61 . In this case, Debbie becomes a biologist. 46 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
As the interest rate increases, the worker discounts future earnings more, lowering the returns from investing in education. In this case, the higher interest rate makes the payoff from the $50,000 investment into becoming a concert pianist less valuable.
6-2. Peter lives for three periods. He is currently considering three alternative education– work options. He can start working immediately, earning $100,000 in Period 1, $110,000 in Period 2 (as his work experience leads to higher productivity), and $90,000 in Period 3 (as his skills become obsolete and physical abilities deteriorate). Alternatively, he can spend $50,000 to attend college in Period 1 and earn $180,000 in Periods 2 and 3. Finally, he can receive a doctorate degree in Period 2 after completing his college education in Period 1. This last option will cost him nothing when he is attending graduate school in the second period as his expenses on tuition and books will be covered by a research assistantship. After receiving his doctorate, he will become a professor in a business school and earn $400,000 in Period 3. Peter’s discount rate is 20% per period. What education path maximizes Peter’s net present value of his lifetime earnings? The present discounted values of Peter’s earnings associated with each of the alternatives are
PVHS 100,000
110,000 90,000 $254,167 , 1.2 1.22
PVCOL 50,000
180,000 180,000 $225,000 , 1.2 1.22
PVPhD 50,000
0 400,000 $227,778 . 1.2 1.22
and
Thus, the best option for Peter is to start working immediately upon completing high school.
6-3. Jane has 3 years of college, Pam has 2, and Mary has 1. Jane earns $21 per hour, Pam earns $19, and Mary earns $16. The difference in educational attainment is due completely to different discount rates. How much can the available information reveal about each woman’s discount rate? The returns to increasing one’s education from 1 to 2 years of college and then from 2 to 3 years of college are
r1to 2
$19 $16 $21 $19 18.75% and r2 to3 10.53% . $16 $19
47 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Having observed their educational choices, we know that Mary’s discount rate is greater than 18.75% (otherwise, she would have invested in a second year of education and earned 18.75% on the investment), Pam’s discount rate is between 10.53% and 18.75%, and Jane’s discount rate is less than 10.53%.
6-4. Suppose the skills acquired in school depreciate over time, perhaps because technological change makes the things learned in school obsolete. What happens to a worker’s optimal amount of schooling if the rate of depreciation increases? If the rate of depreciation is very high, the payoff to educational investments declines. As a result, a worker’s optimal amount of schooling will also fall as the benefits of education erode more rapidly.
6-5. (a) Describe the basic self-selection issue involved whenever discussing the returns to education. People choose their level of education knowing their own abilities, preferences, and financial situation. Most important here is knowing one’s abilities. Highly capable people would likely earn a large salary even if they didn’t attend college, but they choose to attend because they earn even more (net of the cost of college) by doing so. Likewise, less capable people know they are less capable and that they will not get very high-paying jobs even with a college degree. Consequently, highly capable people tend to go to college while less capable people are less likely to go to college, and the average wage of college graduates is higher than the average wage of noncollege graduates largely because of self-selected education levels due to innate skills or abilities. To put numbers with the problem, suppose highly capable person would earn $50,000 without a college education and $65,000 with a college education. Similarly, a less capable person would earn $20,000 without a college education and $35,000 with a college education. All high-ability people go to college, while none of the low-ability people do. Clearly in this example, if one knows the numbers, one would say that the return to college is $15,000 (for either group). If one just saw the raw data of who went to college (and who did not) and each person’s income, one would falsely conclude that the return to college is $45,000.
(b) Does the fact that some high school or college dropouts go on to earn vast amounts of money (e.g., Bill Gates dropped out of Harvard without ever graduating) contradict the self-selection story? No. If the cost of education gets large enough (or the returns to education get small enough), even highability people will forego college.
6-6. Suppose Carl’s wage–schooling locus is given by 48 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Years of Schooling 9 10 11 12 13 14
Earnings $18,500 $20,350 $22,000 $23,100 $23,900 $24,000
Derive the marginal rate of return schedule. When will Carl quit school if his discount rate is 4%? What if the discount rate is 9%? The marginal rate of return is given by the percentage increase in earnings if the worker goes to school one additional year.
Schooling 9 10 11 12 13 14
Earnings $18,500 $20,350 $22,000 $23,100 $23,900 $24,000
MRR 10.0 8.1 5.0 3.5 0.4
Carl will quit school when the marginal rate of return to schooling falls below his discount rate. If his discount rate is 4%, therefore, he will quit after 12 years of schooling; if his discount rate is 9%, he will quit after 10 years of schooling.
6-7. Suppose people with 15 years of schooling have average earnings of $60,000 while people with 16 years of education have average earnings of $66,000. (a) What is the annual rate of return associated with the 16th year of education? The annual rate of return is ($66,000 $60,000) / $60,000 10% .
(b) It is typically thought that this type of calculation of the returns to schooling is biased, because it doesn’t take into account innate ability or innate motivation. If this criticism is true, is the actual return to the 16th year of schooling more than or less than your answer in Part (a)? It is typically argued that people who are innately skilled or motivated pursue more education than those who are less innately skilled or motivated, because the cost (psychic and in terms of the time spent in college) is less for the innately skilled or motivated. If true, then the returns to education are overestimated by this type of simple calculation (i.e., a 10% rate of return is too high). Of course, the typical story might be wrong. The innately skilled or motivated might have to give up a lot in terms of 49 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
foregone earnings in order to attend college, which they might not need in the first place (e.g., Bill Gates, NBA players). If so, then the returns to education could be underestimated.
6-8. Suppose there are two types of people: high-ability and low-ability. A particular diploma costs a high-ability person $8,000 and costs a low-ability person $20,000. Firms wish to use education as a screening device where they intend to pay $25,000 to workers without a diploma and $K to those with a diploma. In what range must K be to make this an effective screening device? In order for a low-ability worker to not pursue education, it must be that
$25,000 K $20,000 . Otherwise, pursuing the diploma would be better than not pursuing the diploma for low-ability people. Thus, it must be that K 45,000 to make sure low-ability people don’t pursue the diploma. Similarly, in order for a high-ability worker to pursue education, it must be that
K $8,000 $25,000 . Otherwise, not pursuing the diploma would be better than pursuing the diploma for high-ability people. Thus, it must be that K $33,000 to make sure high-ability people pursue the diploma. Thus, in order to use education as a signaling device in this example, it must be that educated workers are paid between $33,000 and $45,000.
6-9. Some economists maintain that the returns to additional years of education are actually quite small but that there is a substantial ―sheepskin‖ effect whereby one receives a higher salary with the successful completion of degrees or the earning of diplomas (i.e., sheepskins). (a) Explain how the sheepskin effect is analogous to a signaling model. The sheepskin effect is analogous (in fact it is identical) to the signaling model in that purchasing the signal doesn’t actually change the person’s skills or productivity. Rather, purchasing the signal in effect documents or reveals that the person is a high-ability person. This is exactly the same as the sheepskin effect. That is, paying the money and sitting through classes and doing the work doesn’t change the person. Rather, no one without high skills would choose to do this, so acquiring a sheepskin is a tool by which to “signal” one’s productivity even though achieving the sheepskin had no direct effect on the individual.
(b) In the United States, a high school diploma is typically earned after 12 years of schooling while a college degree is earned after 16 years of school. Graduate degrees often 50 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
require between 2 and 6 years of post-college schooling. Redraw Figure 6-2 under the assumption that there are no returns to years of schooling but there are significant returns to receiving diplomas.
The Wage–Schooling Locus With Sheepskin Effects
The bold line in the above graph gives the wage–schooling locus with sheepskin effects. In particular, anyone without a high school diploma earns $18,000; anyone with a high school diploma (and no college diploma) earns $30,000; someone with a college diploma (but not a graduate school diploma) earns $42,000; and people with a graduate degree earn $68,000.
51 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
6-10. Consider a model with two periods—the first time period is the 4 years after high school and the second time period is the next 40 years. A person without a college education receives $120,000 of income during the first period and $1.2 million of income during the second period. A college graduate pays $200,000 during the first period to obtain a college degree and forgoes all earnings but then earns $2 million of income during the second period. Will the individual work or go to college in the first period if their individual rate of discount between the two periods is 40%? The present value of working immediately (not going to college) is:
PVNoCollege 120,000 1, 200,000 /1.4 $977,143 , while the present value of getting a college degree is
PVCollege 200,000 2,000,000 /1.4 $1, 228,571 . Therefore, as PVNoCollege PVCollege , the individual will choose to attend college.
6-11. One policy objective of the federal government is to provide greater access to college education for those who are less able to afford it. Recently, many state governments have passed budgets that have significantly reduced funding for state universities. Using supply and demand analysis, what is the likely effect on the price of a university education to potential students? What does your model predict in terms of the number of people who will complete a university education? Less state funding will not change the demand for education; however, less state funding means that universities will need to pay for more expenses out of their own revenue, meaning that the marginal cost of providing a university education will increase. With the supply of university educations shifting in (up), the equilibrium will be associated with a higher price for a university education and imply that fewer people will complete a university education.
52 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
53 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
6-12. In 1970, men aged 18–25 were subject to the military draft to serve in the Vietnam War. A man could qualify for a student deferment, however, if they were enrolled in college and made satisfactory progress on obtaining a degree. By 1975, the draft was no longer in existence. The draft did not pertain to women. According to the 2008 edition of the U.S. Statistical Abstract, 55.2% of male high school graduates enrolled in college in 1970, but only 52.6% were enrolled in 1975. Similarly, 48.5% of female high school graduates were enrolled in college in 1970, while 49.0% were enrolled in 1975. Use women as the control group to estimate (using the difference-in-differences methodology) the effect of abolishing the draft on male college enrollment. The difference-in-differences table is
College Enrollment (Percentage)
Men Women
1970 55.2 48.5
1975 52.6 49.0
Diff. −2.6 0.5
Diff.in-Diff. −3.1
Thus, abolishing the draft is estimated to have lowered the college enrollment rate of men by 3.1 percentage points.
6-13. In Section 6-5, the textbook discusses some strategies for correcting for ability bias when trying to estimate the rate of return to education. (a) What is the main argument for why data on identical twins can control for ability bias? What problem arises if most pairs of identical twins pursue different levels of education? What problem arises if most pairs of identical twins pursue the same level of education? The main argument for why using data on identical twins can control for ability bias rests on the assumption that identical twins are also identical in ability. As long as this assumption is true, then wage models can be differenced between twins, the ability portion drops out, and the true rate of return remains. (This is shown in the textbook.) There are two issues with this method. First, if most pairs of identical twins actually pursue different levels of education, this calls into question the assumption that identical twins are identical in ability as differences in ability are a likely reason for the difference in education. Alternatively, if most pairs of identical twins pursue the same amount of education, then the rate of return to education is left to be estimated by just the small handful of twins in the sample who have pursued different levels of education. Looking at the equation in the text, s 0 for any pair of twins with identical education, and therefore that observation lends no predictive information for b.
54 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) What is the main argument for why using certain birthdates can control for the bias? Do you think this method will work better in identifying the rate of return to different years of high school education or college education? Why?
55 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
The main idea for using birthdates (or birth quarter as is common in the literature) is that education enrollment laws provide differences in kindergarten enrollment ages. Therefore, two people can be born relatively close together in time but have up to a year different in education when they drop out of high school at age 16. This method is likely better at estimating the rate of return to additional years of a high school education than additional years of a college education, because the mechanism by which birthdate is argued to serve this role pertains to dropping out of high school. It could be useful for college as well using maturity arguments, but this is a much less clear mechanism.
6-14. In the typical signaling model, it is assumed that the costs of acquiring an education are higher for low-ability than for high-ability workers. Suppose that the government steps in and subsidizes low-ability workers for the higher costs they incur in getting an education (such as giving everyone who has been in school for 12 years a high school diploma, regardless of the person’s performance in the classroom). Discuss what happens to the signaling value of a person’s education. Can there be a perfectly separation equilibrium in this labor market? If the government subsidizes schooling so that the cost of schooling is the same for all workers, then the signaling value of schooling is lost. There cannot be a perfectly separating equilibrium because all workers then have the same incentive to obtain the same amount of schooling.
6-15. Suppose the decision to acquire schooling depends on three factors—preferences (joy of learning), costs (monetary and psychic), and individual-specific returns to education. (a) Explain how each of these factors affects one’s optimal amount of schooling? People who receive more joy from learning are more likely to acquire more schooling. People who face higher costs of schooling are likely to acquire less schooling. People who benefit from a greater individual-specific return to additional years of education are likely to acquire more schooling.
(b) Using these three factors, explain why someone who faces a very steep wage–schooling locus may still opt to obtain very little schooling. Someone who faces a very steep returns to education function (so that the person benefits from a very high individual-specific return to education) might still opt to acquire very little schooling if the person absolutely hates the process of acquiring schooling or if the person faces extraordinarily high costs to schooling. At the extreme, for example, someone who faces insurmountable costs to schooling— extremely high tuition, a family situation that requires the person to work rather than go to college, laws that facilitate segregation, and so on—simply cannot acquire more schooling regardless of what the individual rate of return is.
56 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(c) Consider two groups of people—Alphas and Betas. The cost of schooling is the same for each. The average level of schooling and salary for Alpha types is 15 years and $120,000, while the average level of schooling and salary for Beta types is 13 years and $100,000. Why is it that 10%, which is calculated as ($120, 000 $100, 000) / (15 13) , is not a good estimate of the annual return to an additional year of education? This is not a good estimate of the annual return to an additional year of education because the two groups may differ in their preferences, costs, or returns. For example, if Alpha types are more highly motivated, their average salary if only 13 years were acquired may be $116,000 (not the Beta’s average of $100,000). Similarly, if Beta types are less motivated, their average salary if 15 years were acquired may be $104,000 (not the Alpha’s average of $120,000). In this case, the annual rate of return is roughly 2%, not 10%.
CHAPTER 7 7-1. Evaluate the validity of the following claim: The increasing wage gap between highly educated and less educated workers will itself generate shifts in the U.S. labor market over the next decade. As a result of these responses, much of the ―excess‖ gain currently accruing to highly educated workers will soon disappear. The incentives for young workers to stay in school rose as a result of the increasing wage differential across schooling groups. The widening wage inequality, therefore, would be expected to increase the number of young persons who obtain a college education. This increase in the supply of highly educated workers will eventually narrow the wage gap between the highly educated and the less educated. The extent to which the supply response narrows the ―excess gain‖ depends on two parameters: (1) the elasticity of supply measuring how college enrollments respond to the increasing relative wage of college graduates and (2) the elasticity of demand measuring the responsiveness of the relative wage of college graduates to an increase in their supply. The greater these elasticities are in the coming years, the greater role the ―selfcorrecting‖ mechanism will play in reducing wage inequality in the future. 7-2. What effect will each of the following proposed changes have on wage inequality? (a) Indexing the minimum wage to inflation. Indexing the minimum wage to inflation should reduce wage inequality because the minimum wage helps prop up the wages of less-skilled workers. Note that an increase in the minimum wage may have negative employment effects, but the proposed policy is not to increase the minimum wage but rather simply to prevent it from falling in real terms. (b) Increasing the benefit level paid to welfare recipients. Wage inequality measures the dispersion of wages in the working population. An increase in welfare benefits would likely induce less-skilled workers out of the labor force and would reduce measured wage inequality by effectively eliminating the bottom of the wage distribution. 57 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(c) Increasing wage subsidies paid to firms that hire low-skill workers. Wage subsidies would increase the demand for less-skilled workers, reducing wage inequality.
58 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
7-3. From 1970 to 2000, the supply of college graduates to the labor market increased dramatically, while the supply of high school graduates (with no college education whatsoever) shrunk. At the same time, the average real wage of college graduates stayed relatively stable, while the average real wage of high school graduates fell. How can these wage patterns be explained? The graphs below show equilibrium movements in the market for high school graduates and in the market for college graduates. The decrease in labor supply among high school graduates and the increase in labor supply among college graduates is taken as given. The analysis, therefore, focuses on labor demand for each type of labor. Given a lower supply of high school graduates, the only way for their average wage to fall is for labor demand for high school graduates to have decreased (shifted in).
Given a greater supply of college graduates, the only way for their average wage to stay the same is for labor demand for college graduates to have increased (shifted out).
59 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
7-4. (a) Is the presence of an underground economy likely to result in a Gini coefficient that overstates or understates poverty? The larger the underground economy, the more the Gini coefficient is likely to overstate poverty as the underground economy tends to employ low-skill, low-income workers. (b) Consider a simple economy where 90% of persons report an annual income of $10,000 while the remaining 10% report an annual income of $110,000. What is the Gini coefficient associated with this economy? As all persons in each group receive an equal income, the actual Lorenz curve will be a straight line within each group. Let’s suppose there are 1,000 citizens. The 90% of poorest persons, therefore, receive 0.90×1,000×$10,000 = $9 million . The entire economy, though, earns 0.90×$10,000 + 0.1×$110,000 = $20 million . Therefore, the bottom 90% receives 9 ÷ 20 = 45% of total income. The perfect and actual Lorenz curves can now be drawn rather easily.
The Gini coefficient is now easily calculated by seeing that the area beneath the actual Lorenz curve is two triangles and one rectangle.
1 1 1 0.9 0.45 0.1 0.45 0.55 0.1 2 2 2 0.45. Gini 1 2 (c) Suppose the poorest 90% of persons actually have an income of $15,000 because each receives $5,000 of unreported income from the underground economy. What is the Gini coefficient now? The problem is identical to that above, but the income levels change. In this case, per capita GDP is 0.9×15,000 + 0.1×110,000 = $24,500 so total income of the 1,000 citizens is $24,500,000. 60 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Lastly, the total income share of the poorest 90% of citizens is 900 15,000 24.5 million 55.1% . (That is, in the graph on the previous page, the income share at 90% of citizens increases from 45% to 55.1%.) The Gini coefficient is not calculated as it was before:
1 1 1 0.9 0.551 0.1 0.551 0.449 0.1 2 2 2 0.349. Gini 1 2 7-5. Use the two wage ratios for each country in Table 7-4 to calculate each country’s percent increase in the 90–10 wage ratio from 1984 to 1994. Which countries experienced a compression in the wage distribution over this time? Which three countries experienced the greatest percent increase in wage dispersion over this time? The results are: Country Germany Canada Norway Japan Finland France Netherlands Australia Sweden United States United Kingdom New Zealand Italy
90–10 Wage Gaps 1984 138.7 301.5 105.4 177.3 150.9 232 150.9 174.6 103.4 266.9 177.3 171.8 129.3
1994 124.8 278.1 97.4 177.3 153.5 242.1 158.6 194.5 120.3 326.3 222.2 215.8 163.8
Percent Change −10.02 −7.76 −7.59 0.00 1.72 4.35 5.10 11.40 16.34 22.26 25.32 25.61 26.68
Thus, Germany, Canada, and Norway (with Japan holding constant) all experienced a compression in the wage distribution over this time. The United Kingdom, New Zealand, and Italy experienced the largest percent increases in wage dispersion.
61 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
7-6. (a) What is the difference between income inequality and wealth inequality? Income inequality refers to differences in earned income, sometimes just labor income, sometimes both labor and investment income. Wealth inequality refers to differences in accumulated wealth, which is driven in part by income inequality but also in part by saving and spending behavior. The difference is important, because wealth (accumulated savings) is almost always more unequal than income. (b) Most policies that target inequality either target it at the low end of the income distribution by trying to increase wages of low-income workers or at the high end of the income distribution by limiting wages of high-income workers. List a few potential policies of each type. Pell grants and guaranteed student loans are designed to fundamentally lessen inequality by giving children of low-income parents greater access to education. Policies like the minimum wage, the progressive tax system, and the Earned Income Tax Credit are all designed in part to partially offset income inequality by transferring resources from the rich to the poor. The estate tax is a primary policy aimed at alleviating inequality by targeting the high end as it is supposed to prohibit family dynasties in terms of wealth. (c) In your opinion, should the government focus on the low end or the high end? Why? In many people’s opinion, the government should focus most of its efforts at the low end for a couple of reasons. Most importantly, there are a lot more people at the low end than at the high end, so having effective policies in place (like Pell grants) can give everyone a chance to make decisions to help themselves economically. Also, many proposals to alleviate inequality targeted at the high end would, to some extent, stifle innovation. In simple terms, the question is whether inequality is a problem because Bill Gates created Microsoft or because 20% of minority students drop out of high school and don’t go to college. (d) In order to better understand how sensitive inequality measures are to the choice of measure, provide a graph of an economy with a 90–10 wage gap that is essentially zero but for which the Gini coefficient is close to 1. Consider an economy where 95% of the economy earns essentially nothing, with 5% of the economic agents earning essentially everything. Such an economy will have a 90–10 wage gap that is essentially zero (as the 90 percentile person earns roughly what the 10 percentile person earns) but also has a Gini coefficient close to 1 as 5% of the agents earn almost all of the income.
62 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
7-7. It has been argued that the minimum wage prevents workers from investing in on-thejob training and discourages employers from providing specific training to low-income workers. Why would the minimum wage have an adverse impact on human capital accumulation for low-income workers? We have seen that a firm which offers general or specific training in the first period pays the worker a wage below their marginal product while the investment is taking place and above their marginal product in the post-investment period. However, if the minimum wage prevents the investment-period wage from falling sufficiently, firms may not be able to offer the training. The minimum wage, therefore, could have an adverse impact on human capital accumulation for lowwage workers.
7-8. Most government-provided job training programs are optional to the worker. Describe how the self-selection issue might be used to call into question empirical results suggesting there are large economic benefits to be gained by requiring all workers to receive government-provided job training. As job training programs are optional, and a desire or willingness to work or try to get a new job or to get retrained is probably the most important factor in a person’s success, there is certainly a self-selection story to be told. In particular, the successful people coming out of job training programs would likely have been successful even if left on their own because of their innate ability or motivation. Similarly, the people who did not choose job training and failed to get a job would likely have failed to get a job even if the government required them to pursue job training. 7-9. Ms. Aura is a psychic. The demand for her services is given by Q = 2,000 10 P , where Q is the number of 1-hr sessions per year and P is the price of each session. Her marginal revenue is MR 200 0.2Q. Ms. Aura’s operation has no fixed costs, but she incurs a cost of $150 per session (going to the client’s house). (a) What is Ms. Aura’s yearly profit? Find the number of sessions that Ms. Aura will provide by equating the marginal revenue to the marginal cost of a session: 63 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
MR = MC 200 0.2Q 150 0.2Q = 50 Q* = 250. The price that would generate demand for 250 sessions is $175. Thus, her annual profit is 175(250) 150(250) $6, 250 per year. (b) Suppose Ms. Aura becomes famous after appearing on the Psychic Network. The new demand for her services is Q 2,500 5 P . Her new marginal revenue is MR 500 0.4Q . What is her profit now? The same kind of calculations as in Part (a) but using the new demand curve yields a profit maximizing quantity of 875 sessions at a price of $325 per session and an annual profit of $153,125. (c) Advances in telecommunications and information technology revolutionize the way Ms. Aura does business. She begins to use the internet to find all relevant information about clients and meets many clients through teleconferencing. The new technology introduces an annual fixed cost of $1,000, but the marginal cost is only $20 per session. What is Ms. Aura’s profit? Assume the demand curve is still given by Q 2,500 5 P . With the new marginal cost, Ms. Aura will provide 1,200 sessions and charge $260 per session. Her annual profit will equal $287,000, which accounts for the $1,000 fixed cost. (d) Summarize the lesson of this problem for the superstar phenomenon. Superstars command an economic rent because they are, in essence, a monopoly with a favorable demand curve. The greater the demand for the superstar’s product, the higher price the superstar can charge, and the more profit can be earned. 7-10. Jill is planning the timing of her on-the-job training (OJT) investments over the life cycle. What happens to Jill’s OJT investments if: (a) the market-determined rental rate to an efficiency unit falls? When the marginal revenue of investing in OJT declines, Jill will invest less at each age as the return to making the investment has fallen. (b) Jill’s discount rate increases? If Jill’s discount rate increases, she becomes more ―present oriented,‖ reducing the future benefits associated with OJT. Thus, her OJT investments fall as she no longer values the benefits from making the investment as much as she had before her discount rate fell. (c) the government passes legislation delaying the retirement age until age 70? 64 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
The marginal revenue of investing in OJT increases because the payoff period to the investment is longer. Thus, she undertakes more OJT in this case. (d) technological progress is such that much of the OJT acquired at any given age becomes obsolete within the next 10 years? The marginal revenue to investing in OJT declines, so the amount of OJT acquired falls. 7-11. Suppose two households earn $40,000 and $56,000, respectively. What is the expected percent difference in wages between the children, grandchildren, and greatgrandchildren of the two households if the intergenerational correlation of earnings is 0.2, 0.4, or 0.6? If the intergenerational correlation of earnings is r, the percent difference in earnings of the children is (56,000 40,000)r / 40,000 0.4r , of grandchildren is 0.4r 2 , and of greatgrandchildren is 0.4r 3 . Therefore, we have that the expected percent difference in earnings is: Correlation 20% 40% 60%
Children 8% 16% 24%
Grandchildren 1.6% 6.4% 14.4%
Great-Grandchildren 0.32% 2.56% 8.64%
7-12. Suppose 50% of a population all receive an equal share of p percent of the nation’s income while the other 50% of the population all receive an equal share of 1 p of the nation’s income where 0 p 50 . (a) For any such p, what is the Gini coefficient for the country? Calculating the Gini coefficient is most easily done with reference to a graph. Notice, given the setup of the problem, there are two sections to the graph of the distribution of national income, and both are linear segments.
65 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
So, now the Gini coefficient is the area between the bold line and the dashed bold line divided by one-half. This is easiest to figure as the area below the bold line (one-half) less the area below the dashed bold line. The area below the dashed bold line equals
(0.5) p 0.5 p (0.5)(0.5)(1 p) 0.25 0.5 p. Finally, the Gini coefficient is (0.5 0.25 0.5 p) / 0.5 0.5 p . (b) For any such p, what is the 90–10 wage gap? Each person (percentile) in the lower half of the distribution receives 0.02pM, where M is national income. Similarly, each person (percentile) in the top half of the distribution receives 0.02(1 p)M . As the 10th percentile person is in the lower half and the 90th percentile person is in the upper half, the 90-10 wage gap is 0.02 (1 p) M / 0.02 pM (1 p) / p . 7-13. Consider two developing countries. Country A, though quite poor, uses government resources and international aid to provide public access to quality education. Country B, though also quite poor, is unable to provide quality education for institutional reasons. The distribution of innate ability is identical in the two countries. (a) Which country is likely to have a more positively skewed income distribution? Why? Plot the hypothetical income distributions for both countries on the same graph. At the outset, there is no reason to think the distribution of income is different between the two countries. However, one could argue that Country A collects more taxes than Country B, and as taxes are likely to fall more heavily on the rich, that the simple act of collecting taxes in Country A will cause it to lessen the skewness in its income distribution relative to Country B. Of course, one could make the alternative argument—that developing countries overtax their poorest workers more than the rich. The graph below, however, assumes the first case.
(b) Which country is more likely to develop faster? Why? Plot the hypothetical income distributions in 20 years for both countries on the same graph. Country A is likely to develop faster because of its savings and investments into education (human capital). 66 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
7-14. Consider an economy with 10,000 individuals. Of them, 5,000 each earn $25,000; 3,000 each earn $40,000; and 2,000 each earn $100,000. (a) What is the Gini coefficient for this economy? Total income in the economy is 5,000 $25,000 3,000 $40,000 2,000 $100,000 $445 million. The bottom group receives 5,000 $25,000 / $445 million 28.09% . The middle group receives 3,000 $40,000 / $445 million 26.97% . The top group receives 2,000 $100,000 / $445 million 44.94% . Therefore, the Gini coefficient is calculated as:
1 1 1 1 0.5 0.2809 0.3 0.2809 0.3 0.2697 0.2 0.5506 0.2 0.4494 2 2 2 2 . Gini 1 2 The calculation produces a Gini coefficient equal to 0.30. (b) What would the Gini coefficient be if the wealthiest 2,000 individuals were taxed 30% of their income with the proceeds being transferred to the 5,000 poorest individuals? To begin, we need to know what the amount of the transfer is. As the wealthiest group is taxed at 30%, their $100,000 incomes will be reduced to $70,000. Moreover, as there are 2,000 people in this group, total tax revenue equals 2,000 $30,000 $60 million . This $60 million is equally distributed to the poorest 5,000 individuals, so each of these individuals receives an additional $60 million / 5,000 $12,000 in income for a total income of $37,000 per individual. Now the problem can be repeated as above. Total income in the economy is 5,000 $37,000 3,000 $40,000 2,000 $700,000 $445 million. The bottom group receives 5,000 $37,000 / $445 million 41.57% . The middle group receives 3,000 $40,000 / $445 million 26.97% . The top group receives 2,000 $70,000 / $445 million 31.46% . Therefore, the Gini coefficient is calculated as:
67 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
1 1 1 1 0.5 0.4157 0.3 0.4157 0.3 0.2697 0.2 0.6854 0.2 0.3146 2 2 2 2 . Gini 1 2 The calculation produces a Gini coefficient equal to 0.1247. Thus, the tax transfer reduced inequality quite substantially if one considers the Gini coefficients you produced in Question 7 for a wide variety of countries. 7-15. Explain how each of the following policy proposals might affect the intergenerational correlation of earnings. (a) Improved educational outcomes for all populations (e.g., minority, low-income, rural). Improved educational outcomes for all populations should lower the intergenerational correlation of earnings as wealth becomes less of a factor in determining educational outcomes and economic success. (b) The elimination of legacy admits to colleges and universities. The elimination of legacy admits to colleges and universities should lower the intergenerational correlation of earnings as parental education becomes less of a factor in determining educational outcomes and eventually economic success. (c) The implementation of a federal inheritance tax. The implementation of a federal inheritance tax should lower the intergenerational correlation of earnings as children are less able to benefit from their parent’s wealth. CHAPTER 8 8-1. Suppose a worker with an annual discount rate of 10% currently resides in Pennsylvania and is deciding whether to remain there or to move to Illinois. There are three work periods left in the life cycle. If the worker remains in Pennsylvania, they will earn $20,000 in each of the three periods. If the worker moves to Illinois, they will earn $22,000 in each of the three periods. What is the highest cost of migration that a worker is willing to incur and still make the move? The worker must compare the present value of staying in Pennsylvania to the present value of moving to Illinois. A worker will move if the present value of earnings in Illinois minus the costs of moving there exceed the present value of earnings in Pennsylvania:
P VP A 20, 000
20, 000 20, 000 $54, 710.74 1.1 (1.1)2
and 68 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
PVIL 22,000
22,000 22,000 $60,181.82. 1.1 (1.1)2
The worker will move, therefore, if PVIL C > PVPA ,
where C denotes migration costs. Thus, the worker moves if C 60,181.82 54, 710.74 $5, 471.08 .
8-2. Suppose high-wage workers are more likely than low-wage workers to move to a new state for a better job. (a) Explain how this migration pattern can be due solely to differences in the distribution of wages? Suppose migration costs are the same for all workers at $3,000. Suppose further that all lowwage workers are paid either $20,000 or $22,000 depending on productivity and location, and that all high-wage workers are paid either $40,000 or $45,000 depending on productivity and location. The immediate result is that no low-wage worker will ever migrate, while all high-wage workers who are not already earning $45,000 will migrate to a location where they are valued at $45,000. (b) Explain how this migration pattern can take place even if the cost to moving is greater for high-wage workers? What matters is the difference in wages due to migration and the cost of migration. In the previous example, for instance, even if the cost to migration was $4,000 for high-wage workers while it remained at $3,000 for low-wage workers, the same pattern of no low-wage workers migrating and all high-wage workers migrating until they find a job that pays $45,000. 8-3. Patrick and Rachel live in Seattle. Patrick’s net present value of lifetime earnings in Seattle is $125,000, while Rachel’s is $500,000. The cost of moving to Atlanta is $25,000 per person. In Atlanta, Patrick’s net present value of lifetime earnings would be $155,000, while Rachel’s would be $510,000. If Patrick and Rachel choose where to live based on their joint well-being, will they move to Atlanta? Is Patrick a tied-mover or a tied-stayer or neither? Is Rachel a tied-mover or a tied-stayer or neither? As a couple, the net present value of lifetime earnings of staying in Seattle is $500,000 $125,000 $625,000 and of moving to Atlanta is $510,000 $155,000 $50,000 $615,000. Thus, as a couple, they would choose to stay in Seattle.
69 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
For Patrick, staying in Seattle is associated with a net present value of $125,000, while moving to Atlanta would yield a net present value of $155,000 $25,000 $130,000 . So Patrick would choose to move to Atlanta. Therefore, Patrick is a tied-stayer. For Rachel, staying in Seattle is associated with a net present value of $500,000, while moving to Atlanta would yield a net present value of $510,000 – $25,000 $485,000 . So Rachel would choose to remain in Seattle. Thus, Rachel is not a tied-stayer. 8-4. Consider a household consisting of four college friends. The friends have made a commitment to live together for the next 5 years. Presently, they live in Milwaukee where Abby will earn $200,000, Bonnie will earn $120,000, Cathy will earn $315,000, and Donna will earn $150,000 over the next 5 years. They have the option of moving to Miami. Moving to Miami would impose a one-time moving cost of $5,000 on each person. If they move to Miami, however, Abby will earn $180,000, Bonnie will earn $150,000, Cathy will earn $300,000, and Donna will earn $100,000 over the next 5 years. Moreover, each friend prefers to live in Miami over Milwaukee. In particular, Abby and Bonnie both value the quality of life in Miami versus Milwaukee over the next 5 years at $40,000 while Cathy and Donna place the value at $25,000 each. Should the household move to Miami or stay in Milwaukee? Is anyone a tied-mover or a tied-stayer? The present value of staying in Milwaukee is calculated in thousands of dollars as PVMIL $200 $120 $315 $150 $785.
The present value of moving to Miami is calculated as PVMIAMI $180 $150 $300 $100 $20 $80 $50 $840.
Therefore, the household will move to Miami as PVMIAMI > PVMIL . As a result, no one can be a tied-stayer as the household doesn’t stay in Milwaukee. To determine if anyone is a tied-mover, one must calculate the present value calculations for each friend. Abby: PVMIL $200 versus PVMIAMI $180 $5 $40 $215 Abby wants to move. Bonnie: PVMIL $120 versus PVMIAMI $150 $5 $40 $185 Bonnie wants to move. Cathy: PVMIL $315 versus PVMIAMI $300 $5 $25 $329 Cathy wants to move. Donna: PVMIL $150 versus PVMIAMI $100 $5 $25 $2,120 Bonnie wants to stay . Thus, Donna is the only tied-mover while the other three friends all strictly prefer to move to Miami.
70 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
8-5. Suppose the United States enacts legislation granting all workers, including newly arrived immigrants, a minimum income floor of y dollars. (Assume there is positive selection of migrants from the home country to the United States before the policy change.) (a) Generalize the Roy model to show how this type of welfare program influences the incentive to migrate to the United States. Ignore any issues regarding how the welfare program is funded. The introduction of a wage floor in the United States (at yy ) shifts the U.S. earnings–skill relationship from the straight line (United States) to the bold line (kinked) drawn in the figure below. The welfare program does not affect the incentives of foreigners with high or even moderate skills. However, it does affect the incentives of those with the least skills as they earn very little in the home country and now can come to the United States and benefit from the welfare benefit.
(b) Does this welfare program change the selection of the immigrant flow? In particular, are immigrants more likely to be negatively selected than in the absence of a welfare program? As drawn above, before the welfare program was enacted, there was only positive selection in terms of immigration to the United States. With the welfare benefit in place, though, foreigners with skills below sL now also find it profitable to migrate. Thus, the selection of immigrants becomes more negative. In fact, it is a bimodal distribution—foreigners with the highest skills continue to migrate and now those with the lowest skills also choose to migrate. (c) Which types of workers, the highly skilled or the less skilled, are most likely to be attracted by the welfare program? As the returns to skills are higher in the United States, there are two sets of workers who find it profitable to move: those who have very high skill levels (above sH ) as well as those workers who have very low skill levels (below sL ). The welfare program, therefore, acts as a welfare 71 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
magnet for workers originating in countries that generate ―brain drains,‖ but not in countries where unskilled workers have incentives to migrate even in the absence of wage floors. 8-6. In the absence of any legal barriers on immigration from Neolandia to the United States, the economic conditions in the two countries generate an immigrant flow that is negatively selected. In response, the United States enacts an immigration policy that restricts entry to Neolandians who are in the top 10% of Neolandia’s skill distribution. What type of Neolandian will now migrate to the United States? No one would migrate from Neolandia. The policy does not change the cost–benefit analysis for the most skilled Neolandians. They did not want to migrate when they could enter the country freely, and they still will not want to migrate when they are the only ones who can obtain visas. The lesson is that changes in immigration policy affect the skill composition of the immigrant flow only if policy changes target immigrants who wished to migrate to the United States in the first place or provide a new incentive to those who did not. 8-7. One trend in the U.S. labor market, accelerated by the COVID-19 pandemic, is telecommuting or working at home. More and more firms allow working from home, and many firms even allow employees to live and work in one city for most of the year, flying to the firm’s headquarters for 3 or 4 days of work every quarter. How is this trend likely to affect job mobility (i.e., workers switching jobs)? How is this trend likely to affect internal migration rates in the United States (i.e., the rate of households moving across cities)? Using the standard migration model, when a worker doesn’t need to move cities to accept a new job, that worker faces a lower if not zero switching cost, which allows the worker to switch jobs more easily (i.e., imposing less cost and trauma on the entire household). So looking at the problem through a ―migration cost‖ or ―job switching cost‖ model, job turnover should increase. One could make the argument that although more firms are allowing telecommuting because of technology advances, we know that workers value this option (otherwise it wouldn’t be a trend). Viewing telecommuting as a benefit that workers value, therefore, likely makes workers more attached to their current job where telecommuting exists. Thus, lowering job mobility. This argument, though, is tenuous. Assuming a worker currently holds Job A and is considering Job B and both offer telecommuting, then this benefit does not place either job in a better position. The trend in telecommuting should also manifest itself with lower internal migration raters in the United States as workers can switch jobs (increased mobility) without switching locations.
8-8. It is illegal to enter the United States without a visa or to overstay one’s visa. It is also illegal for U.S. employers to hire undocumented or ―illegal‖ immigrants. Meanwhile, federal enforcement of immigration laws tends to concentrate resources on reducing illegal immigration rather than on prosecuting U.S. firms for employing undocumented workers. Using supply and demand analysis, show what would happen to the wage and employment level of undocumented workers if the government pursued more active enforcement on the 72 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
employer side. According to your model, what would happen to the wage and employment level of documented workers? This problem is best answered by considering two labor markets concurrently—the market for undocumented workers and the market for documented workers. Focusing enforcement on the employers (i.e., fining employers caught employing undocumented workers) would decrease the demand for undocumented workers. Essentially, if the cost of hiring undocumented workers increases because of potential fines, then in order to hire the same number of such workers, the wage will need to fall. What would happen in the market for documented workers is a little unclear. Certainly employment wouldn’t fall nor would wages. One could make the argument that nothing would happen in this market. (For example, maybe an employer will replace all undocumented workers with machines.) However, more likely is that the demand for documented workers will increase, not because such workers are all of a sudden more productive, but rather because the legal cost of hiring such workers has fallen, at least relatively. In the analysis below, it is assumed that the enforcement mechanism lowers the demand for undocumented workers and increases the demand for documented workers. The result is that the employment and wage of undocumented workers both fall while the employment and wage of documented workers both increase.
73 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
74 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
8-9. Under the 2001 tax legislation enacted in the United States, all income tax filers became eligible to deduct from their total income half of the expenses incurred when moving more than 50 miles to accept a new job. Prior to the change, only tax filers who itemized their deductions were allowed to deduct their moving expenses. Typically, homeowners itemize their deductions and renters do not itemize. How would this change in tax policy likely affect the mobility of homeowners and renters? The policy change has no effect on homeowners, whereas the policy change reduces the cost of moving for renters. Therefore, the policy is predicted to increase the mobility of renters. 8-10. Suppose the immigrant flow from Lowland to Highland is positively selected. In order to mitigate the ―brain drain‖ Lowland experiences as a result of this migration, public officials of Lowland successfully convince all Lowlanders who migrate to Highland to remit 10% of their wages to family members. (a) What effect will this policy have on the immigrant flow? The policy, in essence, increases the cost of migration. In particular, the policy convinces everyone who is thinking about immigrating to act as if their wage in Highland will be 90% of what it actually is because immigrants ―must‖ remit 10% of their earnings. Therefore, if all people in Lowland would have to agree to remittances before immigrating to the Highland, the selection would become even more positively skewed as people who used to be close to the margin but decided to immigrate will now be on the other side of the margin and decide to not immigrate (and these people are the least skilled of the original immigrants). (b) Provide a graph that details the extent to which this policy will limit the brain drain. The implication is that fewer people will immigrate from Lowland to Highland, with the action taking place on the margin (Section A in the graph below). Thus, the policy limits the brain drain partially as some high-skill people who otherwise would have immigrated no longer do. However, the policy will not prevent the most skilled people from still immigrating. Thus, Lowland still experiences brain drain of its best people. In particular, the graph shows that Lowlanders with skills in A or B immigrate to Highland before the policy. After the policy, those in B still immigrate, but those in A no longer opt to do.
75 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
8-11. (a) According to standard migration theory, how will skill selection (positive vs. negative) change on average as the distance between the source country and the destination country increases? The further two countries are apart from each other, the greater are the monetary costs of migrating just in terms of traveling to the destination country, but also in terms of returning home for visits, possibly in terms of culture, and so on. Thus, skill selection should be more and more positively selected the further the home country is from the destination country. (b) The 1990 U.S. Census data can be used to estimate the average wage differential between immigrants to the United States by country of origin, and compare those to the average native wage of workers with similar characteristics such as education, age, and occupation. The data suggest that the average Canadian immigrant earns about 25% more than Americans while the average Mexican immigrant earns about 40% less. Similarly, Indian immigrants earn about 12% more than Americans while Vietnamese immigrants earn almost 20% less. Do these empirical results support the idea that skill selection is a monotonic function of the distance between countries? If not, what might explain the differences? If the theory held perfectly and skill selection was monotonic by distance, the estimates for Canadians and Mexicans should be similar, the estimates for Indians and Vietnamese should be similar, and the estimates for Indians/Vietnamese should be less (or more negative) than the estimates for Canadians/Mexicans. Therefore, these empirical results do not lend support that skill selection is monotonic with distance. One likely explanation is that, while distance matters, culture and/or language matter more. It is probably no coincidence that the data from Canada and India, two English-speaking countries, suggest positive selection, while the data from Mexico and Vietnam, two non-English-speaking countries, suggest negative selection. 76 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
8-12. (a) Explain how a universal health care system would likely cause a greater amount of efficient turnover. Presently, many Americans receive employer-based health insurance. That is, employers pay a portion (or all of) the insurance premiums. The benefit of health insurance, therefore, would be lost if the employee separates from the job. In particular, many people would refuse to leave one job with health insurance benefits for another (even higher paying) job without health insurance benefits simply because of the risk. Under a universal health care system, everyone receives health benefits regardless of employment. Thus, workers would not feel tied to a particular job simply because they were currently receiving benefits. Consequently, a universal health care system would likely cause a greater amount of efficient labor turnover as workers seek out better employer matches without worry about losing health care benefits. (b) Defined-benefit retirement plans promise a fixed amount of retirement income to workers, but in order to receive benefits workers must be vested in the plan which usually requires working at the firm for 10 or 15 years. In contrast, a defined-contribution retirement plan specifies a fixed amount of money the firm contributes each pay period to a worker’s retirement fund which the worker then largely controls and can access even if they change jobs. Do defined-benefit or defined-contribution retirement plans allow for more efficient turnover? Defined-contribution retirement plans allow for more efficient labor turnover, because the money (i.e., value of the benefit/asset) is in the employee’s control and belongs to the employee even after separating from the job. So, just like in Part (a), a defined-contribution plan follows the worker from job to job just like a universal health care system would, while a defined-benefit plan that requires the employee to become vested with the plan ties the employee to the firm just like employer provided health insurance. (c) When federal workers in Washington, DC, move jobs from one federal agency to another, the worker keeps their same health insurance and retirement benefits. In order to quantify the degree to which ease of transfer of benefits affects job sorting, two groups of new economists who accept a job in Washington, DC, are observed. The first group is composed of U.S. citizens. The second group is composed of non-U.S. residents who eventually received permanent resident status after 3 years of work experience. By law, several government agencies cannot hire nonresidents. Among the group of U.S. citizens, 42% changed jobs within the first 3 years of work while 33% changed jobs during their fourth to sixth years of work. Among the group of non-U.S. residents, 17% changed jobs in the 3 years before becoming a resident while 29% changed jobs in the 3 years after becoming a U.S. resident. Provide a difference-in-differences estimate of the effect of being a U.S. resident/citizen on job turnover. The data generate the following table. Group
Turnover Years 0–3
Turnover Years 4–6
Diff.
Diff.-in-Diff.
77 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Group U.S. Citizens Noncitizens
Turnover Years 0–3 0.42 0.17
Turnover Years 4–6 0.33 0.29
Diff. −0.09 +0.12
Diff.-in-Diff. +0.21
Receiving a green card, which opens up job possibilities, therefore, is associated with a turnover rate that is 21 percentage points higher. 8-13. The Immigration Reform Act of 2006 provided fewer work visas than were available in previous years for college graduates to remain in the United States. The exception is that work visas remained plentiful for college graduates who majored in technical areas such as math, computer programming, and physics. (a) How will this policy likely affect the skill distribution of immigrants to the United States and the age–earnings profile of immigrants in the United States? The policy favors high-tech college majors, not so much in terms of attracting them to the United States but rather in terms of allowing them to stay once they were educated in the United States. Thus, the policy will likely allow more high-tech (high-skill) immigrants to stay in the United States while requiring others to leave the United States after college. Measured in terms of wages, therefore, the policy will likely result in a greater positive skill selection and result in a higher age–earnings profile of new immigrants. (b) In the future, a demographer uses the 2010 U.S. census to study immigrant wages and concludes that the U.S. policy actually had the unintended consequence of attracting immigrants with lower levels of productivity as shown by a flatter age–earnings profile. Using a graph similar to Figure 8-7, show why the demographer’s conclusions are sensitive to cohort effects.
78 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
In 2010, when using cohort analysis, the age–earnings profile will appear to be flatter than during similar previous studies. This is because the average wage of 20-something immigrants will be higher than it would have been without the policy and therefore the profile between 20somethings and 30-somethings will appear to be less steep. Put differently, because of the higher earnings of the younger cohort, the age–earnings profile implied by the 1990 and 2000 cohorts appears to be very flat. 8-14. KAPC, a pharmaceutical company located in rural Kansas, is finding it difficult to retain its employees who frequently leave after just 6 months for jobs at pharmaceutical companies paying higher wages in Chicago. To address its problem with labor turnover, human resource officers at KAPC decide to run an experiment. Of their next 100 newly hired employees, 25 will randomly be selected to receive a housing voucher worth up to $4,000 per year to offset property taxes. To take advantage of this program, the employee must not only be randomly selected into the program but they must also purchase a home. Of the 25 employees selected into the housing voucher program, seven leave KAPC within 12 months of starting. Of the 75 employees not selected into the program, 37 leave KAPC within 12 months of starting. (a) Provide an estimate of the effect of the housing voucher program on retention at KAPC. The problem doesn’t give quite enough information to perform a pure difference-in-differences estimation, but we can make one simple assumption and then generate the results. The assumption is that 49.3% (37 out of 75) of all new employees leave KAPC within 1 year of being hired if they are not given a housing subsidy, and this rate applies pre- and post-subsidy. The data are now: Group
Leave in 1 Year Leave in 1 Year Preexperiment Postexperiment Difference Control group 0.493 0.493 0.00 Rec. subsidy 0.493 0.280 −0.213
Diff.-in-Diff. −0.213
Notice that although the table above makes the estimate look like a difference-in-differences estimate, it really is just a difference estimate. That said, the policy seems to have a striking effect, reducing the probability someone leaves KAPC in the first year by 21.3 percentage points. (b) Suppose KAPC spends $10,000 in hiring costs each time a position is vacated. Would you endorse expanding the housing voucher program to all new employees? Justify your decision. Consider 100 hires. Without the housing subsidy, KAPC expects to pay $10,000 on each hire and, after 1 year, to have 51(50.7%) of these workers remain. Thus, it costs $1 million to hire 51 workers (100 $10,000 $1 million ) . With the housing subsidy, as 72% of those hired remain, KAPC needs to hire 51 0.72 71 workers in order to have 51 remain employed after 1 year. Thus, KAPC spends $710,000 on 79 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
hiring costs. However, it also gives each worker a subsidy of $4,000, which totals $284,000. The total cost, therefore, is $994,000. By the slimmest of margins, therefore, the policy is economically justifiable. If the housing voucher is renewable, however, then the policy is not efficient as KAPC would end up paying the remaining 51 workers each an additional $4,000 every year. Lastly, the problem never specifies what percentage of people who are offered the voucher actually use it (i.e., actually buy a house). Thus, $784,000 is the highest possible cost to the program. 8-15. Consider a more general version of the Roy model of migrant self-selection presented in the chapter. (a) Would it be possible for a source country to experience an outflow of low-skill workers and an outflow of high-skill workers at the same time? (For simplicity, ignore the possibility that migration is costly). A source country can experience an outflow of low-skill and high-skill workers at the same time if the returns to skills in the two countries is not linear as the model in the text assumes. The returns to skills in the source country might be relatively lower for low-skill workers and might also be relatively lower for high-skill workers. (b) Provide a graph of the wage–skill curves in the destination and source countries that would suggest both outflows occur simultaneously.
(c) How do the economic conditions and tax policies in the United States encourage both types of flows? The policies of the United States may encourage both types of flows in that the social safety net, working conditions, and so on are better for low-income, low-skill workers in the United States than in the sending country. At the same time, the highest tax rate in the United States might be lower than the highest tax rate in the source country. CHAPTER 9 80 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
9-1. Suspecting that local firms follow discriminatory hiring practices, a nonprofit firm conducts the following experiment. It has 200 white individuals and 200 Black individuals, all of whom are similar in age, experience, and education, apply for local retail jobs. Each individual applies to two jobs, one in a predominantly Black part of town and one in a predominantly white part of town. Of the white applicants, 120 are offered jobs in the white part of town while only 80 are offered jobs in the Black part of town. Meanwhile, 90 of the Black applicants are offered jobs in the Black part of town while only 50 are offered jobs in the white part of town. Using a difference-in-differences estimator, do you find evidence of discriminatory hiring practices? If there is evidence of discrimination, is it appropriate to conclude that all employers in the white part of town are discriminatory? The data can be used to create the following table.
Type Worker Black White
Chance of Receiving a Job Offer in the of Black Part of Town
90 ÷ 200 = 0.45 80 ÷ 200 = 0.40
White Part of Diff. Town −0.20 50 ÷ 200 = 0.25 0.20 120 ÷ 200 = 0.60
Diff.-in-Diff.
0.40
There does appear to be discrimination as whites are 40% more likely to be offered jobs in the white part of town after controlling for differences elsewhere. Despite potential evidence of discrimination, it is inappropriate to conclude that all employers in the white part of town are discriminatory. Some may be, but others might not be. Even in the white part of town, 25% of Black job candidates received an offer. These offers are likely not coming from discriminatory employers. 9-2. Suppose Black and white workers are complements in that the marginal product of whites increases when more Black workers are hired. Suppose also that white workers do not like working alongside Black workers. Under what conditions will this type of employee discrimination lead to a segregated workforce? Under what conditions will it not? As Blacks and whites are complements in the production process, there is an incentive for employers to employ Blacks and whites together in the workplace. The question is whether the increase in productivity achieved by integrating the workforce is higher than the extra wages employers must pay white workers to compensate them for working alongside Blacks. Thus, as long as the differential needed to encourage white workers to work with Black workers is not too large, the workplace will not be completely segregated. It is only if the differential needed to encourage white workers to work with Black workers is larger than the productivity gain of having them work side-by-side that workplaces will be segregated. 9-3. Suppose a restaurant hires only women to wait on tables, and only men to cook the food and clean the dishes. Is this most likely to be indicative of employer, employee, consumer, or statistical discrimination? 81 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
If this hiring pattern is due to discrimination at all, it is most likely due to customer discrimination. It is not employer discrimination as the employer is hiring both men and women. It is further unlikely to be statistical discrimination as an employer would likely be able to determine in a short time what would happen if women became cooks or men waited on tables. The hiring pattern could result from employee discrimination as well, but this seems unlikely as wait staff and chefs/dishwashers interact on the job. 9-4. A firm’s production function is given by Q 40ln( EW E B 1) , where EW and E B are the number of whites and Blacks employed by the firm, respectively. From this, it can be shown that the marginal product of labor is MPE
40 . EW E B 1
Suppose the market wage for Blacks is $50, the market wage for whites is $100, and the price of each unit of output is $20. (a) How many workers of each race would a nondiscriminating firm hire? How much profit is earned if there are no other costs? A nondiscriminating firm will hire all Black workers as labor enters the marginal product function as a sum and the Black wage is less than the White wage. Therefore, the firm solves:
V MPE wB P MPE wB
$20
40 $50 EB 1
E B 1 16
E B 15. Given that the firm hires 15 Black workers and 0 white workers, output is Q 40 ln (16) 111 . Therefore, profit is
$20 110 15 $50 $1, 450. (b) How many workers of each race would a firm with a discrimination coefficient of 0.6 against Blacks hire? How much profit is earned if there are no other costs? A discriminating firm with a discrimination coefficient of 0.6 will compare the white wage of $100 to the adjusted Black wage of 1.6 $50 $80. As the adjusted Black wage is still less than the white wage, this firm will also hire all Black workers, but it will use the adjusted wage in the calculation. Therefore, the firm solves: 82 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
V MPE 1 d wB
P MPE 1 d wB
$20
40 $80 EB 1
E B 1 10 E B 9. Given that the firm hires nine Black workers and zero white workers, output is Q 40 ln (9) 88 . Therefore, profit is
$20 88 9 $50 $1,310. (c) How many workers of each race would a firm with a discrimination coefficient of 1.2 hire? How much profit is earned if there are no other costs? A discriminating firm with a discrimination coefficient of 1.2 will compare the white wage of $100 to the adjusted Black wage of 2.2 $50 $110 . As the adjusted Black wage is more than the white wage, this firm will hire all white workers. Therefore, the firm solves:
VMPE wW P MPE wW 40 $20 $100 EW 1 EW 1 8
EW 7. Given that the firm hires zero Black workers and seven White workers, output is Q 40 ln (7) 78 . Therefore, profit is
$20 78 7 $100 $860.
9-5. Suppose years of schooling, s, is the only variable that affects earnings. The equations for the weekly salaries of male and female workers are given by:
wm 500 100s and w f 300 75s. 83 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
On average, men have 14 years of schooling and women have 12 years of schooling. (a) What is the male–female wage differential in the labor market? The wage differential can be written as:
$700.
w wm w f 500 100sm 300 75sf 500 100 14 300 75 12
(b) Using the Oaxaca–Blinder decomposition, calculate how much of this wage differential could be due to discrimination? The raw wage differential is
w (m f ) ( m f )s f Different ial Due t o Discriminat ion
m (sm s f ) Different ial Due t o Difference in Skills
(500 300) (100 75)12
100(14 12)
$500 $200 $700.
Differential Due to Discrimination
Differential Due to Difference in Skills
The wage differential that could be due to discrimination equals $500 or five sevenths of the raw differential. 9-6. Suppose the firm’s production function is given by
q 10 Ew Eb , where Ew and Eb are the number of whites and Blacks employed by the firm, respectively. It can be shown that the marginal product of labor is then
MPE
5 E w Eb
.
Suppose the market wage for Black workers is $10, the market wage for whites is $20, and the price of each unit of output is $100. (a) How many workers would a firm hire if it does not discriminate? How much profit does this nondiscriminatory firm earn if there are no other costs? There are no complementarities between the types of labor as the quantity of labor enters the production function as a sum, Ew Eb . Further, the market-determined wage of Black labor is less than the market-determined wage of white labor. Thus, a profit-maximizing firm will not hire any white workers and will hire Black workers up to the point where the Black wage equals the value of their marginal product: 84 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
10 wb is set equal t oV MPB p MPE
100(5) Eb
which solves as 10
100(5) Eb
Eb
100(5) 10
E b 50 E b 2, 500.
The 2,500 Black workers produce q 10(sqrt (2,500)) 500 units of output, and profits are:
pq wb Eb 100(500) 10(2,500) $25, 000. (b) Consider a firm that discriminates against Blacks with a discrimination coefficient of 0.25. How many workers does this firm hire? How much profit does it earn? The firm acts as if the Black wage is wb (1 d ) , where d is the discrimination coefficient. The employer’s hiring decision, therefore, is based on a comparison of ww and wb (1 d ) . The employer will then hire whichever input has a lower utility-adjusted price. As d = 0.25, the employer is comparing a white wage of $20 to a Black (adjusted) wage of $12.50. As $12.50 < $20, the firm will hire only Blacks. As before, the firm hires Black workers up to the point where the utility-adjusted price of a Black worker equals the value of marginal product, or 12.50
100(5) Eb
so that Eb 1, 600 workers. The 1,600 workers produce 400 units of output, and profits are
100(400) 10(1,600) $24,000. (c) Finally, consider a firm that has a discrimination coefficient equal to 1.25. How many workers does this firm hire? How much profit does it earn? As d = 1.25, the employer compares a white wage of $20 against an adjusted Black wage of $22.50. Thus, the firm hires only whites. The firm hires white workers up to the point where the price of a white worker equals the value of marginal product: 85 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
20
100(5) Ew
so the firm hires 625 whites, produces 250 units of output, and earns profits of
100(250) 20(625) $12, 500. 9-7. Cindy, a tenured, full professor of French literature at a large university, is paid $60,000. The university reports median salaries by gender and rank as a new initiative on faculty compensation. From reading the report, Cindy learns that she is paid $20,000 below the median for male, tenured, full professors. She is also paid $12,000 below the median for female, tenured, full professors. What factors might explain Cindy’s position in the wage distribution? Why might or might not the university be engaged in gender discrimination? Many factors explain the distribution of wages. Gender discrimination could exist at the university. But additionally, her lower pay may be a result of her having been at the university for fewer years, her field of French literature is likely paid less than full professors in finance, and she may have received fewer grants for her research compared to her colleagues in Biology. Even looking at the gender difference ($20,000 less than the median male vs. $12,000 less than the median female) may not be due to gender discrimination. The overall distribution of female salaries at a university would be expected to be lower than the overall distribution of male salaries if females are less likely to go into the hard sciences (which are known to pay more). 9-8. Consider the following log-wage regression results for women (W) and men (M), where wages are predicted by schooling (S) and age (A).
wW 2.19 0.075 SW 0.023 AW and wM =2.42 0.072 S M 0.017 AM . Sample means for the variables by gender are: women average a log wage of 3.83, 13.5 years of schooling, and 41.2 years old; men average a log wage of 3.92, 13.2 years of schooling, and 44.3 years old. Decompose the raw difference in average log wages using the Oaxaca–Blinder decomposition. Specifically, decompose the raw difference into the portion due to differences in schooling, differences in age, and the portion left unexplained, possibly due to gender discrimination. The raw logged wage gap is 3.92 − 3.83 = 0.09. For the two variables in the regression we have:
M 0.072 and the difference in average schooling of 13.2 − 13.5 = −0.3, so that School: the decomposition due to schooling is 0.3 0.072 0.0216 . Age:
M 0.017 and the difference in average ages of 44.3 − 41.2 = 3.1, so that the decomposition due to age is 3.1 0.017 0.0527 . 86
© McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Thus, schooling and age explain −0.0216 + 0.0527 = 0.0311 of the wage gap. This leaves 0.09 − 0.0311 = 0.0589 of the wage gap left unexplained, possibly due to gender discrimination. 9-9. Each employer faces competitive weekly wages of $2,000 for whites and $1,400 for Blacks. Suppose employers undervalue the efforts/skills of Blacks in the production process. In particular, every firm is associated with a discrimination coefficient, d, where 0 d 1 . In particular, although a firm’s actual production function is Q 10( EW EB ) , the firm manager acts as if its production function is Q 10 EW 10(1 d ) E B . Every firm sells its output at a constant price of $240 per unit up to a weekly total of 150 units of output. No firm can sell more than 150 units of output without reducing its price to $0. (a) What is the value of the marginal product of each white worker? The value of marginal product of each white worker is $2,400, because each white worker produces 10 units of output, and each unit of output (up to 150 units) can be sold for $240. (b) What is the value of the marginal product of each Black worker? The value of marginal product of each Black worker is $2,400, because each Black worker produces 10 units of output, and each unit of output (up to 150 units) can be sold for $240. Notice that discriminatory beliefs on the part of the firm owner do not affect a Black worker’s true marginal product. (c) Describe the employment decision made by firms for which d = 0.2 and d = 0.8, respectively. The firm owner views each Black worker as contributing 10(1 d ) units of production, and therefore views each Black worker’s value of marginal product to be $2, 400(1 d ) . When d = 0.8, therefore, the firm views each Black worker’s value of marginal product to be $480, and when d = 0.2 the firm views each Black worker’s value of marginal product to be $1,920. When d = 0.2. Each white worker costs $2,000 and produces $2,400 of revenue for a net gain of $400. Each Black worker costs $1,400 and is believed to produce $1,920 of revenue for a perceived net gain of $520. In this case, the firm employs 15 Black workers (to exactly produce 150 units of output) and receives profit of 15 ($1,920 $1, 400) $7,800 . When d = 0.8. Each white worker costs $2,000 and produces $2,400 of revenue for a net gain of $400. Each Black worker costs $1,400 and is believed to produce $480 of revenue for a perceived net loss of $920. In this case, the firm employs 15 white workers (to exactly produce 150 units of output) and receives profit of 15 ($2, 400 $2, 000) $6, 000 . (d) For what value(s) of d is(are) a firm willing to hire Blacks and whites? 87 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Each white worker produces $400 of profit for the firm. Each Black worker, while costing $1,400 is perceived to produce $2, 400(1 d ) of revenue. Thus, each Black worker is perceived as producing $2, 400(1 d ) $1, 400 $1, 000 $2, 400d of profit. The firm is willing to hire Black and white workers, therefore, if
1, 000 2, 400d 400 600 2, 400d 0.25 = d. Thus, the firm hires both types if d = 0.25. If d > 0.25, the firm hires only whites. If d < 0.25, the firm hires only Blacks. 9-10. After controlling for age and education, it is found that the average woman earns $0.80 for every $1.00 earned by the average man. After controlling for occupation to control for compensating differentials (perhaps men accept riskier or more stressful jobs than women, and therefore are paid more), the average woman earns $0.92 for every $1.00 earned by the average man. The conclusion is made that occupational choice reduces the wage gap 12 cents and discrimination is left to explain the remaining 8 cents. (a) Explain why discrimination may explain more than 8 cents of the 20 cent differential (and occupational choice may explain less than 12 cents of the differential). Discrimination may occur during the process of choosing an occupation (i.e., occupational crowding). As students, for example, girls may be encouraged to take a different set of courses than boys. Later, discrimination may preclude women from being hired into the higher paying occupations. Put differently, accepting the statistics at face value requires there to be wage discrimination but no employment discrimination and no discrimination in the schooling process. (b) Explain why discrimination may explain less than 8 cents of the 20 cent differential. The labor supply curve of women and men could be different, because they have different preferences when it comes to leisure and consumption. Thus, wage differences might come about to account for gender-based preferences and not discrimination. Put differently, other factors chosen by the employee, such as hours worked or work experience, have yet to be controlled for and could explain at least some of the remaining 8 cent differential. 9-11. In 1960, the proportion of Blacks in the population of Southern states was higher than the proportion of Blacks in the population of Northern states. It is also true that the Black–white wage ratio in Southern states was much lower than in Northern states. Does the difference in the relative Black wage between the two regions indicate that Southern employers discriminated more than Northern employers? Employer discrimination generates a wage gap between equally skilled Black and white workers. The equilibrium wage differential is determined by the (relative) demand for and the supply of Black workers. Suppose that employers in the South are not very discriminatory. If there are 88 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
many Black workers in this market, however, the Black/white wage ratio will be very low (since the marginal Black employed must ―compensate‖ the firm when they are hired). The fact that Blacks earn relatively less in the South, therefore, need not indicate that Southern employers discriminate more than Northern employers, but may simply indicate the relatively large number of Black workers in the South. 9-12. Suppose 100 men and 100 women graduate from high school. After high school, each can work in a low-skill job and earn $200,000 over their lifetime, or each can pay $50,000 and go to college. College graduates are given a test. If someone passes the test, they are hired for a high-skill job paying lifetime earnings of $300,000. Any college graduate who fails the test, however, is relegated to a low-skill job. Academic performance in high school gives each person some idea of how they will do on the test if they go to college. In particular, each person’s GPA, call it x, is an ―ability score‖ ranging from 0.01 to 1.00. With probability x, the person will pass the test if they attend college. Upon graduating high school, there is one man with x = 0.01, one with x = 0.02, and so on up to x = 1.00. Likewise, there is one woman with x = 0.01, one with x = 0.02, and so on up to x = 1.00. (a) Persons attend college only if the expected lifetime payoff from attending college is higher than that of not attending college. Which men and which women will attend college? What is the expected pass rate of men who take the test? What is the expected pass rate of women who take the test? Both groups are identical, so the answers are identical. The expected value requirement for attending college is: $300, 000 x $200, 000 (1 x) $50, 000 $200, 000
$100,000x > $50,000 x > 0.50. Thus, the 50 men and 50 women with x = 0.51 to x = 1.00 all go to college and take the test. The number of test takers expected to pass is then the sum of expected pass rates: 0.51 0.52 1.00 37.75 . Thus, 75.5% (37.75 of the 50) of men and 75.5% of the women who take the test are expected to pass the test. (b) Suppose policy makers feel not enough women are attending college, so they take actions that reduce the cost of college for women to $10,000. Which women will now attend college? What is the expected pass rate of women who take the test? The expected value requirement for attending college for women has changed to: $300, 000 x $200, 000(1 x) $10, 000 $200, 000 $100,000x > $10,000 x > 0.10.
Thus, the 90 women with x = 0.11 to x = 1.00 attend college and take the test. The number of female test takers expected to pass is the sum of expected pass rates: 89 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
0.11 0.12 1.00 49.95 . Thus, 55.5% (49.95 of the 90) of the women who take the test are expected to pass the test. 9-13. Suppose the discrimination coefficient increases as the firm employs more Black workers. In particular, the discrimination coefficient is d 0.01EB , where E B is the number of Blacks hired by the firm so that each employer facing competitive wages of wW for whites and wB for Blacks acts as if they face competitive wages of wW for whites and
wB (1 d ) for Blacks. Assume further that the firm must employ 200 workers. Define the wage ratio to be wW / wB . Solve for the number of Blacks hired as a function of the wage ratio. Graph the number of Blacks hired (x-axis) against the wage ratio (y-axis). The firm hires whichever worker is perceived to be cheaper on the margin. Put differently, the firm adjusts (if it can) its hiring decisions so that the cost of the marginal white worker equals the cost of the marginal Black person. Therefore, on the margin, we will have (if not at a corner solution):
wW (1 d ) wB (1 0.01EB )wB wW / wB 1 0.01EB EB 100( wW / wB ) 100 Notice that if the Black wage exceeds the white wage that EB , according to the above, is negative. Similarly, EB exceeds 200 if the wage ratio exceeds 3. Thus, the demand equation for Black workers, EB 100(wW / wB ) 100 , is correct unless the firm wants to hire no Black workers (if the Black wage exceeds the white wage) or if the demand equation would imply hiring more than 200 Black workers. Thus, the most precise demand function for Black workers is:
w E B* min max 0,100 W 100 , 200 . wB Labor demand for Blacks, which is increasing in the wage ratio as the Black wage is in the denominator, is graphed below.
90 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
9-14. Consider a data set with the following descriptive statistics. Table 1. Descriptive Statistics.
Ln(wages) Black Age Work experience Schooling % female occupation
Men Mean 3.562 0.231 42.2 18.1 13.9 18.2
Min 1.389 0 19 0 9 2.3
Max 5.013 1 68 42 21 95.4
Women Mean 3.198 0.191 39.2 16.1 14.1 62.3
Min 1.213 0 19 0 9 6.7
Max 4.875 1 63 35 21 98.5
Wage is the worker’s hourly wage; Black takes on a value of 1 if the worker is Black and a value of 0 otherwise; work experience is actual years of work experience, schooling is measured in years; and % female occupation is the percentage of all employees in the worker’s occupation who are female. The following table reports the regression results from a log-wage regression. Table 2. Regression Results. Men Constant 2.314 Black −0.198 Age 0.054 Years of work experience 0.042 Years of schooling 0.085 Percentage of female in −0.0012 occupation
Women 2.556 −0.154 0.037 0.059 0.083 0.0024
Decompose the raw difference in average wages using the Oaxaca–Blinder decomposition. Specifically, decompose the raw difference into the portion due to differences in personal 91 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
characteristics (schooling, race, age, and experience), the portion due to occupation, and the portion left unexplained possibly due to gender discrimination. The raw wage gap is w w w 3.562 3.198 0.364. M
F
Next, for the five variables in the regression, we have: Race: M 0.198 and x x 0.231 0.191 0.04 0.198(0.04) 0.008. Age: M 0.054 and x x 42.2 39.2 3.0 3(0.054) 0.162. Work Exp.: M 0.042 and x M x F 18.1 16.1 2.0 2(0.042) 0.084. M
F
M
School: Occupation:
F
M 0.085 and x x 13.9 14.1 0.20 0.2(0.085) 0.017. M 0.121and x M x F 18.2 62.3 44.1 0.0012(44.1) 0.053. M
F
Thus, personal characteristics (race, age, work experience, and schooling) explain −0.008 + 0.162 + 0.084 − 0.017 = 0.221 of the 0.364 wage gap. Occupation explains 0.053 of the 0.364 wage gap. This leaves 0.364 − 0.053 − 0.221 = 0.09 of the wage gap left unexplained, possibly due to gender discrimination. 9-15. In 2006, Evo Morales assumed the presidency in Bolivia, a South American country in which official commerce is done in Spanish. Morales was the first Bolivian president of indigenous decent. As president, he quickly instituted reforms that were designed to reduce discrimination against indigenous populations with the aim of eventually reducing inequality. Suppose discrimination before Morales took two forms: discrimination in education by not providing state funds to educate all children (and particularly not educating indigenous children in Spanish) and discrimination in the job market by firms not willing to hire indigenous workers. (a) In terms of education, which policy would be better at combating discrimination and inequality: (1) providing state funds to educate all people in their native languages or (2) providing state funds for a public education system that requires all people to learn Spanish and a second, indigenous language? Why? The second policy is better to fight the inequality resulting from discrimination in education. Of course, spending money on educating indigenous populations is important (Policy 1), but as commerce takes place in Spanish, it is also important to educate indigenous populations in a way that allows them to fully participate in society. This requires educating everyone in Spanish. As a side note, Morales’s policy (#2 above) goes one step further in trying to end cultural discrimination by requiring everyone to learn Spanish and at least one indigenous language. The hope is that this will further erode cultural differences (or at least cultural biases) across subpopulations in Bolivia. (b) In terms of the job market, which policy would be best at combating discrimination and inequality: (1) increasing the minimum wage, (2) requiring all firms with at least 50 workers to hire some indigenous workers, or (3) improving the legal system to protect economic rights and activities? Why? 92 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
In a competitive or free or capitalistic economy, it is likely most beneficial to do #3. Raising the minimum wage doesn’t help indigenous workers if they cannot find jobs or cannot land wellpaying jobs. And though #2 is in the right direction, what is defined as ―indigenous‖ is a bit unclear, and so such a regulation likely has no real effect on firms. However, if #3 comes about, then indigenous workers know there will be economic rewards for working hard and becoming educated. Providing such incentives would likely eventually lead to less inequality. CHAPTER 10 10-1. Suppose the firm’s labor demand curve is given by: w 20 0.01E ,
where w is the hourly wage and E is the level of employment. Suppose also that the union’s utility function is given by
U w× E . It is easy to show that the marginal utility of the wage for the union is E and the marginal utility of employment is w. What wage would a monopoly union demand? How many workers will be employed under the union contract? Utility maximization requires the absolute value of the slope of the indifference curve equal the absolute value of the slope of the labor demand curve. In this case, the absolute value of the slope of the indifference curve is
MU E MU w
w . E
The absolute value of the slope of the labor demand function is 0.01. Thus, utility maximization requires that
w 0.01 . E Substituting for w with the labor demand function, the employment level that maximizes utility solves
20 0.01E 0.01 E 20 0.01E 0.01E 20 0.02E E 1, 000 workers.
The highest wage at which the firm is willing to hire 1,000 workers is 20 0.01(1, 000) $10 . Thus, the monopoly union requires the firm to employ 1,000 workers, each at $10 per hour. 93 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
10-2. Suppose the union in Problem 1 has a different utility function. In particular, its utility function is given by: U ( w w*) × E
where w * is the competitive wage. The marginal utility of a wage increase is still E, but the marginal utility of employment is now w w * . Suppose the competitive wage is $8 per hour. What wage would a monopoly union demand? How many workers will be employed under the union contract? Contrast your answers to those in Problem 1. Can you explain why they are different? Again equate the absolute value of the slope of the indifference curve to the absolute value of the slope of the labor demand curve: MU E MU w
w w* 0.01 . E
Setting w* $8 and using the labor demand equation yields:
20 0.01E 8 0.01 E 12 0.01E 0.01E 12 0.02E E 600 workers. The highest wage at which the firm is willing to hire 600 workers is 20 0.01(600) $14 . Thus, the monopoly union requires the firm to employ 600 workers, each at $14 per hour. In Problem 1, the union maximized the total wage bill. In Problem 2, the utility function depends on the difference between the union wage and the competitive wage. That is, the union maximizes its rent. Since the alternative employment option pays $8, the union is willing to suffer a cut in employment in order to obtain a greater rent of $6 per hour ($8 up to $14). 10-3. Suppose that the union’s utility function is given by U U ( w ) , so that the union only cares about the wage the workers get and not about the level of employment. Derive the contract curve in this case and discuss the implications of this contract curve.
94 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
The utility function U U (w) implies that the union’s indifference curves are horizontal lines, so that the contract curve which results coincides exactly with the firm’s labor demand curve (D).
95 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
10-4. Consider a two-sector economy with homogeneous labor and jobs in both sectors. Two million workers supply their labor perfectly inelastically. Labor demand in both sectors can be written as: E1 1, 800, 000 100, 000w1 and E2 1, 800, 000 100, 000w2 .
(a) If both sectors are competitive, what is the market-clearly wage and how many workers are employed in both sectors? As labor demand is identical in both sectors and labor is homogeneous, 1 million workers will work in both sectors. Using this for E in the labor demand equations, we find that 1, 000, 000 1,800, 000 100, 000w 100, 000w 800, 000 w* $8 per hour.
(b) Suppose a labor union forms in Sector 1. The union negotiates a wage of $12 per hour, and firms choose how much labor to employ. Anyone not employed in Sector 1 is relegated to Sector 2. How many workers will be employed in Sector 1 (unionized)? How many workers will be employed in Sector 2, and what wage will they receive? At a wage of $12 per hour, the unionized sector (Sector 1) will employ:
E 1 1, 800, 000 100, 000w1 E 1 1, 800, 000 100, 000 12 E 1 1, 800, 000 1, 200, 000 E 1* = 600, 000 workers. This forces 2 million − 0.6 million = 1.4 million workers into the nonunionized sector (Sector 2). With this many workers relegated to Sector 2, wages are: 1, 400, 000 1,800, 000 100, 000w 100, 000w 400, 000 w* $4 per hour.
Therefore, 600,000 workers are employed at $12 per hour in the unionized sector while 1,400,000 workers are employed at $4 per hour in the nonunionized sector. (c) What is the union-wage gap in Part (b)? What would the union-wage gap be if one controlled for the spillover effect?
96 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Using the answers to Part (b), the union-wage gap is ($12 $4) / $4 = 200% (or it could be expressed as $8 = $12 $4 per hour as well). The spillover effect refers to the infusion of workers into Sector 2 because the union formed and the unionized firms restricted labor. If we compare the union wage of $12 to the competitive wage of $8 per hour that would have come about without a union (Part a), the union-wage gap is ($12 $8) / $8 = 50% (or it could be expressed as $4 = $12 $8 per hour as well). 10-5. Consider a firm that faces a constant per unit price of $1,200 for its output. The firm hires workers, E, from a union at a daily wage of w, to produce output, q, where q 2E ½ .
Given the production function, the marginal product of labor is 1 / E ½ . There are 225 workers in the union. Any union worker who does not work for the firm can find a nonunion job paying $96 per day. (a) What is the firm’s labor demand function? The problem stipulates that the price of output is constant at $1,200. This means that the firm also faces constant marginal revenue at $1,200. That is, p MR $1, 200 . The labor demand function, or the value of marginal product of labor, is VMPE MR MPE 1, 200 / E½ .
(b) If the firm is allowed to specify w and the union is then allowed to provide as many workers as it wants (up to 225) at the daily wage of w, what wage will the firm set? How many workers will the union provide? How much output will be produced? How much profit will the firm earn? What is the total income of the 225 union workers? If the firm offers w < $96, no workers will be provided. This would leave the firm with no output and no profit. The workers would all receive $96 per day, making their total daily income $21,600. If the firm offers a wage of w > $96, all 225 workers will be provided. These 225 workers would produce q 2 sqrt ( E ) 2 sqrt (225) 30 units of output. The firm would then earn a profit of 30($1, 200) 225w . Profit, therefore, is maximized when w is minimized subject to the constraint. If the union would supply all 225 workers at a wage of $96, for example, the firm would offer w = $96 and earn a daily profit of $14,400. The total daily income of the 225 workers would remain at $21,600. (If the firm needs to offer strictly more than $96 per day to attract workers, it would offer a daily wage of $96.01. All 225 workers would work for the firm, making 30 units of output. The firm’s daily profit would be $14,397.75. And the total daily income of the 225 workers would be $21,602.25.)
97 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
10-6. Consider the same setup as in Problem 10-5, but now the union is allowed to specify any wage, w, and the firm is then allowed to hire as many workers as it wants (up to 225) at the daily wage of w. What wage will the union set in order to maximize the total income of all 225 workers? How many workers will the firm hire? How much output will be produced? How much profit will the firm earn? What is the total income of the 225 union workers? To solve this with Excel, the spreadsheet looks like the following, where the union specifies the wage, labor demand comes from Part (a), and everything else follows naturally:
Labor Wage Demand $96 156.25 $97 153.04 $98 149.94 $99 146.92 $100 144.00 … … $190 39.89 $191 39.47 $192 39.06 $193 38.66 $194 38.26 $195 37.87
Labor Costs $15,000.00 $14,845.36 $14,693.88 $14,545.45 $14,400.00 … $7,578.95 $7,539.27 $7,500.00 $7,461.14 $7,422.68 $7,384.62
Output 25.00 24.74 24.49 24.24 24.00 … 12.63 12.57 12.50 12.44 12.37 12.31
Price $1,200 $1,200 $1,200 $1,200 $1,200 … $1,200 $1,200 $1,200 $1,200 $1,200 $1,200
Revenue $30,000.00 $29,690.72 $29,387.76 $29,090.91 $28,800.00 … $15,157.89 $15,078.53 $15,000.00 $14,922.28 $14,845.36 $14,769.23
Profit $15,000.00 $14,845.36 $14,693.88 $14,545.45 $14,400.00 … $7,578.95 $7,539.27 $7,500.00 $7,461.14 $7,422.68 $7,384.62
Union Daily Income $21,600.00 $21,753.04 $21,899.88 $22,040.77 $22,176.00 … $25,349.58 $25,349.90 $25,350.00 $25,349.90 $25,349.60 $25,349.11
Thus, the union sets a daily wage of $192. The firm responds by hiring 39.06 workers, who produce 12.5 units of output. The firm earns a daily profit of $7,500, while the 225 workers, 39.06 of whom are in the union and 185.94 of whom are not in the union, earn a total of $25,350 each day. The calculus solution is: Given any wage, the firm will employ 1, 200 / w workers. This is derived by setting the value of marginal product equal to the wage and solving for employment: 2
w
1, 200
E 1, 200 E w 2
1, 200 E . w
98 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
As the union’s objective is to maximize total income, it chooses w to maximize the income of the workers employed by the union plus the income of the workers not employed by the union. Therefore, we have: 2 2 1, 200 1, 200 1, 440, 000 138, 240, 000 Ma x w 21, 600 . 96 225 w w w2 w
The first-order condition, therefore, is
1,440,000 w
2
276,480,000 w3
0 , which solves as w = $192.
10-7. Suppose the union’s resistance curve is summarized by the following data. The union’s initial wage demand is $10 per hour. If a strike occurs, the wage demands change as follows: Length of Strike 1 month 2 months 3 months 4 months 5 or more months
Hourly Wage Demanded 9 8 7 6 5
Consider the following changes to the union resistance curve and state whether the proposed change makes a strike more likely to occur, and whether, if a strike occurs, it is a longer strike. (a) The drop in the wage demand from $10 to $5 per hour occurs within the span of 2 months, as opposed to 5 months. If the union is willing to drop its demands very fast, the firm will find it profitable to delay agreement until the wage demand drops to $5. A strike, therefore, is more likely to occur. If $5 is the lowest wage the union is willing to accept, the strike is much more likely to last 2 months now than the probability it would have lasted 5 months under the original resistance curve. (b) The union is willing to moderate its wage demands further after the strike has lasted for 6 months. In particular, the wage demand keeps dropping to $4 in the sixth month, $3 in the seventh month, and so on. If the union is willing to accept even lower wages in the future, some firms will find it optimal to wait the union out. Thus, strikes will be more likely and last longer. (c) The union’s initial wage demand is $20 per hour, which then drops to $9 after the strike lasts 1 month, $8 after 2 months, and so on.
99 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Conditioning on a strike occurring, the length of strike will be unchanged as the resistance curve after the initial demand stays the same. The probability of a strike ever occurring increases, however, when the initial demand increases but everything else remains the same. 10-8. At the competitive wage of $20 per hour, Firms A and B both hire 5,000 workers (each working 2,000 hr per year). The elasticity of demand is −2.5 and −0.75 at Firms A and B, respectively. Workers at both firms then unionize and negotiate a 12% wage increase. (a) What is the employment effect at Firm A? How has total worker income changed? At Firm A, A %E A %wA 2.5 . When wages increase 12%, therefore, employment falls by 30%. The firm will start to employ 70% of 5, 000 2, 000 7 million work-hours per year, possibly by hiring 3,500 workers for 2,000 hr each. Total income was 10 million work-hours times the wage of $20 per hour for a total of $200 million. Total income will now be 7 million work-hours times the new wage of $22.40 (a 12% increase above $20), for a total income of $156.8 million plus any income earned by the workers who no longer work at Firm A because of the reduction in labor used. (b) What is the employment effect at Firm B? How has total worker income changed? At Firm B, B %EB %wB 0.75 . When wages increase 12%, therefore, employment falls by 9%. The firm will start to employ 91% of 5, 000 2, 000 9.1million work-hours per year, possibly by hiring 4,550 workers for 2,000 hr each. Total income was 10 million workhours times the wage of $20 per hour, for a total of $200 million. Total income will now be 9.1 million work-hours times the new wage of $22.40 (a 12% increase above $20), for a total income of $203.84 million plus any income earned by the workers who no longer work at Firm B because of the reduction in labor used. (c) How much would the workers at each firm be willing to pay in annual union dues to achieve the 12% gain in wages? To answer this question, assume that reductions in employment come from reducing the number of workers hired and not by reducing the number of hours worked by each worker. So, for Firm A, assume the number of workers falls to 3,500 but hours remain at 2,000. Similarly, for Firm B, assume the number of workers falls to 4,550 but hours remain at 2,000. In this case, income has increased from 2, 000 $20 $40, 000 per year per worker to 2, 000 $22.40 $44,800 per year for each worker continuing to have a job. So, workers at either firm, as long as they retain their job, are willing to pay up to $4,800 annually in union dues. 10-9. Suppose several states recently passed laws restricting bargaining rights for public employees. Most notably the changes tended to restrict the union’s right to negotiate over fringe benefits such as health care and retirement benefits. What problems were these legislative changes trying to address? Even assuming such a law survives a constitutional 100 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
challenge, why might restricting bargaining rights not fully address the problems lawmakers were aiming to solve? Following the Great Recession, many private employee labor contracts and conditions were changed. Fewer fringe benefits were being paid—employees were asked to pay more of their health insurance costs, and contributions to and benefits paid from retirement plans fell (especially to and from defined benefit plans). Salary increases were marginal from 2007 to 2010. And so on. It’s harder to have such shifts in the public sector in part because public organizations are not arranged nor operate the same way as private firms. Public sector unions had also negotiated terrific health care and retirement benefits in the decades leading up to the Great Recession. The defined benefit retirement plans for public sector workers in many states became vastly insolvent as benefits steadily increased at the same time state budgets became strapped due to lower state tax revenues. Thus, the states that passed these laws did so because, in their mind, the compensation package previously offered to public sector unions was out of line with the private sector marketplace, and so out of line that the current state of things threatened state solvency. There are at least two reasons to think that these laws may not be as successful in lowering the state burden in terms of public sector employees as advertised. First, the unions are still allowed to bargain over salaries. As money (and compensation) is fungible, the union may demand that cost-savings on health care or retirement be offset with higher direct salaries. Second, the unions still have the right to strike and have significant political power. Thus, even though their bargaining rights may be hypothetically restricted, it remains unclear if the state would actually take hard stands during negotiations. 10-10. Suppose the economy consists of a union and a nonunion sector. The labor demand curve in each sector is given by L 1, 000, 000 20w . The total (economy-wide) supply of labor is 1,000,000, and it does not depend upon the wage. All workers are equally skilled and equally suited for work in either sector. A monopoly union sets the wage at $30,000 in the union sector. What is the union-wage gap? What is the effect of the union on the wage in the nonunion sector? In a competitive economy, both sectors would hire half of the workers as labor is supplied inelastically. Therefore, to solve for the competitive wage, solve 500,000 1,000,000 20w wComp $25,000.
If the union wage is set at $30,000, the union sector employs L 1, 000, 000 20(30, 000) 400, 000 union workers .
The remaining 600,000 must be employed in the nonunion sector, which will happen if the wage in the nonunion sector is (1, 000, 000 600, 000) / 20 $20, 000 . Hence, the wage gap between the union and the nonunion sectors equals: 101 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Union-Wage Gap: $30, 000 $20, 000 $10, 000. Thus, the union-wage gap represents 50% of the nonunion wage as $10, 000 $20, 000 50% . The effect of the union-wage gap is that more people now work in the nonunion sector, which depresses wages there. In particular, although the union only negotiated a pay raise of $5,000 above the competitive wage, the wage gap is $10,000 as the workers who no longer work in the union sector compete wages down in the nonunion sector. 10-11. In Figure 10-6, the contract curve is PZ. (a) Does Point P represent the firm or the workers having all of the bargaining power? Does Point Z represent the firm or the workers having all of the bargaining power? Explain. The firm’s isoprofit curves improve as it hires the same number of workers at a lower wage, which means improvements are achieved by moving down (to the south). So, from the firm’s perspective, * M Z . From the union’s point of view, indifference curves increase to the northeast (as more people are hired at the same wage or when the same number of people are hired at a higher wage). Thus, from the union’s perspective, U * U M U R U Z . Thus, Point P represents the firm having all of the bargaining power, and Point Z represents the union having all of the bargaining power. (b) Suppose the union has the power to be a monopoly union in setting wages if it chooses, but it doesn’t have the power to force a wage and an employment level on the firm. On what portion of the contract curve PZ would you expect the bargained wage–employment contract to occur? The union sets the wage, but not the employment level. Thus, for any wage set by the union, the firm ―sees‖ a horizontal line at w and maximizes its profit by choosing an employment level that gives the firm a position on its highest possible isoprofit line. Thus, the firm will choose a point on the line described by PM. Knowing this, the best the union can do is to set wage wM as the firm will then choose EM (not drawn in Figure 10-6, but associated with Point M) which puts the outcome at Point M and gives the union U M . At any other wage, the firm chooses a different employment level according to PM, all of which are associated with indifference curve levels lower than U M . 10-12. Consider the following data on union versus nonunion wage and fringe benefit compensation.
Union Workers
Average Hourly Wage $21.91
Average Hourly Fringe Benefit $13.69
Total Hourly Compensation $35.60
102 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Nonunion Workers
Average Hourly Wage $17.66
Average Hourly Fringe Benefit $6.85
Total Hourly Compensation $24.51
Calculate the union effect for hourly wages, hourly fringe benefits, and total hourly compensation. What might you infer from the various union-negotiated effects? The union wage effect is ($21.91 $17.66) $17.66 24% . The union effect on total benefits is ($13.69 $6.85) $6.85 99.9% . The union effect on total compensation is ($35.60 $24.51) $24.51 45.2% . There are several conclusions to draw from these data. First, the union wage effect is substantial regardless if one is looking at wages, fringe benefits, or total compensation. Of these, the most important is likely fringe benefits, and the average worker is earning 45.2% more per hour in total compensation compared to nonunion workers. Also, though, the data suggest that unions are relatively more successful at negotiating fringe benefits than they are at negotiating wage increases as the average unionized worker receives almost twice (100%) the value of fringe benefits compared to the average nonunionized worker while they ―only‖ receive 24% more in wages. 10-13. Use a graph similar to Figure 10-10 to demonstrate the likely bargaining outcomes of three industries, all with identical union resistance curves. (a) Firm A has been losing money recently as wages and fringe benefits have risen from 63% to 89% of all costs in just the last 3 years. (b) Most of Firm B’s revenues come from supplying a product to three customers who use the product in their manufacturing of computers using a just-in-time inventory system. (c) Firm C is a local government that finds itself negotiating with its unionized employees. Government officials are pleased with the employees’ productivity, but they also face local pressure to keep taxes low. Firm A is likely to have very long and shallow isoprofit lines as it perceives that it cannot afford more pay increases. Firm B is vulnerable to union demands, because it will lose much of its revenue if it experiences a disruption in its production process as most of its output is sold to three firms that all use a justin-time inventory process. Thus, Firm B likely has very steeply sloped isoprofit lines. Firm C probably doesn’t care if it gives higher wages and benefits, as it can simply raise taxes to cover the costs. However, elected officials also feel pressure to keep taxes low and to at least look tough in negotiations with public employee unions. Thus, Firm C is probably between Firm A and Firm B in terms of the steepness of its isoprofit lines. In particular, Firm C is probably willing to bear short strikes but not long ones. 103 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Each of these resistance curves are plotted in the following graph. The graph shows that Firm A is the most willing to endure a long strike and the least likely to agree to a high wage demand, while Firm B is the least willing to endure a long strike and the most likely to agree to a high wage demand. Firm C is somewhere between the two on both issues.
10-14. Major League Baseball players are not eligible for arbitration or free agency until they have been in the league for several years. During these ―restricted‖ years, a player can only negotiate with their current team. Consider a small-market team that happens to own the rights to last year’s Rookie-of-the-Year. This player is currently under contract for $500,000 for the next 3 years. Because their current team is in a small market, the player’s value to their current team is $6 million per year (now and in the future). When the player becomes eligible for free agency, they will likely command $10 million per year for 7 years in free agency from competing large-market teams. In the questions below, assume the player wants to maximize their lifetime earnings. (a) What is the worst 10-year contract extension from the player’s point of view that the player would accept from their current team? If the player decides to play out their current contract and then signs with a large-market team, they will earn 3 $500,000 7 $10,000,000 $71.5million . Thus, the worst 10-year contract extension from the player’s point of view that they would accept is $7.15 million dollars per year for 10 years. (b) What is the best 10-year contract extension from the player’s point of view that their current team would offer them? The best contract extension their current firm is willing to offer is $6 million per year for the next 10 years.
104 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(c) Would you expect this player to sign a contract extension or to play out their contract and enter free agency 3 years from now? Given these numbers, if the player wants to maximize their earnings over the next 10 years (and assuming away discounting as the problem has done), the player will play out their current contract and then enter free agency in order to sign with a large-market team. 10-15. Recently, the National Football League Players Association (NFLPA), which is the union for the players in the National Football League (NFL), and the team owners (the NFL) experienced a labor impasse in the form of a lockout. For the record, each year about 150 players (called rookies) enter the NFL and 150 veteran players exit the league (via retirement or not making a team roster). While renegotiating the most recent labor settlement, the union took several stances. Explain why a union of players would advocate against: (a) Expanding the number of games played. Games played is analogous to hours worked. As NFL players are paid a salary, increasing the number of games played is effectively lowering each player’s hourly wage. A player who earns $1,440,000 per year, for example, is paid $90,000 per game. If the season were expanded to 18 games, the same player is now paid $80,000 per game. On this issue, the NFLPA publically argued that 18 games would cause substantially more physical damage to players over their playing careers (and felt for their lifetime) than does a 16game schedule. (b) Expanding the size of team rosters. One way a union negotiates higher wages for its members is to restrict entry into jobs. When rosters expand, more players are in the union, each competing for money paid by firms. At the extreme, with a team salary cap of $100,000,000 per year, a 53-man roster allows for an average salary of $1.886 million whereas a 57-man roster only allows for an average salary of $1.754 million. (c) A team salary cap. In all professional sports leagues, the players union objects to salary caps because salary caps are simply a way by which the owners regulate one another. In a purely competitive environment, the players believe that owners would spend more money on salaries. For the record, salary caps now exist to some degree, in the NFL (football), NBA (basketball), and NHL (hockey). Although baseball doesn’t have an official salary cap, it does have a luxury tax that penalizes clubs from spending too much more than average. (It also penalizes clubs for spending too little.) (d) A rookie salary cap. 105 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
One of the strangest result of the NFL lockout, according to the media, was that the NFLPA was against a rookie salary cap. The argument (from the media) went: Current players should support a rookie salary cap so that the real, on-the-field performers receive a greater share of the salaries. (JaMarcus Russell, the #1 overall pick in 2007 by the Oakland Raiders, was paid almost $40 million, played very little, played poorly when they did play, and was released in 2010.) A rookie salary cap would prevent such atrocities and instead reward the players who have longer, more productive careers. So why did the NFLPA not support a rookie salary cap? The answer for economists is that the NFLPA understands that teams conduct marginal benefit– marginal cost analyses. If rookie salaries are kept artificially low, teams will have more incentive to employ rookies rather than, say, 4-year veterans. And although the NFLPA includes all of the NFL superstars, most of its members are 3–7-year veterans who are hoping to stay in the league for a few more years. These players know that if teams are given the opportunity of hiring a rookie for $50,000 or the marginally better but much more expensive 5-year veteran for $1,000,000, the team will go with the rookie. Therefore, in order to protect the jobs and salaries of a large part of the rank-and-file membership, the NFLPA advocated against a rookie salary cap. CHAPTER 11 11-1. Suppose there are 100 workers in an economy with two firms. All workers are worth $35 per hour to Firm A but differ in their productivity at Firm B. Worker 1 has a value of marginal product of $1 per hour at Firm B; Worker 2 has a value of marginal product of $2 per hour at Firm B, and so on. Firm A pays its workers a time rate of $35 per hour, while Firm B pays its workers a piece rate. How will the workers sort themselves across firms? Suppose a decrease in demand for both firms’ output reduces the value of every worker to either firm by half. How will workers now sort themselves across firms? Workers 1–34 work for Firm A as a time rate of $35 is more than their value to Firm B, while workers 36–100 work for Firm B. Worker 35 is indifferent. More productive workers, therefore, flock to the piece rate firm. After the price of output falls, Firm A values all workers at $17.50 per hour, while Worker 1’s value at Firm B falls to 50 cents, Worker 2’s value falls to $1 at Firm B, and so on. The question is what happens to the wage. Presumably wage also falls to $17.50 per hour in Firm A. If it falls by half, then the sorting of workers to the two firms remains unchanged. 11-2. Taxicab companies in the United States typically own a large number of cabs and licenses; taxicab drivers then pay a daily fee to the taxicab company to lease a cab for the day. In return, the drivers keep all of their fares (so that, in essence, they receive a 100% commission on their sales). Why do you think this type of compensation system developed in the taxicab industry? Imagine what would happen if the cab company paid a 50% commission on fares. The cab drivers would have an incentive to misinform the company about the amount of fares they generated in order to pocket most of the receipts. Because cab companies find it almost 106 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
impossible to monitor their workers, they have developed a compensation scheme that leaves the monitoring to the drivers. By charging drivers a rental fee and letting the drivers keep all the fares, each driver has an incentive to not shirk on the job. 11-3. A firm hires two workers to assemble bicycles. The firm values each assembly at $12. Charlie’s marginal cost of allocating effort to the production process is 4N, where N is the number of bicycles assembled per hour. Donna’s marginal cost is 6N. (a) If the firm pays piece rates, what will be each worker’s hourly wage? As the firm values each assembly at $12, it will pay $12 for one assembly, $24 for two assemblies, and so on when offering piece rates. As Charlie’s marginal cost of the first assembly is $4, the second is $8, the third is $12, and the fourth is $16; Charlie assembles three bicycles each hour and is paid an hourly wage of $36. As Donna’s marginal cost of the first assembly is $6, the second is $12, and the third is $18; Donna assembles two bicycles each hour and is paid an hourly wage of $24. (b) Suppose the firm pays a time rate of $15 per hour and fires any worker who does not assemble at least 1.5 bicycles per hour. How many bicycles will each worker assemble in an 8-hr day? As working is painful to workers, each will work as hard as necessary to prevent being fired, but that is all. Thus, each worker assembles 1.5 bicycles each hour, for a total of 12 bicycles in an 8hr day. 11-4. All workers start working for a particular firm when they are 21 years old. The value of each worker’s marginal product is $18 per hour. In order to prevent shirking on the job, a delayed-compensation scheme is imposed. In particular, the wage level at every level of seniority is determined by: Wage = $10 + (0.4× Years in the firm).
Suppose also that the discount rate is zero for all workers. What will be the mandatory retirement age under the compensation scheme? (Hint: Use a spreadsheet.) To simplify the problem, suppose the workers work 1 hr per year. (The answer would be the same regardless of how many hours are worked, as long as the number of hours worked does not change over time). Some of the relevant quantities required to determine the optimal length of the contract are: Age 21 22 23 24
Years the Job 1 2 3 4
on VMP $18 $18 $18 $18
Accumulated VMP $18 $36 $54 $72
Contract Wage $10.00 $10.40 $10.80 $11.20
Accumulated Contract Wage $10.00 $20.40 $31.20 $42.40
107 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Age : 40 41 42 43 : 60 61 62
Years the Job : 20 21 22 23 : 40 41 42
on VMP : $18 $18 $18 $18 : $18 $18 $18
Accumulated VMP : $360 $378 $396 $414 : $720 $738 $756
Contract Wage : $17.60 $18.00 $18.40 $18.80 : $25.60 $26.00 $26.40
Accumulated Contract Wage : $276.00 $294.00 $312.40 $331.20 : $712.00 $738.00 $764.40
The VMP is constant at $18 per year. The accumulated VMP gives the total product the worker has contributed to the firm up to that point in the contract. The wage in the contract follows from the equation, and the accumulated wage is the total wage payments received by the worker up to that point. Until the 20th year in the firm, the worker receives a wage lower than their VMP; after the 21st year, the worker’s wage exceeds the VMP. The contract will be terminated when the total accumulated VMP equals the total accumulated wage under the delayed compensation contract, which occurs on the worker’s 41st year on the job. So the optimal retirement age is age 61. Allowing the worker to retire after this age would be a bad deal for the firm as total lifetime wage payments exceed total lifetime value to the firm after 41 years of service. 11-5. Suppose a firm’s technology requires it to hire 100 workers regardless of the wage level or market demand conditions. The firm, however, has found that worker productivity is greatly affected by its wage. The historical relationship between the wage level and the firm’s output is given by: Wage Rate $8.00 $10.00 $11.25 $12.00 $12.50
Units Output 65 80 90 97 102
of
What wage level should a profit-maximizing firm choose? The data in the problem can be used to calculate the elasticity of the change in output with respect to the change in the wage. The efficiency wage is determined by the condition that this elasticity must equal 1. This elasticity is 1 when the firm raises the wage from $10 to $11.25 an hour: (90 80) / 80 (11.25 10) /10 1.
11-6. Consider three firms identical in all aspects except their monitoring efficiency, which cannot be changed. Even though the cost of monitoring is the same across the three 108 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
firms, shirkers at Firm A are identified almost for certain; shirkers at Firm B have a slightly greater chance of not being found out; and shirkers at Firm C have the greatest chance of not being identified as a shirker. If all three firms pay efficiency wages to keep their workers from shirking, which firm will pay the largest efficiency wage? Which firm will pay the smallest efficiency wage? In this example, there is no connection between the cost of monitoring and the efficiency of monitoring, as it is assumed that monitoring efficiency cannot be changed. Moreover, the value of unemployment is the same for workers regardless of their employer. Focusing just on the probability of being caught shirking, therefore, workers in Firm A have the least incentive to shirk (as they are most likely to get caught) while workers in Firm C have the greatest incentive to shirk (as they are least likely to get caught). The idea of efficiency wages is to use wages to buy off the incentive to shirk. Therefore, Firm A will pay the lowest efficiency wage, while Firm C will pay the greatest efficiency wage. 11-7. Consider three firms identical in all aspects (including the probability with which they discover a shirker), except that monitoring costs vary across the firms. Monitoring workers is very expensive at Firm A, less expensive at Firm B, and cheapest at Firm C. If all three firms pay efficiency wages to keep their workers from shirking, which firm will pay the greatest efficiency wage? Which firm will pay the smallest efficiency wage? In this example, there is no connection between the cost of monitoring and the efficiency of monitoring. The efficiency wage, therefore, is determined by the incentives of the workers, not the costs of the firms. (The decision of whether to monitor workers, of course, will depend on the cost of monitoring.) Thus, all three firms will offer the same efficiency wage. 11-8. A firm can hire as much labor as it wants at $5 per hour. In return, each worker produces 10 units of output per hour. The firm can sell up to 2,500 units of output each day at $2 per unit, but it cannot sell any more than 2,500 units of output in a day. The firm has no other costs besides labor. (a) How many hours of labor does the firm purchase and how much profit does it earn each day? As each hour of labor costs $5 but provides 10 units of output that are sold at $2 each for an hourly revenue of $20 and an hourly profit of $15, the firm hires as many workers as necessary to sell all 2,500 units that it can sell each day. Therefore, the firm hires 250 hr of labor each day and earns profit of 2,500 $2 250 $5 $3, 750 of daily profit. (b) The firm can choose to pay an efficiency wage. In particular, the firm can choose to pay $6, $7, $8, $9, or $10 per hour, and in exchange, each worker will produce 18, 23, 27, 28, or 29 units of output per hour, respectively. What hourly wage should the firm offer to maximize profits?
109 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
One way to answer the problem is find the wage level at which the elasticity of output with respect to the wage equals (or is the closest) to 1. Below are the elasticities: Wage $6 : (18 10) /10 (6 5) / 5 4.0 Wage $7 : (23 18) /18 (7 6) / 6 1.67 Wage $8 : (27 23) / 23 (8 7) / 7 1.22 Wage $9 : (28 27) / 27 (9 8) / 8 0.30 Wage $10 : (29 28) / 28 (10 9) / 9 0.32
Therefore, the optimal efficiency wage is $8 per hour. This problem can also be done with the same technique as in Part (a) and simply calculate all of the profits: Wage $6 : E 2,500 /18 139 2,500 $2 139 $6 $4,167. Wage $7 : E 2,500 / 23 109 2,500 $2 109 $7 $4, 239. Wage $8 : E 2,500 / 27 93 2,500 $2 93 $8 $4, 259. Wage $9 : E 2,500 / 28 89 2,500 $2 89 $9 $4,196. Wage $10 : E 2,500 / 29 86 2,500 $2 86 $10 $4,138.
Therefore, this method also results in the optimal efficiency wage being $8 per hour. 11-9. Consider a firm that offers the following employee benefit. When a worker turns 60 years old, they are given a one-time opportunity to quit their job, and in return, the firm will pay them a bonus of 1.5 times their annual salary and pay them health insurance premiums until they are eligible for Medicare (at age 65). (a) What problem is the firm trying to solve by offering this benefit? In general, wages (and salaries) increase with age. Thus, even when someone becomes eligible to receive ―full‖ social security benefits and go on Medicare, several people choose to continue to work. Again, they are choosing to work when they are probably very well paid and possibly less valuable to the firm than they were in previous years. The firm, therefore, is trying to entice workers to retire and not continue to work once retirement becomes a possibility. This is a problem these days as federal law prohibits most firms from enforcing a mandatory retirement age. (b) Why is the health insurance premium portion of the benefit important in the United States? The health insurance premium is important in the United States, because health care is not provided by the government for everyone in the United States. Most people receive their health care through their employer. Thus, if one is not eligible to receive Medicare until they turn 65 years old, for example, the cost of retiring before age 65 is larger than just the cost of foregoing earnings, it’s also foregoing health care insurance premiums. 110 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(c) For what industries might one expect such opportunities to be presented to workers? These types of retirement incentives are most likely to arise in industries or occupations in which (1) older workers are paid a lot more than younger (new) workers and/or (2) older workers are not as productive as younger workers.
11-10. (a) Why would a firm ever choose to offer profit sharing to its employees in place of paying piece rates? Piece rates can be very difficult to pay in some situations. For example, in a situation in which a group of workers is responsible for producing the good, determining who made what may be impossible. Consider Southwest Airlines, which is known to have a profit-sharing program that is well-liked by its employees. To pay a flight attendant a piece rate, the airline would have to survey passengers as they depart the plane, and then, from the passengers’ opinions, pay the appropriate piece rates. Clearly, this is untenable. Profit sharing, on the other hand, is a convenient way to approximate the piece rate system. Since all workers are covered by profit sharing at Southwest Airlines, all workers have a continuous incentive to do their job very well. They also have the added incentive to make sure that their coworkers also do their jobs well. (b) Describe the free riding problem in a profit-sharing compensation scheme. How might the workers of a firm ―solve‖ the free riding problem? When all workers are covered by a profit-sharing plan, an individual worker has the incentive to shirk their responsibilities as their direct effect on profits is likely small. If all workers do this, however, the total profit created by the firm will be much smaller than it would be if workers were paid a piece rate. One way to ―solve‖ the free rider problem is with social pressure. If the atmosphere of the workers is that everyone works and shirkers will be punished somehow—socially, annual reviews, being fired, and so on—then the incentive to shirk is diminished. Thus, a profit-sharing scheme works best when many workers must interact with each other (such as the flight attendants, pilots, luggage movers, and ticket associates at Southwest Airlines). 11-11. (a) How does the offering of stock options to CEOs attempt to align CEO incentives with shareholder incentives? The idea of stock options is that the CEO will get paid more (via the option to purchase shares of the firm’s stock below market value) if the share price increases during their tenure with the firm. Thus, as shareholders want the firm to maximize the share price; by offering the CEO stock options, the CEO has a greater incentive to take actions that accomplish this. 111 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) Enron was a company that was ruined in part because of the stock options offered to upper management. Explain. Although offering stock options can align CEO incentives with shareholder incentives, what really happens is that the stock options provide an incentive to the CEO to maximize the shortrun share price by any means possible. At Enron (and WorldCom and others), this led unethical CEOs to maximize the share price by improper accounting methods. Thus, the share price rose, but not for fundamentally strong reasons. The CEOs then cashed in their stock options before the market discovered the problem. In the long run, shareholder value was not maximized, though CEO wealth may be. (c) In addition to accounting reforms, how might stock options be changed to try to prevent situations like what happened at Enron from occurring in the future? One possible solution to the problem in (b) is to issue stock options that cannot be cashed in until the CEO has been gone from the company for some time (2, 5, or even 10 years). Such options would supposedly cause the CEO to make the best long-run decisions for the firm. 11-12. (a) Personal injury lawyers typically do not charge a client unless they obtain a monetary award on their client’s behalf. Why? One reason is that many litigants with worthwhile lawsuits could not afford to pay lawyer expenses if they would lose. Even though they may have a good case, they are not certain to win. And so without this type of arrangement, these litigants may not choose to go forward with the lawsuit. Another reason is incentives. By having the lawyers receive payment only when an award is received, the incentives of the lawyer are better aligned with the objective of the litigant. In essence, this is a profit-sharing payment scheme. (b) What would happen to the number of lawsuits if lawyers had to charge an hourly rate win or lose and could not charge a fixed percentage of the award? By all accounts, this would greatly reduce the number of lawsuits as litigants would not go forward with frivolous lawsuits. The problem, of course, is that some potential litigants would not pursue legitimate lawsuits either, because they are risk averse and would be afraid of losing and being stuck with huge lawyer fees. 11-13. Consider the following four tasks (all of which require significant time and/or effort): (1) Trekking through a forest carrying a trowel and 40 saplings, and every quarter of a mile kneeling to the ground, digging a hole, and planting a sapling; (2) using a pick axe to extract 100 pounds of ore from the ground; (3) a team of 200 shoveling snow from the 85,000 seats in a stadium before a January football game; and (4) advising a college senior in their senior thesis which, by protocol, requires weekly 90-min meetings plus an 112 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
additional 2 hr each week of reading and preparation. Describe in detail why an employer may or may not want to pay employees by the piece to accomplish these tasks? What are some conclusions for when paying by the piece is most useful? The problem with paying by the piece for Task (1) is monitoring. It is very costly (or impossible) to monitor people walking through the forest and planting saplings. If paid by the piece, one could imagine someone taking their 40 saplings, walking 1 mile out of site, throwing the samplings into a ravine, and returning 8 hr later claiming to have planted all 40. Task (2) is very easily paid a piece rate as the worker needs to actually undertake the effort to mine 100 pounds of ore. The problem with paying by the piece for Task (3) is that the work is done by a team. In the end, the entire team has cleared all of the snow in the stadium, so maybe a team-reward or profitsharing scheme could be employed, but it would likely be difficult to know exactly how much snow was cleared by each person. The problem with Task (4) is quality control. If the professor agrees to advise a senior thesis, the Dean of the Faculty will only know if the student received credit for the work, but that credit is assigned by the professor. Unless the Dean is willing to read all of the senior theses that received credit to evaluate their quality, the university may not be able to judge very well which professors spent 90 min each week with the student plus a couple more hours each week in preparation versus which professors met only once a month for 30 min each time. The lesson is that piece rates are best used when work is individualized and can be easily monitored and measured with the worker having little or no control over the quality of the work. 11-14. Economists and psychologist have long wondered how worker effort relates to wages. Specifically, the question is whether worker effort responds to increased wages alone or whether effort also responds to relative wages. (a) Design a classroom experiment that might allow you to quantify the relationship between effort, reward, and relative reward. The reward is going to be M&Ms. At the start of the experiment, each student is secretly given an identity (maybe an ID number) and a wage. For each unit of ―output‖ produced, student i is paid wi M&Ms. Each student is then given a sheet of paper that shows all of the wages being paid (e.g., wages range from w = 1 to w = 5), but students don’t know who is earning which wage. Alternatively, you might put students in groups of five and tell them their own wage and what the average wage is in their group of five. Each student is then given 200 single-digit addition problems and 1 min to answer as many of the questions as they can. Each student, of course, must put their ID number on their answers in order to be paid later. (Note, the experimenter must be able to align wage rates with output, not only to collect data but also to pay the students after the experiment.) 113 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) Explain how the data you collect can be used to identify both relationships. What do you think you would find? Consider a class with 20 students. Divide the group into four groups of five each. In one group, the wage rates are 1, 2, 3, 4, and 5 with an average of 3. In the next group, the wage rates are 3, 4, 5, 6, and 7 with an average of 5. And so on, with averages of 7 and 9 in the last two groups, respectively. Everyone is then given 200 easy math problems and 1 min to do as many of them as they like. As the experimenter, I need to know each person’s wage and each person’s answers. After class, I can then score the answers, determine each students ―pay,‖ and pay them at the next class. For each student, then, I know their total output, wage, and their wage relative to their group’s average. My guess is that there will be a positive relationship between wage and output, but maybe not. I don’t know if relative wage will matter or not. The answer might also depend on the reward. Though it may not pass a human subjects committee, if the reward was extra credit, there might not be any wage or relative wage effect. 11-15. Some compensation schemes include a signing bonus while others include the potential to receive annual year-end bonuses. (a) From the firm’s perspective, what are the benefits of offering a signing bonus? What are the benefits of offering a year-end bonus? Offering a signing bonus is a means by which firms compete for talent. A signing bonus may be used to signify value or to allow a potential worker to pay for transferring jobs. It is also a means by which firms might be able to keep annual salaries relatively equal while still paying the most valuable workers more. Year-end bonuses can be rewards for merit or can be akin to offering profit sharing to workers if bonuses are tied to firm performance. Thus, in lieu of offering only a commission or only a piece-rate scheme, year-end bonuses allow the firm to dangle the idea of profit sharing, not shirking, and so on in front of its workers all year long. (b) If a firm pays its sales staff a piece rate and a year-end bonus, why will it be the case that the rate of pay per piece is less than the market value? Why will the sales staff willingly accept such an arrangement? Suppose each unit of output (or piece) is worth $11 to the firm. At the end of the year, the firm may have a policy that it awards 10% bonuses to people who ―had a good year.‖ In this case, the firm would pay a piece rate of $10 per piece and then top this off with a 10% (or $1 per piece) year-end bonus. Clearly, the firm must pay a rate per piece throughout the year that is lower than market value in order to afford the year-end bonus. As long as the firm is known to not renege on its promise of a bonus, the workers should be fine with this. (If the firm was a frequent renege, workers would learn this and stop valuing the bonus scheme.) (c) How does the existence of year-end bonuses support the bonding critique?
114 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
A year-end bonus is essentially a bond. The worker knows that if they perform as expected, they will receive the bonus. If they shirk on the job, however, or doesn’t meet performance targets or if they leave the firm midyear, they will forego the bonus. That is, they forego the bond that they placed on the job. To further illustrate this point, Wall Street firms are famous for offering year-end bonus packages. As a result, (1) many workers who want to change jobs simply do not in Months 8–12 as they know they would be leaving considerable monies on the table, (2) workers who do change jobs midyear are offered considerable signing bonuses to make up for the year-end bonus that is being foregone, and (3) most of the turnover between jobs happens in Months 1–3, shortly after year-end bonuses have been announced. CHAPTER 12 12-1. Suppose 25,000 persons become unemployed. You are given the following data about the length of unemployment spells in the economy: Duration of Spell (in Months) 1 2 3 4 5 6
Exit Rate 0.60 0.20 0.20 0.20 0.20 1.00
where the exit rate for month t gives the fraction of unemployed persons who have been unemployed t months and who ―escape‖ unemployment at the end of the month. (a) How many unemployment months will the 25,000 unemployed workers experience? The data can be used in the problem to calculate the number of workers who have 1 month of unemployment, the number who have 2 months of unemployment, and so on, and how many months of unemployment are associated with workers who get a job after a given duration. Duration (Months) 1 2 3 4 5 6
Exit Rate 0.60 0.20 0.20 0.20 0.20 1.00
# Unemp.: Start of Month 25,000 10,000 8,000 6,400 5,120 4,096
# of Exiters 15,000 2,000 1,600 1,280 1,024 4,096
# of Stayers 10,000 8,000 6,400 5,120 4,096 0
# Months for Duration 15,000 4,000 4,800 5,120 5,120 24,576
The 25,000 workers will experience 58,616 months of unemployment, 2.34 months per worker. 115 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(b) What fraction of persons who are unemployed are ―long-term unemployed‖ in that their unemployment spells will last 5 or more months? Only 5,120 1, 024 4, 096 of the 25,000 workers (20.5%) are in spells lasting 5 or more months. (c) What fraction of unemployment months can be attributed to persons who are longterm unemployed? Although only 20.5% of workers are unemployed for 5 or more months, they account for 29, 696 5,120 24,576 of the 58, 616 50.7% months of unemployment. 12-2. According to U.S. labor statistics, roughly 5.8 million people were unemployed in 2006. Of these, 2.1 million were unemployed for less than 5 weeks, 1.7 million were unemployed for 5–14 weeks, 900,000 were unemployed for 15–26 weeks, and 1.1 million were unemployed for 27 or more weeks. Assume that the average spell of unemployment is 2.5 weeks for anyone unemployed for less than 5 weeks. Similarly, assume the average spell is 10 weeks, 20 weeks, and 35 weeks for the remaining categories. How many weeks did the average unemployed worker remain unemployed? What percentage of total months of unemployment are attributable to the workers that remained unemployed for at least 15 weeks? The total number of weeks of unemployment is calculated as: 2.1 2.5 weeks 1.7 10 weeks 0.9 20 weeks 1.1 35 weeks 81.65 million weeks.
The second two groups comprise the unemployed workers who remained unemployed for at least 15 weeks. These two groups account for 0.9 20 weeks 1.1 35 weeks 56.5 million weeks of unemployment. Looked at differently, these two groups comprising the long-term unemployed accounted for 56.5 81.65 69.2% of all weeks of unemployment. 12-3. The previous question concerned the unemployment rate and the distribution of weeks of unemployment immediately prior to the Great Recession. Looking at the Great Recession, the data show roughly 12.7 million people were unemployed in 2009. Of these, 2.7 million were unemployed for less than 5 weeks, 3.3 million were unemployed for 5–14 weeks, 2.5 million were unemployed for 15–26 weeks, and 4.2 million were unemployed for 27 or more weeks. Generally, how did the unemployment picture change with the Great Recession? First, let’s repeat the analysis from Question 12-2 but for 2009. The total number of weeks of unemployment is calculated as: 2.7 2.5 weeks 3.3 10 weeks 2.5 20 weeks 4.2 35 weeks 236.75 million weeks. 116 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
The long-term unemployed comprised 2.5 20 weeks 4.2 35 weeks 197 million weeks of unemployment, or 197 236.75 83.2% of all weeks of unemployment. Generally, there are two extremely important takeaway points regarding unemployment during the Great Recession: (1) The sheer number of unemployed people increased dramatically, by more than double. (2) The number of long spells of unemployment also increased markedly. Although the percentage of unemployment weeks ―only‖ increased from about 69% before the Great Recession to over 83% during the Great Recession, the number of such weeks ballooned from about 47 million before the Great Recession to over 197 million during the Great Recession. 12-4. Suppose the marginal revenue from search is MR 50 1.5w,
where w is the wage offer at hand. The marginal cost of search is MC 5 w.
(a) Why is the marginal revenue from search a negative function of the wage offer at hand? If the offer-at-hand is relatively low, it pays to keep on searching as the next offer is likely higher than the offer-at-hand. If the offer-at-hand is very high, however, it does not pay to keep on searching since it is unlikely that the next search will generate a higher wage offer. (b) Can you give an economic interpretation of the intercept in the marginal cost equation; in other words, what does it mean to say that the intercept equals $5? Similarly, what does it mean to say that the slope in the marginal cost equation equals $1? The $5 indicates the out-of-pocket search costs. Even if the offer-at-hand is zero (so that there is no opportunity cost to search), it still costs money to get to the firm and learn about the details of the potential job offer. The slope equals $1, because the costs of search also vary directly with the opportunity cost of search which is the wage offer at hand. If the wage offer at hand is $10, the opportunity cost from one more search equal $10; if the wage offer at hand is $11, the opportunity cost would be $11, and so on. (c) What is the worker’s asking wage? Will a worker accept a job offer of $15? The asking wage is obtained by equating the marginal revenue of search to the marginal cost of search, or 50 1.5w 5 w . Solving for w implies that the asking wage is $18. The worker, therefore, would not accept a job offer of $15. (d) Suppose unemployment insurance (UI) benefits are reduced, causing the marginal cost of search to increase to MC 20 w . What is the new asking wage? Will the worker accept a job offer of $15?
117 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
If we equate the new marginal cost equation to the marginal revenue equation, we find that the asking wage drops to $12. The worker will now accept a wage offer of $15. 12-5. A labor market has 50,000 people in the labor force. Each month, a fraction p of employed workers become unemployed (0 < p < 1) and a fraction q of unemployed workers become employed (0 < q < 1). (a) What is the steady-state unemployment rate? The steady-state unemployment rate is p / ( p q). (b) Under the steady state, how many of the 50,000 in the labor force are employed and how many are employed each month? How many of the unemployed become employed each month? As the unemployment rate is p / ( p q), the employment rate is 1 p / ( p q) q / ( p q) . Therefore, we have that: Number employed each month = 50, 000 q / ( p q). Number unemployed each month 50, 000 p / ( p q).
As q fraction of the unemployed become employed each month, the total number of people flowing from unemployment to employment (which equals the total number of people flowing from employment to unemployment each month) is: Monthly flow to and from unemployment 50, 000 p q / ( p q).
(c) Suppose p = 0.08 and q = 0.32. What is the steady-state unemployment rate and how many workers move from employment to unemployment each month? This question can be answered using the parameter values and the equations above: The steady state unemployment rate p / ( p q) 0.08 / (0.08 0.32) = 20%.
Monthly flow to and from unemployment 50, 000 p q / ( p q) 50, 000 0.08 0.32 / (0.08 0.32) = 3,200.
12-6. Compare two unemployed workers; one is 25 years old while the other is 55 years old. Both workers have similar skills and face the same wage offer distribution. Suppose that both workers also incur similar search costs. Which worker will have a higher asking wage? Why? Can search theory explain why the unemployment rate of young workers differs from that of older workers? 118 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
The marginal revenue of search depends on the length of the payoff period. Younger workers have the most to gain from obtaining higher paying jobs, since they can then collect the returns from their search investment over a longer expected work-life. As a result, it pays for younger workers to set their asking wage at a relatively high level. This implies that younger workers will tend to have higher unemployment rates and longer spells of unemployment than older workers. 12-7. Suppose the government proposes to increase the level of UI benefits for unemployed workers. A particular industry is now paying efficiency wages to its workers in order to discourage them from shirking. What is the effect of the proposed legislation on the wage and on the unemployment rate for workers in that industry? (Hint: This is best shown with a graph similar to Figure 12-13.) The introduction of UI benefits shifts the no-shirking supply curve upward (from NS to NS ), because a higher wage would have to be paid in order to attract the same number of workers who do not shirk. As a result, the new equilibrium (Point Q ) entails a higher efficiency wage and leads to a larger number of unemployed workers (i.e., lower total employment).
12-8. During the debate over a federal spending bill, Senator A proposed changing the schedule for paying out unemployment benefits to be one where benefits were doubled, but offered for half the current duration (so that UI benefits would expire after 13 weeks). In contrast, Senator B proposed cutting UI benefits in half but to pay benefits for twice as long (so that UI benefits would not expire until after 52 weeks). Comparing to the status quo of offering UI benefits for 26 weeks, contrast both plans along the following dimensions: overall unemployment rate, average duration of unemployment spells, and the distribution of wages accepted by workers coming out of a spell of unemployment. The answers to this problem are somewhat complicated, because both plans provide a new benefit and a new cost. Plan A’s new benefit is doubled benefits while its new cost is benefits for 119 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
a shorter period of time. Plan B’s new benefit is benefits for twice as long while its new cost is that it offers half the benefit of the status quo. Moreover, the results of the plans likely depend on the point of time in the unemployment spell under consideration. Overall Unemployment Rate: As Plan A offers twice the benefit, people may find that they change jobs more frequently if they are fairly certain of finding new employment. In the United States, most unemployed workers find new employment within 13 weeks, so Plan A may encourage the (short term) unemployment rate to increase. In contrast, Plan B may encourage the (short term) unemployment rate to fall as people receive less benefit when unemployed. Average Duration of Unemployment Spells: At the start of an unemployment spell, Plan A may encourage longer spells as the benefit to unemployment remains high. As the 13th week approaches, however, Plan A will likely encourage ending an unemployment spell as benefits will expire sooner. Thus, there will likely be longer short spells but fewer long spells under Plan A. Plan B is exactly the opposite. At the start of an unemployment spell, Plan B will likely encourage ending the spell as the benefit to continuing is lower than the status quo. As the 26th week approaches, however, Plan B will encourage a longer spell as benefits (though at a lower level) will continue for another 26 weeks. Distribution of Accepted Wages: The distribution of accepted wages follows the distribution of unemployment spells. Under Plan A, the accepted wage will be higher than the accepted wage under the status quo early in the unemployment spell but will be lower later in the unemployment spell. Similarly, the distribution of accepted wages under Plan B will be lower than the accepted wage under the status quo early in the unemployment spell but higher later in the unemployment spell. 12-9. Consider a small island economy in which almost all jobs are in the tourism industry. A law is passed mandating that all workers in the tourism industry be paid the same national hourly wage, even though workers differ in their skills and effort. In fact, some workers simply cannot produce enough output to be worth the national wage. (a) How will a worker’s optimal job search strategy differ from that discussed in the text? What is the essential difference between this example and the general case discussed in the text? The worker’s optimal job search strategy will differ from that discussed in the text in that all jobs are associated with the same wage, so turning down job offers and extending one’s search in hopes of finding a higher wage are in vain. The only reason to not accept a job offer is if firms differ in their working conditions. But in general, people will search for any offer, and accept it. (b) Despite the law, workers become more productive with experience. How might firms compete over workers when all workers must be paid the same wage? 120 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Firms will compete over workers by offering different job amenities, such as better working hours, better working conditions, subsidizing an employee cafeteria, offering a lighter workload, and granting more vacation days. 12-10. During the Great Recession, many news stories focused on the rising number of discouraged workers. The implication of many of these stories is that the unemployment situation was worse than indicated by the unemployment rate because of the existence of these discouraged workers. (a) What are some of the reasons typically given for not including discouraged workers in the unemployment rate calculation? The standard argument for not including discouraged workers in the unemployment rate calculation is that these people may, for a variety of reasons, be choosing to no longer seek work. Mainly, they may be taking advantage of a low-wage state of the economy to consume more leisure or to take care of family members. Some discouraged workers may also return to school. (b) Show mathematically that if discouraged workers are treated as unemployed that the unemployment rate would increase. Let E be the number of employed people, U be the number of unemployed people, and D be the number of discouraged workers. When discouraged workers are not included in the unemployment rate, the unemployment rate is calculated as U / (U E ) . When discouraged workers are included in the unemployment rate, the unemployment rate is calculated as (U D) / ( E U D) . As D was added to both the numerator and the denominator, and as D is positive, the unemployment rate must be higher when discouraged workers are included in the calculation. (c) Show mathematically that the unemployment rate as defined by the Bureau of Labor Statistics (BLS) would be lower if data on the underground economy were more readily available. Let E be the number of employed people as reported to the BLS, U NU be the number of unemployed people who do not work in the underground economy, and U U be the number of people who are reported as unemployed by the BLS who actually have jobs in the underground economy. Because the BLS does not know that U U people are actually employed, the unemployment rate is calculated as (U NU U U ) / ( E U NU U U ) . Had the BLS known, however, of the people working in the underground economy, the unemployment rate would be calculated as (U NU ) / ( E U NU U U ) , which is clearly less than the actual unemployment rate. 12-11. Reread ―Theory at Work: Cash Bonuses and Unemployment‖ from the text and answer the following questions.
121 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(a) What is the general research question? What is the difference between the control group and the treatment group? The general question is whether people receiving UI benefits (for up to 26 weeks) will exit unemployment sooner (and thereby possibly save the state money) if they are given a financial incentive to do so. The control group are unemployed workers who are on UI and under the regular UI rules. The treatment group are unemployed workers who are on UI and have been told they will receive a cash payout if they accept a job within a certain amount of time (11 weeks in Illinois and 6 weeks in Pennsylvania) and keep the job for at least 4 months. (b) Why is it an important result that accepted wages were essentially the same between the control group and the treatment group? It is important that the wages eventually earned by the treatment group were essentially the same as the wages eventually earned by the control group, because this supplies policy makers with evidence that the treatment group are not taking ―bad‖ jobs just to get the cash incentive. Rather, if wages and duration of employment at the new job look the same for both groups, then the cash incentive really can be viewed as encouraging unemployed workers to act more quickly to leave unemployment and forego UI benefits. (c) What if anything might this research imply about whether discouraged workers should be included in an unemployment rate calculation? The general takeaway from the research ―might‖ be extendable to discouraged workers. Of course, discouraged workers are not receiving UI benefits. But if discouraged workers remain out of the labor force simply because they are taking more leisure during a time of low wages, then they certainly should not be included in unemployment rate calculations (which they are not). 12-12. (a) The table below reports 2006 unemployment rates for whites, Blacks, and Hispanics in the United States separately for those with a high school degree (and no more schooling) and those with a college degree. Describe how educational status is related to unemployment rates for each of these groups. For which racial groups is a college education an equalizer in terms of unemployment rates compared to whites?
Whites Blacks Hispanics
2006 Unemployment Rate High School Degree 3.7 8.0 4.1
College Degree 2.0 2.8 2.2
122 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
The table shows that unemployment falls for all races as education increases. It further shows that discrepancies in unemployment rates across racial groups are much more of a problem at lower levels of education. (b) Consider Figure 12-2. Looking at the years of the Great Recession, did unemployment increase for all education groups? Which group was most affected? According to Figure 12-2, the unemployment rate increased sharply for all education groups during the Great Recession. Most observers would say that High School Dropouts were the most (adversely affected), though it does depend a little on how one measures the effect. College Graduates saw their unemployment rate increase by 3 percentage points, but this was almost a 150% increase as it went from 2% to about 5%. High School graduates saw their unemployment rate increase by about 6 percentage points, going from about 4% to over 10%. This group, too, therefore, experienced about a 150% increase in the unemployment rate. Most observers would say that High School Dropouts were the most affected because their unemployment rate increased by about 8 percentage points—increasing from about 7% to about 15%. In comparison, however, this was about a 115% increase in the rate. 12-13. Suppose the current UI system pays $500 per week for up to 15 weeks. The government considers changing to an UI system that requires someone to be unemployed for 5 weeks before receiving any benefits. After 5 weeks, the person receives a lump-sum payment of $2,500. They then receive no benefits for another 5 weeks. If they are still unemployed then, they receive a second lump-sum payment of $2,500. They again receive no benefits for another 5 weeks. If they are still unemployed, then they receive a third and final lump-sum payment of $2,500. Provide a graph similar to Figure 12-11 showing how the probability of finding a job over time is likely to be different under the status quo and the proposed scheme. The new UI plan provides an incentive to be unemployed after 5, 10, and 15 weeks. It provides less (actually no) incentive to be unemployed during the other weeks other than for banking time to qualify for payments later. This idea is embedded in the following graph:
123 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
12-14. UI benefits automatically stimulate the economy during an economic contraction, which is good from the workers’ point of view. From the firm’s point of view, however, the UI system can be overbearing on business during prolonged contractions. (a) What is it about the UI system that generates these opposing views? UI payments (made by firms) depend on the firm’s record of layoffs. The more layoffs in a firm’s recent past, the greater the firm’s UI payments will be. Thus, if a firm has had recent layoffs during a recession, it will have to pay more in taxes to the government. Worse, however, is that firms may be more reluctant during contractions, compared to when the economic outlook is good, to hire workers who may increase its profits if the economy continues to recover but would lower profits if the economy got even worse. The problem is that the firm doesn’t want to hire workers only to fire them if the economy doesn’t continue to improve as this places a further burden on the firm whose UI obligations will increase following the firing. (b) How could the UI system be changed to also assist firms during economic contractions while not removing the benefits available to laid off workers? UI payments could be linked to a longer firm history of layoffs. Firms could also be given credit for new workers hired during a recession. 12-15. Consider the standard job search model as described in the text. (a) Why are the asking wage and expected unemployment duration positively related? Expected unemployment duration is positively related to the asking wage, because the higher is the asking wage, the less likely it is to be offered a job that one accepts (because the wage associated with the offer exceeds the asking wage). (b) Can the standard job search model explain why unemployment duration is longer, on average, for secondary workers when compared to primary workers? Discuss. 124 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Yes. The asking wage is likely lower for primary workers than it is for secondary workers. By definition, secondary workers have other options—stay at home, go back to school, lounge around, volunteer, and so on. As secondary workers do not need a job, they have the luxury of setting a high asking wage. Alternatively, primary workers need to have a job to support the household. Thus, although primary workers would like a well-paying job, they may find themselves setting a low asking wage because the household needs money coming in. If this description is true, the data should show that primary workers experience shorter spells of unemployment, on average, than secondary workers (assuming secondary workers are classified as being unemployed). (c) In the context of the standard search model, explain how the economy-wide average asking wage and unemployment duration are affected by an expanded underground (cash) economy. What is the effect on the equilibrium unemployment rate? The underground economy provides an income to people who otherwise appear to be unemployed (or at least jobless). This outside option of working in the underground economy raises the asking wage just as increased unemployment benefits increase the asking wage, and therefore the existence of an expanded underground economy, via higher asking wages, will increase the average unemployment duration. Assuming people who operate in the underground economy are not employed elsewhere and report to the government as being unemployed, then an expanded underground economy raises the equilibrium unemployment rate.
DATA EXPLORER: R FILES (both Base R and Tidyverse R) Chapter 1, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 1 Base.log") ################################################# # CHAPTER 1. THE RETURNS TO A COLLEGE EDUCATION ################################################# data <- read.csv("C:/Projects/Data Explorer/data/cps_00001.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-30 data <- data[which((data$age >= 21) & (data$age <= 30)), ] # STARTS SAMPLE IN 1964 data <- data[which(data$year >= 1964), ] # EXCLUDES INVALID VALUES OF ANNUAL EARNINGS data <- data[which((data$incwage > 0) & (data$incwage < 99999998)), ] # DEFINES LOG ANNUAL EARNINGS data$lannual <- log(data$incwage)
125 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# INDICATOR FOR A COLLEGE EDUCATION # SAMPLE CONSISTS OF PERSONS WITH HIGH SCHOOL OR COLLEGE EDUCATION data <- data[which(((data$educ >= 70) & (data$educ <= 73)) | ((data$educ == 110) | (data$educ == 111))), ] data$college <- (data$educ > 73) table(data$educ, data$college) # GETS RID OF PERSONS WITH NEGATIVE WEIGHTS data$asecwt[which(data$asecwt < 0)] <- 0 data$lannual_weighted <- data$lannual * data$asecwt data_means <- aggregate(cbind(lannual_weighted, asecwt) ~ year + college, data = data, FUN = sum) data_means$lannual_mean <- data_means$lannual_weighted / data_means$asecwt data_means <- data_means[, c("year", "college", "lannual_mean")] data_means <- reshape(data_means, direction = "wide", idvar = "year", timevar = "college") data_means$diff <- data_means$lannual_mean.TRUE data_means$lannual_mean.FALSE data_means[, c("year", "lannual_mean.FALSE", "lannual_mean.TRUE")] # BASIC GRAPH plot (data_means$year, data_means$diff) # LABELED GRAPH plot(data_means$year, data_means$diff, type = "o", main = "The Relative Wage of Young College Graduates", ylab = "Log Wage Gap", xlab = "Year", xlim = c(1960, 2022), ylim = c(0.1, 0.6)) graph <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 1-1 Base.pdf") print(graph) dev.off() sink()
Chapter 1, Tidyverse sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 1 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ################################################# # CHAPTER 1. THE RETURNS TO A COLLEGE EDUCATION ################################################# data <- read_csv("C:/Projects/Data Explorer/data/cps_00001.csv")
126 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-30 # STARTS SAMPLE IN 1964 # EXCLUDES INVALID VALUES OF ANNUAL EARNINGS # DEFINES LOG ANNUAL EARNINGS # INDICATOR FOR A COLLEGE EDUCATION # SAMPLE CONSISTS OF PERSONS WITH HIGH SCHOOL OR COLLEGE EDUCATION data <- data %>% filter((age >= 21) & (age <= 30), year >= 1964, (incwage > 0) & (incwage < 99999998)) %>% mutate(lannual = log(incwage)) %>% filter(((educ >= 70) & (educ <= 73)) | ((educ == 110) | (educ ==111))) %>% mutate(college = if_else(educ > 73, 1, 0)) data %>% group_by(educ) %>% summarize(college = sum(college), n = n()) # GETS RID OF PERSONS WITH NEGATIVE WEIGHTS data <- data %>% mutate(asecwt = if_else(asecwt < 0, 0, asecwt)) data_means <- data %>% group_by(year, college) %>% summarize(lannual_mean = weighted.mean(lannual, w = asecwt, na.rm = TRUE)) %>% pivot_wider(id_cols = "year", names_from = "college", names_prefix = "lannual_mean_", values_from = "lannual_mean") %>% mutate(diff = lannual_mean_1 - lannual_mean_0) options(pillar.sigfig = 8) data_means %>% select(year, lannual_mean_0, lannual_mean_1) # BASIC GRAPH ggplot(data_means, aes(x = year, y = diff)) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means, aes(x = year, y = diff)) + geom_point() + geom_line() + labs(title = "The Relative Wage of Young College Graduates", x = "Year", y = "Log Wage Gap") + scale_x_continuous(limits = c(1960, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + scale_y_continuous(limits = c(0.09, 0.6), 127 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
breaks = seq(from = 0.1, to = 0.6, by = 0.1)) + theme(plot.title = element_text(hjust = 0.5)) ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 1-1 Tidyverse.pdf") sink()
Chapter 2, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 2 Base.log") ################################################# # CHAPTER 2. FERTILITY AND LABOR SUPPLY ################################################# data <- read.csv("C:/Projects/Data Explorer/data/cps_00002.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 20-50 data <- data[which((data$age >= 20) & (data$age <= 50)), ] # STARTS SAMPLE IN 1968 data <- data[which(data$year >= 1968), ] # LABOR FORCE STATUS INDICATOR # PERSONS IN ARMED FORCES ARE NOT IN UNIVERSE, THEY ARE EXCLUDED data <- data[which(data$labforce != 0), ] data$lfp <- (data$labforce == 2) # YOUNG CHILDREN PRESENT data$child <- (data$nchlt5 >= 1) # RECODES NEGATIVE SAMPLE WEIGHTS TO ZERO data$asecwt[which(data$asecwt < 0)] <- 0 data$lfp_weighted <- data$lfp * data$asecwt ############# EXERCISE 1 data_means_1 <- aggregate(cbind(lfp_weighted, asecwt) ~ year + sex, data = data, FUN = sum) data_means_1$lfp_mean <- data_means_1$lfp_weighted / data_means_1$asecwt data_means_1 <- data_means_1[, c("year", "sex", "lfp_mean")] data_means_1 <- reshape(data_means_1, direction = "wide", idvar = "year", timevar = "sex") # LABELED GRAPH plot(data_means_1$year, data_means_1$lfp_mean.1, type = "o", pch = 19, main = "Labor Force Participation of Men and Women", ylab = "Participation Rate",
128 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
xlab = "Year", xlim = c(1968, 2022), ylim = c(0.45, 0.95), col = "blue") lines(data_means_1$year, data_means_1$lfp_mean.2, type = "o", pch = 19, col = "red") legend("bottom", legend = c("Men", "Women"), col = c("blue", "red"), lty = c(1, 1)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 2-1 Base.pdf") print(graph_1) dev.off() ############# EXERCISE 2 data_means_2 <- aggregate(cbind(lfp_weighted, asecwt) ~ year + child, data = data[which(data$sex == 2), ], FUN = sum) data_means_2$lfp_mean <- data_means_2$lfp_weighted / data_means_2$asecwt data_means_2 <- data_means_2[, c("year", "child", "lfp_mean")] data_means_2 <- reshape(data_means_2, direction = "wide", idvar = "year", timevar = "child") # LABELED GRAPH plot(data_means_2$year, data_means_2$lfp_mean.FALSE, type = "o", pch = 19, main = "LFPR of Women and Presence of Young Children", ylab = "Participation Rate", xlab = "Year", xlim = c(1968, 2022), ylim = c(0.25, 0.85), col = "blue") lines(data_means_2$year, data_means_2$lfp_mean.TRUE, type = "o", pch = 19, col = "red") legend("bottom", legend = c("No Children", "With Children"), col = c("blue", "red"), lty = c(1, 1)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 2-2 Base.pdf") print(graph_2) dev.off() ############# EXERCISE 3 data_means_3 <- aggregate(cbind(lfp_weighted, asecwt) ~ year + child, data = data[which(data$sex == 1), ], FUN = sum) data_means_3$lfp_mean <- data_means_3$lfp_weighted / data_means_3$asecwt data_means_3 <- data_means_3[, c("year", "child", "lfp_mean")] data_means_3 <- reshape(data_means_3, direction = "wide", idvar = "year", timevar = "child") # LABELED GRAPH plot(data_means_3$year, data_means_3$lfp_mean.FALSE, type = "o", pch = 19, 129 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
main = "LFPR of Men and Presence of Young Children", ylab = "Participation Rate", xlab = "Year", xlim = c(1968, 2022), ylim = c(0.8, 1), col = "blue") lines(data_means_3$year, data_means_3$lfp_mean.TRUE, type = "o", pch = 19, col = "red") legend("bottom", legend = c("No Children", "With Children"), col = c("blue", "red"), lty = c(1, 1)) graph_3 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 2-3 Base.pdf") print(graph_3) dev.off() sink()
Chapter 2, Tidyverse sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 2 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ################################################# # CHAPTER 2. FERTILITY AND LABOR SUPPLY ################################################# data <- read_csv("C:/Projects/Data Explorer/data/cps_00002.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 20-50 # STARTS SAMPLE IN 1968 # LABOR FORCE STATUS INDICATOR # PERSONS IN ARMED FORCES ARE NOT IN UNIVERSE, THEY ARE EXCLUDED # YOUNG CHILDREN PRESENT # RECODES NEGATIVE SAMPLE WEIGHTS TO ZERO data <- data %>% filter((age >= 20) & (age <= 50), year >= 1968, labforce != 0) %>% mutate(lfp = if_else(labforce == 2, 1, 0), child = if_else(nchlt5 >= 1, 1, 0), asecwt = if_else(asecwt < 0, 0, asecwt)) ############# EXERCISE 1 data_means_1 <- data %>% group_by(year, sex) %>% summarize(lfp_mean = weighted.mean(lfp, w = asecwt, na.rm = TRUE)) # BASIC GRAPH
130 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
ggplot(data_means_1, aes(x = year, y = lfp_mean, color = factor(sex))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_1, aes(x = year, y = lfp_mean, color = factor(sex))) + geom_point() + geom_line() + labs(title = "Labor Force Participation Rates of Men and Women", x = "Year", y = "Participation Rate") + scale_x_continuous(limits = c(1968, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + scale_y_continuous(limits = c(0.48, 0.95), breaks = seq(from = 0.4, to = 1.0, by = 0.1)) + scale_color_discrete(labels = c("Men", "Women"), type = c("blue", "red"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 2-1 Tidyverse.pdf") ############# EXERCISE 2 data_means_2 <- data %>% filter(sex == 2) %>% group_by(year, child) %>% summarize(lfp_mean = weighted.mean(lfp, w = asecwt, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_2, aes(x = year, y = lfp_mean, color = factor(child))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_2, aes(x = year, y = lfp_mean, color = factor(child))) + geom_point() + geom_line() + labs(title = "LFPR of Women and Presence of Young Children", x = "Year", y = "Participation Rate") + scale_x_continuous(limits = c(1968, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + scale_y_continuous(limits = c(0.25, 0.85), breaks = seq(from = 0.3, to = 0.8, by = 0.1)) + scale_color_discrete(labels = c("No Children", "With Children"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 2-2 Tidyverse.pdf") 131 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
############# EXERCISE 3 data_means_3 <- data %>% filter(sex == 1) %>% group_by(year, child) %>% summarize(lfp_mean = weighted.mean(lfp, w = asecwt, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_3, aes(x = year, y = lfp_mean, color = factor(child))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_3, aes(x = year, y = lfp_mean, color = factor(child))) + geom_point() + geom_line() + labs(title = "LFPR of Men and Presence of Young Children", x = "Year", y = "Participation Rate") + scale_x_continuous(limits = c(1968, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + scale_y_continuous(limits = c(0.8, 1), breaks = seq(from = 0.8, to = 1, by = 0.05)) + scale_color_discrete(labels = c("No Children", "With Children"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 2-3 Tidyverse.pdf") sink()
Chapter 3, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 3 Base.log") ################################################# # CHAPTER 3. DEMOGRAPHICS OF LOW-WAGE WORKFORCE ################################################# data <- read.csv("C:/Projects/Data Explorer/data/cps_00003.csv") colnames(data) <- tolower(colnames(data)) # KEEPS PERSONS AGED 16-69 data <- data[which((data$age >= 16) & (data$age <= 69)), ] # KEEPS 2021 SURVEY data <- data[which(data$year == 2021), ] # EXCLUDES PERSONS NOT IN ORG data <- data[which((data$paidhour == 1) | (data$paidhour == 2)), ]
132 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# RACE RECODE: 1=white, 2=black, 3=asian, 4=hisp, and 5 is everything else data$racetype <- 1 * ((data$race == 100) & (data$hispan == 0)) + 2 * ((data$race == 200) & (data$hispan == 0)) + 3 * ((data$race == 651) & (data$hispan == 0)) + 4 * (data$hispan > 0) data$racetype[which(data$racetype == 0)] <- 5 # EDUCATION RECODE data$eductype <- 1 * (data$educ <= 60) + 2 * ((data$educ >= 70) & (data$educ <= 73)) + 3 * ((data$educ >= 80) & (data$educ <= 100)) + 4 * (data$educ >= 110) # DEFINE HOURLY WAGE RATE FOR ALL WORKERS, NOT JUST THOSE PAID BY HOUR data$hourlywage <- NA index <- which((data$earnweek > 0) & (data$earnweek < 9999.99) & (data$uhrswork1 > 0) & (data$uhrswork1 < 997) & (data$paidhour == 1)) data$hourlywage[index] <- data$earnweek[index] / data$uhrswork1[index] index <- which((data$hourwage > 0) & (data$hourwage < 99) & (data$paidhour == 2)) data$hourlywage[index] <- data$hourwage[index] data$low <- (data$hourlywage < 15) data$hourlywage_weighted <- data$hourlywage * data$earnwt data$n <- 1 data_means_0 <- aggregate(cbind(hourlywage_weighted, earnwt, n) ~ paidhour, data = data, FUN = sum) data_means_0$hourlywage_mean <- data_means_0$hourlywage_weighted / data_means_0$earnwt data_means_0 <- data_means_0[, c("paidhour", "hourlywage_mean", "earnwt", "n")] data_means_0 data$low_weighted <- data$low * data$earnwt ############# EXERCISE 1 data_means_1 <- aggregate(cbind(low_weighted, earnwt) ~ age + sex, data = data, FUN = sum) data_means_1$low_mean <- data_means_1$low_weighted / data_means_1$earnwt data_means_1 <- data_means_1[, c("age", "sex", "low_mean")] data_means_1 <- reshape(data_means_1, direction = "wide", idvar = "age", timevar = "sex") # LABELED GRAPH plot(data_means_1$age, data_means_1$low_mean.1, type = "o", pch = 19, main = "Workers in Low-Wage Workforce, by Gender", ylab = "Fraction", xlab = "Age", 133 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
xlim = c(15, 70), ylim = c(0, 1), col = "blue") lines(data_means_1$age, data_means_1$low_mean.2, type = "o", pch = 19, col = "red") legend("top", legend = c("Men", "Women"), col = c("blue", "red"), lty = c(1, 1)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 3-1 Base.pdf") print(graph_1) dev.off() ############# EXERCISE 2 data_means_2 <- aggregate(cbind(low_weighted, earnwt) ~ age + racetype, data = data, FUN = sum) data_means_2$low_mean <- data_means_2$low_weighted / data_means_2$earnwt data_means_2 <- data_means_2[, c("age", "racetype", "low_mean")] data_means_2 <- reshape(data_means_2, direction = "wide", idvar = "age", timevar = "racetype") # LABELED GRAPH plot(data_means_2$age, data_means_2$low_mean.1, type = "o", pch = 19, main = "Workers in Low-Wage Workforce, by Race", ylab = "Fraction", xlab = "Age", xlim = c(15, 70), ylim = c(0, 1), col = "blue") lines(data_means_2$age, data_means_2$low_mean.2, type = "o", pch = 19, col = "black") lines(data_means_2$age, data_means_2$low_mean.3, type = "o", pch = 19, col = "darkgreen") lines(data_means_2$age, data_means_2$low_mean.4, type = "o", pch = 19, col = "red") legend("top", legend = c("White", "Black", "Asian", "Hispanic"), col = c("blue", "black", "darkgreen", "red"), lty = c(1, 1)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 3-2 Base.pdf") print(graph_2) dev.off() ############# EXERCISE 3 data_means_3 <- aggregate(cbind(low_weighted, earnwt) ~ age + eductype, data = data, FUN = sum) data_means_3$low_mean <- data_means_3$low_weighted / data_means_3$earnwt data_means_3 <- data_means_3[, c("age", "eductype", "low_mean")] data_means_3 <- reshape(data_means_3, direction = "wide", 134 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
idvar = "age", timevar = "eductype") # LABELED GRAPH plot(data_means_3$age, data_means_3$low_mean.1, type = "o", pch = 19, main = "Workers in Low-Wage Workforce, by Education", ylab = "Fraction", xlab = "Age", xlim = c(15, 70), ylim = c(0, 1), col = "blue") lines(data_means_3$age, data_means_3$low_mean.2, type = "o", pch = 19, col = "black") lines(data_means_3$age, data_means_3$low_mean.3, type = "o", pch = 19, col = "darkgreen") lines(data_means_3$age, data_means_3$low_mean.4, type = "o", pch = 19, col = "red") legend("top", legend = c("Less than High School", "High School", "Some College", "College"), col = c("blue", "black", "darkgreen", "red"), lty = c(1, 1)) graph_3 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 3-3 Base.pdf") print(graph_3) dev.off() sink()
Chapter 3, Tidyverse sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 3 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ################################################# # CHAPTER 3. DEMOGRAPHICS OF LOW-WAGE WORKFORCE ################################################# data <- read_csv("C:/Projects/Data Explorer/data/cps_00003.csv") colnames(data) <- tolower(colnames(data)) # KEEPS PERSONS AGED 16-69 # KEEPS 2021 SURVEY # EXCLUDES PERSONS NOT IN ORG # RACE RECODE: 1=white, 2=black, 3=asian, 4=hisp, and 5 is everything else # EDUCATION RECODE data <- data %>% filter((age >= 16) & (age <= 69), year == 2021, (paidhour == 1) | (paidhour == 2)) %>% mutate(racetype = 1 * ((race == 100) & (hispan == 0)) + 2 * ((race == 200) & (hispan == 0)) + 3 * ((race == 651) & (hispan == 0)) +
135 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
4 * (hispan > 0), racetype = if_else(racetype == 0, 5, racetype), eductype = 1 * (educ <= 60) + 2 * ((educ >= 70) & (educ <= 73)) + 3 * ((educ >= 80) & (educ <= 100)) + 4 * (educ >= 110)) # DEFINE HOURLY WAGE RATE FOR ALL WORKERS, NOT JUST THOSE PAID BY HOUR data <- data %>% mutate( hourlywage = case_when( (earnweek > 0) & (earnweek < 9999.99) & (uhrswork1 > 0) & (uhrswork1 < 997) & (paidhour == 1) ~ earnweek / uhrswork1, (hourwage > 0) & (hourwage < 99) & (paidhour == 2) ~ hourwage, TRUE ~ NA_real_), low = if_else(hourlywage < 15, 1, 0)) data %>% select(paidhour, hourlywage, earnwt) %>% na.omit() %>% group_by(paidhour) %>% mutate(hourlywage_mean = weighted.mean(hourlywage, w = earnwt), freq = sum(earnwt), n = n()) %>% distinct(hourlywage_mean, freq, n) %>% relocate(paidhour, hourlywage_mean, freq, n) ############# EXERCISE 1 data_means_1 <- data %>% group_by(age, sex) %>% summarize(low_mean = weighted.mean(low, w = earnwt, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_1, aes(x = age, y = low_mean, color = factor(sex))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_1, aes(x = age, y = low_mean, color = factor(sex))) + geom_point() + geom_line() + labs(title = "Workers in Low-Wage Workforce, by Gender", x = "Age", y = "Fraction") + scale_x_continuous(limits = c(15, 70), breaks = seq(from = 20, to = 70, by = 10)) + scale_y_continuous(limits = c(0, 1), breaks = seq(from = 0, to = 1, by = 0.2)) + scale_color_discrete(labels = c("Men", "Women"), type = c("blue", "red"), name = "") + theme(plot.title = element_text(hjust = 0.5), 136 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 3-1 Tidyverse.pdf") ############# EXERCISE 2 data_means_2 <- data %>% filter(racetype != 5) %>% group_by(age, racetype) %>% summarize(low_mean = weighted.mean(low, w = earnwt, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_2, aes(x = age, y = low_mean, color = factor(racetype))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_2, aes(x = age, y = low_mean, color = factor(racetype))) + geom_point() + geom_line() + labs(title = "Workers in Low-Wage Workforce, by Race", x = "Age", y = "Fraction") + scale_x_continuous(limits = c(15, 70), breaks = seq(from = 20, to = 70, by = 10)) + scale_y_continuous(limits = c(0, 1), breaks = seq(from = 0, to = 1, by = 0.2)) + scale_color_discrete(labels = c("White", "Black", "Asian", "Hispanic"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 3-2 Tidyverse.pdf") ############# EXERCISE 3 data_means_3 <- data %>% group_by(age, eductype) %>% summarize(low_mean = weighted.mean(low, w = earnwt, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_3, aes(x = age, y = low_mean, color = factor(eductype))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_3, aes(x = age, y = low_mean, color = factor(eductype))) + geom_point() + 137 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
geom_line() + labs(title = "Workers in Low-Wage Workforce, by Education", x = "Age", y = "Fraction") + scale_x_continuous(limits = c(15, 70), breaks = seq(from = 20, to = 70, by = 10)) + scale_y_continuous(limits = c(0, 1), breaks = seq(from = 0, to = 1, by = 0.2)) + scale_color_discrete(labels = c("Less than High School", "High School", "Some College", "College"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 3-3 Tidyverse.pdf") sink()
Chapter 4, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 4 Base.log") ##################################################################### # CHAPTER 4. DEMOGRAPHICS DIFFERENCES IN THE IMPACT OF THE PANDEMIC ##################################################################### data <- read.csv("C:/Projects/Data Explorer/data/cps_00004.csv") colnames(data) <- tolower(colnames(data)) # KEEPS PERIOD SINCE 2018 data <- data[which(data$year >= 2018), ] # KEEPS PERSONS AGED 16-64 data <- data[which((data$age >= 18) & (data$age <= 64)), ] # KEEP THOSE NOT IN ARMED FORCES + VALID EMPSTAT data <- data[which(data$empstat >= 10), ] # EMPLOYMENT INDICATOR data$work <- (data$empstat == 10) # RACE RECODE: 1=white, 2=black, 3=asian, 4=hisp, and 5 is everything else data$racetype <- 1 * ((data$race == 100) & (data$hispan == 0)) + 2 * ((data$race == 200) & (data$hispan == 0)) + 3 * ((data$race == 651) & (data$hispan == 0)) + 4 * (data$hispan > 0) data$racetype[which(data$racetype == 0)] <- 5 # EDUCATION RECODE data$eductype <- 1 * (data$educ <= 60) + 2 * ((data$educ >= 70) & (data$educ <= 73)) +
138 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
3 * ((data$educ >= 80) & (data$educ <= 100)) + 4 * (data$educ >= 110) # DEFINE TIME INDICATOR IN TERMS OF YEAR-MONTH data$time <- data$year + (data$month - 1) / 12 as.data.frame(table(data$time))[, , drop = FALSE] # ORG LOG WEEKLY EARNINGS data$lweekly <- NA index <- which((data$earnweek > 0) & (data$earnweek < 9999.99)) data$lweekly[index] <- log(data$earnweek[index]) data$work_weighted <- data$work * data$wtfinl ############# EXERCISE 1 data_means_1 <- aggregate(cbind(work_weighted, wtfinl) ~ time, data = data, FUN = sum) data_means_1$work_mean <- data_means_1$work_weighted / data_means_1$wtfinl data_means_1 <- data_means_1[, c("time", "work_mean")] # BASIC GRAPH plot(data_means_1$time, data_means_1$work_mean, type = "o") # LABELED GRAPH plot(data_means_1$time, data_means_1$work_mean, type = "o", pch = 19, main = "Trends in Employment-Population Ratio", ylab = "Ratio", xlab = "Year", xlim = c(2018, 2023), ylim = c(0.55, 0.75)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 4-1 Base.pdf") print(graph_1) dev.off() ############# EXERCISE 2 data_means_2 <- aggregate(cbind(work_weighted, wtfinl) ~ time + sex, data = data, FUN = sum) data_means_2$work_mean <- data_means_2$work_weighted / data_means_2$wtfinl data_means_2 <- data_means_2[, c("time", "sex", "work_mean")] data_means_2 <- reshape(data_means_2, direction = "wide", idvar = "time", timevar = "sex") # LABELED GRAPH plot(data_means_2$time, data_means_2$work_mean.1, type = "o", pch = 19, main = "Trends in Employment-Population Ratio, by Gender", ylab = "Ratio", xlab = "Year", xlim = c(2018, 2023), ylim = c(0.5, 0.8), col = "blue") lines(data_means_2$time, data_means_2$work_mean.2, type = "o", pch = 19, 139 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
col = "red") legend("bottomright", legend = c("Men", "Women"), col = c("blue", "red"), lty = c(1, 1)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 4-2 Base.pdf") print(graph_2) dev.off() ############# EXERCISE 3 data_means_3 <- aggregate(cbind(work_weighted, wtfinl) ~ time + racetype, data = data, FUN = sum) data_means_3$work_mean <- data_means_3$work_weighted / data_means_3$wtfinl data_means_3 <- data_means_3[, c("time", "racetype", "work_mean")] data_means_3 <- reshape(data_means_3, direction = "wide", idvar = "time", timevar = "racetype") # LABELED GRAPH plot(data_means_3$time, data_means_3$work_mean.1, type = "o", pch = 19, main = "Trends in Employment-Population Ratio, by Race", ylab = "Ratio", xlab = "Year", xlim = c(2018, 2023), ylim = c(0.5, 0.75), col = "blue") lines(data_means_3$time, data_means_3$work_mean.2, type = "o", pch = 19, col = "black") lines(data_means_3$time, data_means_3$work_mean.3, type = "o", pch = 19, col = "darkgreen") lines(data_means_3$time, data_means_3$work_mean.4, type = "o", pch = 19, col = "red") legend("bottomright", legend = c("White", "Black", "Asian", "Hispanic"), col = c("blue", "black", "darkgreen", "red"), lty = c(1, 1)) graph_3 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 4-3 Base.pdf") print(graph_3) dev.off() ############# EXERCISE 4 data_means_4 <- aggregate(cbind(work_weighted, wtfinl) ~ time + eductype, data = data, FUN = sum) data_means_4$work_mean <- data_means_4$work_weighted / data_means_4$wtfinl data_means_4 <- data_means_4[, c("time", "eductype", "work_mean")] data_means_4 <- reshape(data_means_4, direction = "wide", idvar = "time", timevar = "eductype") # LABELED GRAPH plot(data_means_4$time, data_means_4$work_mean.1, type = "o", pch = 19, 140 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
main = "Trends in Employment-Population Ratio, by Education", ylab = "Ratio", xlab = "Year", xlim = c(2018, 2023), ylim = c(0.3, 0.85), col = "blue") lines(data_means_4$time, data_means_4$work_mean.2, type = "o", pch = 19, col = "black") lines(data_means_4$time, data_means_4$work_mean.3, type = "o", pch = 19, col = "darkgreen") lines(data_means_4$time, data_means_4$work_mean.4, type = "o", pch = 19, col = "red") legend("bottomright", legend = c("Less than High School", "High School", "Some College", "College"), col = c("blue", "black", "darkgreen", "red"), lty = c(1, 1)) graph_4 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 4-4 Base.pdf") print(graph_4) dev.off() ############# EXERCISE 5 data$lweekly_weighted <- data$lweekly * data$earnwt data_means_5 <- aggregate(cbind(lweekly_weighted, earnwt) ~ time, data = data, FUN = sum) data_means_5$lweekly_mean <- data_means_5$lweekly_weighted / data_means_5$earnwt data_means_5 <- data_means_5[, c("time", "lweekly_mean")] # BASIC GRAPH plot(data_means_5$time, data_means_5$lweekly_mean, type = "o") # LABELED GRAPH plot(data_means_5$time, data_means_5$lweekly_mean, type = "o", pch = 19, main = "Trend in Log Weekly Earnings", ylab = "Log Weekly Earnings", xlab = "Year", xlim = c(2018, 2023), ylim = c(6.575, 6.875)) graph_5 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 4-5 Base.pdf") print(graph_5) dev.off() sink()
Chapter 4, Tidyverse sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 4 Tidyverse.log") library(tidyverse)
141 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
options(dplyr.print_max = 1e9) #################################################################### # CHAPTER 4. DEMOGRAPHICS DIFFERENCES IN THE IMPACT OF THE PANDEMIC #################################################################### data <- read_csv("C:/Projects/Data Explorer/data/cps_00004.csv") colnames(data) <- tolower(colnames(data)) # KEEPS PERIOD SINCE 2018 # KEEPS PERSONS AGED 18-64 # KEEP THOSE NOT IN ARMED FORCES + VALID EMPSTAT # EMPLOYMENT INDICATOR # RACE RECODE: 1=white, 2=black, 3=asian, 4=hisp, and 5 is everything else # EDUCATION RECODE # DEFINE TIME INDICATOR IN TERMS OF YEAR-MONTH # ORG LOG WEEKLY EARNINGS data <- data %>% filter(year >= 2018, (age >= 18) & (age <= 64), empstat >= 10) %>% mutate(work = if_else(empstat == 10, 1, 0), racetype = 1 * ((race == 100) & (hispan == 0)) + 2 * ((race == 200) & (hispan == 0)) + 3 * ((race == 651) & (hispan == 0)) + 4 * (hispan > 0), racetype = if_else(racetype == 0, 5, racetype), eductype = 1 * (educ <= 60) + 2 * ((educ >= 70) & (educ <= 73)) + 3 * ((educ >= 80) & (educ <= 100)) + 4 * (educ >= 110), time = year + (month - 1) / 12, lweekly = if_else((earnweek > 0) & (earnweek < 9999.99), log(earnweek), NA_real_)) data %>% count(time) ############# EXERCISE 1 data_means_1 <- data %>% group_by(time) %>% summarize(work_mean = weighted.mean(work, w = wtfinl, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_1, aes(x = time, y = work_mean)) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_1, aes(x = time, y = work_mean)) + geom_point() + geom_line() + labs(title = "Trends in Employment-Population Ratio", 142 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
x = "Year", y = "Ratio") + scale_x_continuous(limits = c(2018, 2023), breaks = seq(from = 2018, to = 2023, by = 1), minor_breaks = seq(from = 2018, to = 2023, by = 1/12)) + scale_y_continuous(limits = c(0.55, 0.75), breaks = seq(from = 0.55, to = 0.75, by = 0.05)) + theme(plot.title = element_text(hjust = 0.5)) ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 4-1 Tidyverse.pdf") ############# EXERCISE 2 data_means_2 <- data %>% group_by(time, sex) %>% summarize(work_mean = weighted.mean(work, w = wtfinl, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_2, aes(x = time, y = work_mean, color = factor(sex))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_2, aes(x = time, y = work_mean, color = factor(sex))) + geom_point() + geom_line() + labs(title = "Trends in Employment-Population Ratio, by Gender", x = "Year", y = "Ratio") + scale_x_continuous(limits = c(2018, 2023), breaks = seq(from = 2018, to = 2023, by = 1), minor_breaks = seq(from = 2018, to = 2023, by = 1/12)) + scale_y_continuous(limits = c(0.5, 0.8), breaks = seq(from = 0.5, to = 0.8, by = 0.1)) + scale_color_discrete(labels = c("Men", "Women"), type = c("blue", "red"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 4-2 Tidyverse.pdf") ############# EXERCISE 3 data_means_3 <- data %>% filter(racetype != 5) %>% group_by(time, racetype) %>% summarize(work_mean = weighted.mean(work, w = wtfinl, na.rm = TRUE)) # BASIC GRAPH
143 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
ggplot(data_means_3, aes(x = time, y = work_mean, color = factor(racetype))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_3, aes(x = time, y = work_mean, color = factor(racetype))) + geom_point() + geom_line() + labs(title = "Trends in Employment-Population Ratio, by Race", x = "Year", y = "Ratio") + scale_x_continuous(limits = c(2018, 2023), breaks = seq(from = 2018, to = 2023, by = 1), minor_breaks = seq(from = 2018, to = 2023, by = 1/12)) + scale_y_continuous(limits = c(0.5, 0.75), breaks = seq(from = 0.5, to = 0.75, by = 0.05)) + scale_color_discrete(labels = c("White", "Black", "Asian", "Hispanic"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 4-3 Tidyverse.pdf") ############# EXERCISE 4 data_means_4 <- data %>% group_by(time, eductype) %>% summarize(work_mean = weighted.mean(work, w = wtfinl, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_4, aes(x = time, y = work_mean, color = factor(eductype))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_4, aes(x = time, y = work_mean, color = factor(eductype))) + geom_point() + geom_line() + labs(title = "Trends in Employment-Population Ratio, by Education", x = "Year", y = "Ratio") + scale_x_continuous(limits = c(2018, 2023), breaks = seq(from = 2018, to = 2023, by = 1), minor_breaks = seq(from = 2018, to = 2023, by = 1/12)) + scale_y_continuous(limits = c(0.3, 0.85), breaks = seq(from = 0.3, to = 0.8, by = 0.1)) + scale_color_discrete(labels = c("Less than High School", 144 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
"High School", "Some College", "College"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 4-4 Tidyverse.pdf") ############# EXERCISE 5 data_means_5 <- data %>% group_by(time) %>% summarize(lweekly_mean = weighted.mean(lweekly, w = earnwt, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means_5, aes(x = time, y = lweekly_mean)) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_5, aes(x = time, y = lweekly_mean)) + geom_point() + geom_line() + labs(title = "Trend in Log Weekly Earnings", x = "Year", y = "Log Weekly Earnings") + scale_x_continuous(limits = c(2018, 2023), breaks = seq(from = 2018, to = 2023, by = 1), minor_breaks = seq(from = 2018, to = 2023, by = 1/12)) + scale_y_continuous(limits = c(6.575, 6.875), breaks = seq(from = 6.6, to = 6.85, by = 0.05)) + theme(plot.title = element_text(hjust = 0.5)) ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 4-5 Tidyverse.pdf") sink()
Chapter 5, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 5 Base.log") ############################################################# # CHAPTER 5. COMPENSATING DIFFERENTIALS AND THE NIGHT SHIFT ############################################################# data <- read.csv("C:/Projects/Data Explorer/data/cps_00005.csv") colnames(data) <- tolower(colnames(data)) # KEEPS PERSONS AGED 16-64
145 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
data <- data[which((data$age >= 16) & (data$age <= 64)), ] # EXCLUDES PERSONS NOT IN ORG data <- data[which((data$paidhour == 1) | (data$paidhour == 2)), ] # EDUCATION RECODE data$eductype <- 1 * (data$educ <= 60) + 2 * ((data$educ >= 70) & (data$educ <= 73)) + 3 * ((data$educ >= 80) & (data$educ <= 100)) + 4 * (data$educ >= 110) table(data$educ, data$eductype) # DEFINE HOURLY WAGE RATE FOR ALL WORKERS, NOT JUST THOSE PAID BY HOUR data$hourlywage <- NA index <- which((data$earnweek > 0) & (data$earnweek < 9999.99) & (data$uhrswork1 > 0) & (data$uhrswork1 < 997) & (data$paidhour == 1)) data$hourlywage[index] <- data$earnweek[index] / data$uhrswork1[index] index <- which((data$hourwage > 0) & (data$hourwage < 99) & (data$paidhour == 2)) data$hourlywage[index] <- data$hourwage[index] data$lhourly = log(data$hourlywage) data <- data[which(!is.na(data$lhourly)), ] # FUNCTION TO TABULATE / SUMMARIZE BY GROUP, WITH WEIGHTS summarize_by_group <- function(data, variable_group, variable_values, wt) { data$n <- 1 # BY GROUP data_group <- data[ , c(variable_group, variable_values, wt, "n")] names(data_group) <- c("var_group", "var_values", "var_wt", "n") data_group$var_group <- factor(data_group$var_group) data_group$var_values_weighted <- data_group$var_values * data_group$var_wt data_group <- aggregate(x = data_group[ , c("var_values_weighted", "var_wt", "n")], by = list(data_group$var_group), FUN = sum) data_group$var_mean <- data_group$var_values_weighted / data_group$var_wt data_group <- data_group[ , c("Group.1", "var_mean", "var_wt", "n")] data_group$Group.1 <- as.character(data_group$Group.1) # TOTAL data_total <- na.omit(data[ , c(variable_values, wt, "n")]) names(data_total) <- c("var_values", "var_wt", "n") data_total <- cbind.data.frame("Group.1" = "Total", "var_mean" = weighted.mean(data_total$var_values, 146 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
w = data_total$var_wt), "var_wt" = sum(data_total$var_wt), "n" = sum(data_total$n)) out <- rbind.data.frame(data_group, data_total) names(out) <- c(variable_group, "mean", "freq", "n") return(out) } summarize_by_group(data, "paidhour", "hourlywage", wt = "earnwt") # DROPS PERSONS WHO DO NOT REPORT SHIFT data <- data[which(data$wsregshft <= 2), ] # GROUPS WORKERS INTO AGE GROUPS data$agetype <- NA data$agetype[which((data$age >= 16) & (data$age <= 20))] <- 1 data$agetype[which((data$age >= 21) & (data$age <= 30))] <- 2 data$agetype[which((data$age >= 31) & (data$age <= 40))] <- 3 data$agetype[which((data$age >= 41) & (data$age <= 50))] <- 4 data$agetype[which((data$age >= 51) & (data$age <= 64))] <- 5 # CREATES VARIABLE INDICATING PERSON DOES NOT WORK REGULAR DAY SHIFT data$irregular <- (data$wsregshft == 1) # SELECTS 4 OCCUPATIONS WITH LARGE SAMPLES AND INCIDENCE OF IRREGULAR SHIFTS # REGISTERED NURSES, CASHIERS, COOKS, TRUCK DRIVERS data$goodocc <- (data$occ1990 %in% c(95, 276, 436, 804)) ############# EXERCISE 1 summarize_by_group(data, "eductype", "irregular", wt = "wssuppwt") ############# EXERCISE 2 summarize_by_group(data, "agetype", "irregular", wt = "wssuppwt") ############# EXERCISE 3 # FUNCTION TO PRODUCE TWO-WAY TABLES WITH WEIGHTED MEANS tabulate_twoway_means <- function(data, variable_a, variable_b, variable_values, wt) { data_temp <- data[ , c(variable_a, variable_b, variable_values, wt), drop = FALSE] names(data_temp) <- c("var_a", "var_b", "var_values", "var_wt") data_temp$var_values_weighted <- data_temp$var_values * data_temp$var_wt aggregate_twoway <- function(data, replace_var_a = NULL, replace_var_b = NULL) {
147 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
if (!is.null(replace_var_a)) { data$var_a <- replace_var_a } if (!is.null(replace_var_b)) { data$var_b <- replace_var_b } data <- aggregate(x = data[ , c("var_values_weighted", "var_wt")], by = list(data$var_a, data$var_b), FUN = sum) data$var_mean <- data$var_values_weighted / data$var_wt data <- data[ , c("Group.1", "Group.2", "var_mean")] data$Group.1 <- as.character(data$Group.1) data$Group.2 <- as.character(data$Group.2) return(data) } data_twoway <- aggregate_twoway(data_temp) data_marginal_a <- aggregate_twoway(data_temp, replace_var_b = "Total") data_marginal_b <- aggregate_twoway(data_temp, replace_var_a = "Total") data_grand_mean <- aggregate_twoway(data_temp, replace_var_a = "Total", replace_var_b = "Total") table_twoway <- rbind.data.frame(data_twoway, data_marginal_a, data_marginal_b, data_grand_mean) table_twoway <- reshape(table_twoway, direction = "wide", idvar = "Group.1", timevar = "Group.2") names(table_twoway) <- gsub("var_mean", variable_b, names(table_twoway), fixed = TRUE) names(table_twoway)[1] <- variable_a return(table_twoway) } tabulate_twoway_means(data, "eductype", "irregular", "lhourly", "earnwt") ############# EXERCISE 4 occupations <- c("registered nurse" = 95, "cashiers" = 276, "cooks" = 436, "truck drivers" = 804) occupations_df <- data.frame(occupations, names(occupations)) names(occupations_df) <- c("occ1990", "occupation") occupations_df$occ1990 <- as.character(occupations_df$occ1990) table_4 <- summarize_by_group(data[which(data$goodocc == TRUE), ], "occ1990", "irregular", wt = "wssuppwt") column_positions <- c(1, ncol(table_4) + 1, 2:(ncol(table_4))) merge(table_4, occupations_df, by = "occ1990", sort = FALSE, all = TRUE)[, column_positions] ############# EXERCISE 5 table_5 <- tabulate_twoway_means(data[which(data$goodocc == TRUE), ], "occ1990", 148 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
"irregular", "lhourly", "earnwt") column_positions <- c(1, ncol(table_5) + 1, 2:ncol(table_5)) merge(table_5, occupations_df, by = "occ1990", sort = FALSE, all = TRUE)[, column_positions] sink()
Chapter 5, Tidyverse sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 5 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ############################################################# # CHAPTER 5. COMPENSATING DIFFERENTIALS AND THE NIGHT SHIFT ############################################################# data <- read_csv("C:/Projects/Data Explorer/data/cps_00005.csv") colnames(data) <- tolower(colnames(data)) # KEEPS PERSONS AGED 16-64 # EXCLUDES PERSONS NOT IN ORG # EDUCATION RECODE data <- data %>% filter((age >= 16) & (age <= 64), (paidhour == 1) | (paidhour == 2)) %>% mutate(eductype = 1 * (educ <= 60) + 2 * ((educ >= 70) & (educ <= 73)) + 3 * ((educ >= 80) & (educ <= 100)) + 4 * (educ >= 110)) table(data$educ, data$eductype) # DEFINE HOURLY WAGE RATE FOR ALL WORKERS, NOT JUST THOSE PAID BY HOUR data <- data %>% mutate( hourlywage = case_when( (earnweek > 0) & (earnweek < 9999.99) & (uhrswork1 > 0) & (uhrswork1 < 997) & (paidhour == 1) ~ earnweek / uhrswork1, (hourwage > 0) & (hourwage < 99) & (paidhour == 2) ~ hourwage, TRUE ~ NA_real_), lhourly = log(hourlywage)) %>% filter(!is.na(lhourly)) # FUNCTION TO TABULATE / SUMMARIZE BY GROUP, WITH WEIGHTS summarize_by_group <- function(data, variable_group, variable_values, wt) { data_temp <- data[ , c(variable_group, variable_values, wt), drop = FALSE] %>% na.omit() names(data_temp) <- c("var_group", "var_values", "var_wt")
149 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# BY GROUP data_temp_group <- data_temp %>% group_by(var_group) %>% summarize(mean = weighted.mean(var_values, w = var_wt), freq = sum(var_wt), n = n()) %>% ungroup() %>% arrange(var_group) # TOTAL data_temp_total <- data_temp %>% summarize(mean = weighted.mean(var_values, w = var_wt), freq = sum(var_wt), n = n()) out <- data_temp_group %>% bind_rows(data_temp_total) %>% mutate(var_group = case_when(!is.na(var_group) ~ as.character(var_group), TRUE ~ "Total") ) names(out) <- c(variable_group, "Mean", "Freq", "n") return(out) } summarize_by_group(data, "paidhour", "hourlywage", wt = "earnwt") # DROPS PERSONS WHO DO NOT REPORT SHIFT # GROUPS WORKERS INTO AGE GROUPS # CREATES VARIABLE INDICATING PERSON DOES NOT WORK REGULAR DAY SHIFT # SELECTS 4 OCCUPATIONS WITH LARGE SAMPLES AND INCIDENCE OF IRREGULAR SHIFTS # REGISTERED NURSES, CASHIERS, COOKS, TRUCK DRIVERS data <- data %>% filter(wsregshft <= 2) %>% mutate(agetype = case_when((age >= 16) & (age <= 20) ~ 1, (age >= 21) & (age <= 30) ~ 2, (age >= 31) & (age <= 40) ~ 3, (age >= 41) & (age <= 50) ~ 4, (age >= 51) & (age <= 64) ~ 5, TRUE ~ NA_real_), irregular = if_else(wsregshft == 1, 1, 0), goodocc = if_else(occ1990 %in% c(95, 276, 436, 804), 1, 0)) ############# EXERCISE 1 summarize_by_group(data, "eductype", "irregular", wt = "wssuppwt") ############# EXERCISE 2 summarize_by_group(data, "agetype", "irregular", wt = "wssuppwt") ############# EXERCISE 3
150 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# FUNCTION TO PRODUCE TWO-WAY TABLES WITH WEIGHTED MEANS tabulate_twoway_means <- function(data, variable_a, variable_b, variable_values, wt) { data_temp <- data[ , c(variable_a, variable_b, variable_values, wt), drop = FALSE] %>% na.omit() names(data_temp) <- c("var_a", "var_b", "var_values", "var_wt") aggregate_twoway <- function(data, replace_var_a = NULL, replace_var_b = NULL) { if (!is.null(replace_var_a)) { data <- data %>% mutate(var_a = replace_var_a) } if (!is.null(replace_var_b)) { data <- data %>% mutate(var_b = replace_var_b) } data <- data %>% group_by(var_a, var_b) %>% summarize(var_mean = weighted.mean(var_values, w = var_wt)) %>% ungroup() %>% mutate(across(c(var_a, var_b), as.character)) return(data) } data_twoway <- data_temp %>% aggregate_twoway() data_marginal_a <- data_temp %>% aggregate_twoway(replace_var_b = "Total") data_marginal_b <- data_temp %>% aggregate_twoway(replace_var_a = "Total") data_grand_mean <- data_temp %>% aggregate_twoway(replace_var_a = "Total", replace_var_b = "Total") table_twoway <- data_twoway %>% bind_rows(data_marginal_a, data_marginal_b, data_grand_mean) %>% pivot_wider(names_from = var_b, names_prefix = "var_b_", values_from = var_mean) names(table_twoway) <- gsub("var_b", variable_b, names(table_twoway), fixed = TRUE) names(table_twoway)[1] <- variable_a return(table_twoway) } tabulate_twoway_means(data, "eductype", "irregular", "lhourly", "earnwt") ############# EXERCISE 4 occupations <- c("registered nurse" = 95, "cashiers" = 276, 151 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
"cooks" = 436, "truck drivers" = 804) occupations_tibble <- tibble(occupations, names(occupations)) %>% rename(occ1990 = occupations, occupation=`names(occupations)`) %>% mutate(occ1990 = as.character(occ1990)) summarize_by_group(data %>% filter(goodocc == 1), "occ1990", "irregular", wt = "wssuppwt") %>% left_join(occupations_tibble) %>% relocate(occ1990, occupation) ############# EXERCISE 5 tabulate_twoway_means(data %>% filter(goodocc == 1), "occ1990", "irregular", "lhourly", "earnwt") %>% left_join(occupations_tibble) %>% relocate(occ1990, occupation) sink()
Chapter 6, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 6 Base.log") ##################################################################### # CHAPTER 6. WAGE DIFFERENCES ACROSS COLLEGE MAJORS ##################################################################### data <- read.csv("C:/Projects/Data Explorer/data/usa_00006.csv") colnames(data) <- tolower(colnames(data)) data <- data[which(data$year == 2019), ] # KEEPS PERSONS NOT ENROLLED IN SCHOOL data <- data[which(data$school == 1), ] # KEEPS PERSONS AGED 21-30 data <- data[which((data$age >= 21) & (data$age <= 30)), ] # KEEPS PERSONS WITH A BACHELOR'S DEGREE data <- data[which(data$educ == 10), ] # DROPS INCWAGE = 0 OR INCWAGE MISSING data <- data[which((data$incwage > 0) & (data$incwage < 999998)), ] # DEFINES LOG ANNUAL EARNINGS data$lannual <- log(data$incwage) # KEEPS "large" MAJORS THAT HAVE MORE THAN 300 OBSERVATIONS IN 2019 table(data$degfield) data$n <- 1 data_nobs_degfield <- aggregate(n ~ degfield, data, sum)
152 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
names(data_nobs_degfield)[2] <- "n_degfield" data <- merge(data, data_nobs_degfield, by = "degfield") data <- data[which(data$n_degfield >= 300), ] table(data$degfield) ############# EXERCISE 1 data$lannual_weighted <- data$lannual * data$perwt data_means_1 <- aggregate(cbind(lannual_weighted, perwt) ~ degfield, data = data, FUN = sum) data_means_1$lannual_mean <- data_means_1$lannual_weighted / data_means_1$perwt data_means_1 <- data_means_1[, c("degfield", "lannual_mean")] data_means_1 <- data_means_1[order(data_means_1$lannual_mean, decreasing = TRUE), ] rownames(data_means_1) <- 1:nrow(data_means_1) data_means_1 ############# EXERCISE 2 data$female <- (data$sex == 2) data_gender <- data[ , c("degfield", "lannual_weighted", "female", "perwt")] data_gender <- aggregate(cbind(lannual_weighted, perwt) ~ degfield + female, data = data_gender, FUN = sum, na.rm = TRUE, NA.action = NULL) data_gender <- reshape(data_gender, direction = "wide", idvar = "degfield", timevar = "female") data_gender$lannual_m_mean <- data_gender$lannual_weighted.FALSE / data_gender$perwt.FALSE data_gender$lannual_f_mean <- data_gender$lannual_weighted.TRUE / data_gender$perwt.TRUE data_gender$female_mean <- data_gender$perwt.TRUE / (data_gender$perwt.TRUE + data_gender$perwt.FALSE) data_gender$gender_gap <- data_gender$lannual_m_mean data_gender$lannual_f_mean data_gender <- data_gender[order(data_gender$gender_gap, decreasing = TRUE), ] rownames(data_gender) <- 1:nrow(data_gender) data_gender_freq <- data[ , c("degfield", "female", "perwt")] data_gender_freq <- aggregate(perwt ~ degfield + female, data = data_gender_freq, FUN = sum) data_gender_freq <- reshape(data_gender_freq, direction = "wide", idvar = "degfield", timevar = "female") 153 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
colnames(data_gender_freq)[1] <- "degfield" colnames(data_gender_freq)[colnames(data_gender_freq) == "perwt.FALSE"] <"female_FALSE" colnames(data_gender_freq)[colnames(data_gender_freq) == "perwt.TRUE"] <"female_TRUE" data_gender_freq cor(data_gender$lannual_m_mean, data_gender$lannual_f_mean) data_gender[ , c("degfield", "gender_gap")] ############# EXERCISE 3 # BASIC GRAPH plot(data_gender$female_mean, data_gender$lannual_m_mean) # LABELED GRAPH plot(data_gender$female_mean, data_gender$lannual_m_mean, pch = 19, main = "Male Earnings and Femaleness of Field", ylab = "Log Annual Earnings", xlab = "Percent Female in Field", xlim = c(0.18, 1), ylim = c(10.2, 11)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 6-1 Base.pdf") print(graph_1) dev.off() ############# EXERCISE 4 # SEPARATES OUT ECONOMICS MAJORS # RECODE ECONOMICS MAJORS AS DEGFIELD = 1 # SO DEGFIELD = 55 IS NOW ALL SOCIAL SCIENCE MAJORS, EXCEPT ECONOMICS data$degfield[which(data$degfieldd == 5501)] <- 1 data_means_4 <- aggregate(cbind(lannual_weighted, perwt) ~ degfield, data = data, FUN = sum) data_means_4$lannual_mean <- data_means_4$lannual_weighted / data_means_4$perwt data_means_4 <- data_means_4[, c("degfield", "lannual_mean")] data_means_4 <- data_means_4[order(data_means_4$lannual_mean, decreasing = TRUE), ] rownames(data_means_4) <- 1:nrow(data_means_4) data_means_4 sink()
Chapter 6, Tidyverse 154 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 6 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ############################################################# # CHAPTER 6. WAGE DIFFERENCES ACROSS COLLEGE MAJORS ############################################################# data <- read_csv("C:/Projects/Data Explorer/data/usa_00006.csv") colnames(data) <- tolower(colnames(data)) # KEEPS PERSONS NOT ENROLLED IN SCHOOL # KEEPS PERSONS AGED 21-30 # KEEPS PERSONS WITH A BACHELOR'S DEGREE # DROPS INCWAGE = 0 OR INCWAGE MISSING # DEFINES LOG ANNUAL EARNINGS data <- data %>% filter(year == 2019, school == 1, (age >= 21) & (age <= 30), educ == 10, (incwage > 0) & (incwage < 999998)) %>% mutate(lannual = log(incwage)) # KEEPS "large" MAJORS THAT HAVE MORE THAN 300 OBSERVATIONS IN 2019 data %>% count(degfield) data <- data %>% group_by(degfield) %>% mutate(nobs = n()) %>% filter(nobs >= 300) data %>% count(degfield) ############# EXERCISE 1 data %>% group_by(degfield) %>% summarize(lannual_mean = weighted.mean(lannual, w = perwt, na.rm = TRUE)) %>% arrange(desc(lannual_mean)) ############# EXERCISE 2 data <- data %>% mutate(female = (sex == 2)) # DEFINES ANNUAL WAGES SPECIFICALLY FOR MEN AND WOMEN data_gender <- data %>% mutate(lannual_male = if_else(female == 0, lannual, NA_real_), 155 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
lannual_female = if_else(female == 1, lannual, NA_real_)) %>% group_by(degfield) %>% summarize(across(c(lannual_male, lannual_female, female), ~ weighted.mean(.x, w = perwt, na.rm = TRUE))) %>% mutate(gender_gap = lannual_male - lannual_female) data %>% group_by(degfield, female) %>% summarize(freq = sum(perwt, na.rm = TRUE)) %>% pivot_wider(names_from = female, names_prefix = "female_", values_from = freq) cor(data_gender$lannual_male, data_gender$lannual_female) data_gender %>% select(degfield, gender_gap) %>% arrange(desc(gender_gap)) ############# EXERCISE 3 # BASIC GRAPH ggplot(data_gender, aes(x = female, y = lannual_male)) + geom_point() # LABELED GRAPH ggplot(data_gender, aes(x = female, y = lannual_male)) + geom_point() + labs(title = "Male Earnings and Femaleness of Field", x = "Percent Female in Field", y = "Log Annual Earnings") + scale_x_continuous(limits = c(0.18, 1), breaks = seq(from = 0.2, to = 1, by = 0.2)) + scale_y_continuous(limits = c(10.2, 11), breaks = seq(from = 10.2, to = 11, by = 0.2)) + theme(plot.title = element_text(hjust = 0.5)) ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 6-1 Tidyverse.pdf") ############# EXERCISE 4 # SEPARATES OUT ECONOMICS MAJORS # RECODE ECONOMICS MAJORS AS DEGFIELD = 1 # SO DEGFIELD = 55 IS NOW ALL SOCIAL SCIENCE MAJORS, EXCEPT ECONOMICS data %>% mutate(degfield = if_else(degfieldd == 5501, 1, degfield)) %>% group_by(degfield) %>% summarize(lannual_mean = weighted.mean(lannual, w = perwt, na.rm = TRUE)) %>% arrange(desc(lannual_mean)) sink()
156 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 7, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 7 Base.log") #################################################### # CHAPTER 7. THE MINCER EARNINGS FUNCTION OVER TIME #################################################### data <- read.csv("C:/Projects/Data Explorer/data/cps_00007.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-64 data <- data[which((data$age >= 21) & (data$age <= 64)), ] # STARTS SAMPLE IN 1964 data <- data[which(data$year >= 1964), ] # EXCLUDES INVALID VALUES OF ANNUAL EARNINGS data <- data[which((data$incwage > 0) & (data$incwage < 99999998)), ] # DROPS PERSONS WHO DID NOT WORK data <- data[which((data$wkswork >= 1) & (data$wkswork2 <= 6)), ] # RECODES WEEKS WORKED INTO CONTINUOUS VARIABLE data$weeks <- NA data$weeks[which(data$wkswork2 == 1)] <- 7 data$weeks[which(data$wkswork2 == 2)] <- 20 data$weeks[which(data$wkswork2 == 3)] <- 33 data$weeks[which(data$wkswork2 == 4)] <- 43.5 data$weeks[which(data$wkswork2 == 5)] <- 48.5 data$weeks[which(data$wkswork2 == 6)] <- 51 # DEFINES LOG WEEKLY EARNINGS data$lweekly <- log(data$incwage / data$weeks) # RECODES EDUC INTO CONTINUOUS YEARS OF SCHOOLING AND DROPS INVALID VALUES data$yrschool <- NA data$yrschool[which(data$educ == 2)] <- 0 data$yrschool[which(data$educ == 10)] <- 2.5 data$yrschool[which(data$educ == 11)] <- 1 data$yrschool[which(data$educ == 12)] <- 2 data$yrschool[which(data$educ == 13)] <- 3 data$yrschool[which(data$educ == 14)] <- 4 data$yrschool[which(data$educ == 20)] <- 5.5 data$yrschool[which(data$educ == 21)] <- 5 data$yrschool[which(data$educ == 22)] <- 6 data$yrschool[which(data$educ == 30)] <- 7.5 data$yrschool[which(data$educ == 31)] <- 7 data$yrschool[which(data$educ == 32)] <- 8 data$yrschool[which(data$educ == 40)] <- 9 data$yrschool[which(data$educ == 50)] <- 10 data$yrschool[which(data$educ == 60)] <- 11 data$yrschool[which((data$educ >= 70) & (data$educ <= 73))] <- 12 data$yrschool[which((data$educ == 80) | (data$educ == 81))] <- 13
157 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
data$yrschool[which((data$educ >= 90) & (data$educ <= 92))] <- 14 data$yrschool[which(data$educ == 100)] <- 15 data$yrschool[which((data$educ == 110) | (data$educ == 111))] <- 16 data$yrschool[which(data$educ == 120)] <- 18 data$yrschool[which(data$educ == 121)] <- 17 data$yrschool[which((data$educ == 122) | (data$educ == 123))] <- 18 data$yrschool[which(data$educ == 124)] <- 19 data$yrschool[which(data$educ == 125)] <- 20 # CHECKS RECODE OF WEEKS VARIABLE aggregate(weeks ~ wkswork2, data = data, FUN = function(x) return(c(mean(x), sd(x), length(x)))) # CHECKS RECODE OF SCHOOLING VARIABLE aggregate(yrschool ~ educ, data = data, FUN = function(x) return(c(mean(x), sd(x), length(x)))) # DEFINES EXPERIENCE AND EXPERIENCE SQUARE data$exper <- data$age - data$yrschool - 6 data$exper2 <- data$exper * data$exper # RECODE NEGATIVE WEIGHTS AS ZERO data$asecwt[which(data$asecwt < 0)] <- 0 # DEFINES VARIABLES THAT WILL RETRIEVE THE COEFFICIENT OF SCHOOLING AND EXPERIENCE IN EACH SEX-YEAR PAIRING # THE COEFF OF EXPERIENCE WILL BE DEFINED AS SLOPE AT 10 YEARS OF EXPERIENCE reg_years <- 1964:2022 reg_results <- as.data.frame(matrix(NA, nrow = length(reg_years) * 2, ncol = 4)) colnames(reg_results) <- c("year", "sex", "rschool", "rexper") # RUNS MINCER EARNINGS FUNCTIONS, BY SEX AND YEAR for (j in c(1, 2)) { iteration_loops <- 0 for (k in reg_years) { iteration_loops <- iteration_loops + 1 data_relevant <- data[which((data$year == k) & (data$sex == j)), ] data_relevant_weights <- data$asecwt[which((data$year == k) & (data$sex == j))] reg_results_row <- (iteration_loops - 1) * 2 + j reg_results[reg_results_row, "year"] <- k reg_results[reg_results_row, "sex"] <- j reg_model <- lm(lweekly ~ yrschool + exper + exper2, data = data_relevant, weights = data_relevant_weights) reg_results[reg_results_row, "rschool"] <- coef(reg_model)["yrschool"]
158 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
reg_results[reg_results_row, "rexper"] <- coef(reg_model)["exper"] + 2 * 10 * coef(reg_model)["exper2"] } } reg_means <- reshape(reg_results, direction = "wide", idvar = "year", timevar = "sex") # FIGURE FOR RATE OF RETURN TO SCHOOL # LABELED GRAPH plot(reg_means$year, reg_means$rschool.1, type = "o", pch = 19, main = "Trends in the Rate of Return to School", ylab = "Rate of Return", xlab = "Year", xlim = c(1960, 2022), ylim = c(0.069, 0.145), col = "blue") lines(reg_means$year, reg_means$rschool.2, type = "o", pch = 19, col = "red") legend("bottomright", legend = c("Men", "Women"), col = c("blue", "red"), lty = c(1, 1)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 7-1 Base.pdf") print(graph_1) dev.off() # FIGURE FOR RATE OF RETURN TO EXPERIENCE # LABELED GRAPH plot(reg_means$year, reg_means$rexper.1, type = "o", pch = 19, main = "Trends in the Rate of Return to Experience", ylab = "Rate of Return", xlab = "Year", xlim = c(1960, 2022), ylim = c(0.005, 0.05), col = "blue") lines(reg_means$year, reg_means$rexper.2, type = "o", pch = 19, col = "red") legend("bottomright", legend = c("Men", "Women"), col = c("blue", "red"), lty = c(1, 1)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 7-2 Base.pdf") print(graph_2) dev.off() sink()
Chapter 7, Tidyverse
159 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 7 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ################################################### # CHAPTER 7. THE MINCER EARNINGS FUNCTION OVER TIME ################################################### data <- read_csv("C:/Projects/Data Explorer/data/cps_00007.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-64 # STARTS SAMPLE IN 1964 # EXCLUDES INVALID VALUES OF ANNUAL EARNINGS # DROPS PERSONS WHO DID NOT WORK # RECODE NEGATIVE WEIGHTS AS ZERO # RECODES WEEKS WORKED INTO CONTINUOUS VARIABLE # DEFINES LOG ANNUAL EARNINGS # RECODES EDUC INTO CONTINUOUS YEARS OF SCHOOLING AND DROPS INVALID VALUES # DEFINES EXPERIENCE AND EXPERIENCE SQUARE data <- data %>% filter((age >= 21) & (age <= 64), year >= 1964, (incwage > 0) & (incwage < 99999998), (wkswork2 >= 1) & (wkswork2 <= 6)) %>% mutate(asecwt = if_else(asecwt < 0, 0, asecwt), weeks = case_when( wkswork2 == 1 ~ 7, wkswork2 == 2 ~ 20, wkswork2 == 3 ~ 33, wkswork2 == 4 ~ 43.5, wkswork2 == 5 ~ 48.5, wkswork2 == 6 ~ 51, TRUE ~ NA_real_ ), lweekly = log(incwage / weeks), yrschool = case_when( educ == 2 ~ 0, educ == 10 ~ 2.5, educ == 11 ~ 1, educ == 12 ~ 2, educ == 13 ~ 3, educ == 14 ~ 4, educ == 20 ~ 5.5, educ == 21 ~ 5, educ == 22 ~ 6, educ == 30 ~ 7.5, educ == 31 ~ 7, educ == 32 ~ 8, educ == 40 ~ 9, educ == 50 ~ 10, educ == 60 ~ 11, (educ >= 70) & (educ <= 73) ~ 12, 160 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(educ == 80) | (educ == 81) ~ 13, (educ >= 90) & (educ <= 92) ~ 14, educ == 100 ~ 15, (educ == 110) | (educ == 111) ~ 16, educ == 120 ~ 18, educ == 121 ~ 17, (educ == 122) | (educ == 123) ~ 18, educ == 124 ~ 19, educ == 125 ~ 20, TRUE ~ NA_real_ ), exper = age - yrschool - 6, exper2 = exper * exper) # CHECKS RECODE OF WEEKS VARIABLE data %>% group_by(wkswork2) %>% summarize(mean = mean(weeks), sd = sd(weeks), n = n()) # CHECKS RECODE OF SCHOOLING VARIABLE data %>% group_by(educ) %>% summarize(mean = mean(yrschool), sd = sd(yrschool), n = n()) # DEFINES VARIABLES THAT WILL RETRIEVE THE COEFFICIENT OF SCHOOLING AND EXPERIENCE IN EACH SEX-YEAR PAIRING # THE COEFF OF EXPERIENCE WILL BE DEFINED AS SLOPE AT 10 YEARS OF EXPERIENCE reg_years <- 1964:2022 reg_results <- as.data.frame(matrix(NA, nrow = length(reg_years) * 2, ncol = 4)) colnames(reg_results) <- c("year", "sex", "rschool", "rexper") # RUNS MINCER EARNINGS FUNCTIONS, BY SEX AND YEAR for (j in c(1, 2)) { iteration_loops <- 0 for (k in reg_years) { iteration_loops <- iteration_loops + 1 data_relevant <- data %>% filter(year == k, sex == j) data_relevant_weights <- data %>% filter(year == k, sex == j) %>% pull(asecwt) reg_results_row <- (iteration_loops - 1) * 2 + j reg_results[reg_results_row, "year"] <- k reg_results[reg_results_row, "sex"] <- j reg_model <- lm(lweekly ~ yrschool + exper + exper2, data = data_relevant, weights = data_relevant_weights) 161 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
reg_results[reg_results_row, "rschool"] <- coef(reg_model)["yrschool"] reg_results[reg_results_row, "rexper"] <- coef(reg_model)["exper"] + 2 * 10 * coef(reg_model)["exper2"] } } # FIGURE FOR RATE OF RETURN TO SCHOOL # BASIC GRAPH ggplot(reg_results, aes(x = year, y = rschool, color = factor(sex))) + geom_point() + geom_line() # LABELED GRAPH ggplot(reg_results, aes(x = year, y = rschool, color = factor(sex))) + geom_point() + geom_line() + labs(title = "Trends in the Rate of Return to School", x = "Year", y = "Rate of Return") + scale_x_continuous(limits = c(1960, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + scale_y_continuous(limits = c(0.069, 0.145), breaks = seq(from = 0.08, to = 0.145, by = 0.02)) + scale_color_discrete(labels = c("Men", "Women"), type = c("blue", "red"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 7-1 Tidyverse.pdf") # FIGURE FOR RATE OF RETURN TO EXPERIENCE # BASIC GRAPH ggplot(reg_results, aes(x = year, y = rexper, color = factor(sex))) + geom_point() + geom_line() # LABELED GRAPH ggplot(reg_results, aes(x = year, y = rexper, color = factor(sex))) + geom_point() + geom_line() + labs(title = "Trends in the Rate of Return to Experience", x = "Year", y = "Rate of Return") + scale_x_continuous(limits = c(1960, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + scale_y_continuous(limits = c(0.005, 0.05), breaks = seq(from = 0.01, to = 0.05, by = 0.01)) + scale_color_discrete(labels = c("Men", "Women"), type = c("blue", "red"), 162 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 7-2 Tidyverse.pdf") sink()
Chapter 8, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 8 Base.log") ################################################# # CHAPTER 8. THE CHILDREN OF IMMIGRANTS ################################################# data <- read.csv("C:/Projects/Data Explorer/data/cps_00008.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-64 data <- data[which((data$age >= 21) & (data$age <= 64)), ] # STARTS SAMPLE IN 1994 data <- data[which(data$year >= 1994), ] # EXCLUDES INVALID VALUES OF ANNUAL EARNINGS OR WEEKLY EARNINGS data <- data[which((data$incwage > 0) & (data$incwage < 99999998)), ] data <- data[which(data$wkswork1 > 0), ] # DEFINES LOG WEEKLY EARNINGS data$lweekly <- log(data$incwage / data$wkswork1) # DEFINES GENERATION data <- data[which(data$nativity != 0), ] data$generation <- 1 * (data$nativity == 5) + 2 * ((data$nativity >= 2) & (data$nativity <= 4)) + 3 * (data$nativity == 1) table(data$nativity, data$generation) data$lweekly_weighted <- data$lweekly * data$asecwt data_means <- aggregate(cbind(lweekly_weighted, asecwt) ~ year + sex + generation, data = data, FUN = sum) data_means$lweekly <- data_means$lweekly_weighted / data_means$asecwt data_means <- data_means[ , c("year", "sex", "generation", "lweekly")] data_means <- reshape(data_means, direction = "wide", idvar = c("year", "sex"), timevar = "generation") data_means[which(data_means$sex == 1), ] data_means[which(data_means$sex == 2), ]
163 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# CALCULATE RELATIVE WAGES data_means$rfirst <- data_means$lweekly.1 - data_means$lweekly.3 data_means$rsecond <- data_means$lweekly.2 - data_means$lweekly.3 data_means <- data_means[ , c("year", "sex", "rfirst", "rsecond")] # CALCULATES RELATIVE WAGES FOR EACH YEAR-SEX PAIR data_means <- reshape(data_means, direction = "wide", idvar = "year", timevar = "sex") # FIRST-SECOND GENERATION GRAPH FOR MEN # LABELED GRAPH plot(data_means$year, data_means$rfirst.1, type = "o", pch = 19, main = "Relative Wage of First and Second Generations, Men", ylab = "Log Wage Gap", xlab = "Year", xlim = c(1990, 2022), ylim = c(-0.3, 0.1), col = "blue") lines(data_means$year, data_means$rsecond.1, type = "o", pch = 19, col = "red") legend("topright", legend = c("Immigrants", "Children of Immigrants"), col = c("blue", "red"), lty = c(1, 1)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 8-1 Base.pdf") print(graph_1) dev.off() # FIRST-SECOND GENERATION GRAPH FOR WOMEN # LABELED GRAPH plot(data_means$year, data_means$rfirst.2, type = "o", pch = 19, main = "Relative Wage of First and Second Generations, Women", ylab = "Log Wage Gap", xlab = "Year", xlim = c(1990, 2022), ylim = c(-0.15, 0.1), col = "blue") lines(data_means$year, data_means$rsecond.2, type = "o", pch = 19, col = "red") legend("topright", legend = c("Immigrants", "Children of Immigrants"), col = c("blue", "red"), lty = c(1, 1)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 8-2 Base.pdf") print(graph_2) dev.off() sink()
Chapter 8, Tidyverse 164 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 8 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ################################################# # CHAPTER 8. THE CHILDREN OF IMMIGRANTS ################################################# data <- read_csv("C:/Projects/Data Explorer/data/cps_00008.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-64 # STARTS SAMPLE IN 1994 # EXCLUDES INVALID VALUES OF ANNUAL EARNINGS OR WEEKLY EARNINGS # DEFINES LOG WEEKLY EARNINGS # DEFINES GENERATION data <- data %>% filter((age >= 21) & (age <= 64), year >= 1994, (incwage > 0) & (incwage < 99999998), wkswork1 > 0, nativity != 0) %>% mutate(lweekly = log(incwage / wkswork1), generation = 1 * (nativity == 5) + 2 * ((nativity >= 2) & (nativity <= 4)) + 3 * (nativity == 1)) table(data$nativity, data$generation) data_means <- data %>% group_by(year, sex, generation) %>% summarize(lweekly = weighted.mean(lweekly, w = asecwt, na.rm = TRUE)) %>% pivot_wider(names_from = "generation", names_prefix = "lweekly", values_from = lweekly) data_means %>% filter(sex == 1) data_means %>% filter(sex == 2) # CALCULATE RELATIVE WAGES data_means <- data_means %>% mutate(rfirst = lweekly1 - lweekly3, rsecond = lweekly2 - lweekly3) %>% select(year, sex, rfirst, rsecond) %>% pivot_longer(c("rfirst", "rsecond"), names_to = "generations", values_to = "relative_wage") # FIRST-SECOND GENERATION GRAPH FOR MEN
165 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# BASIC GRAPH ggplot(data_means %>% filter(sex == 1), aes(x = year, y = relative_wage, color = factor(generations))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means %>% filter(sex == 1), aes(x = year, y = relative_wage, color = factor(generations))) + geom_point() + geom_line() + labs(title = "Relative Wage of First and Second Generations, Men", x = "Year", y = "Log Wage Gap") + scale_x_continuous(limits = c(1994, 2022), breaks = seq(from = 1995, to = 2020, by = 5)) + scale_y_continuous(limits = c(-0.3, 0.1)) + scale_color_discrete(labels = c("Immigrants", "Children of Immigrants"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 8-1 Tidyverse.pdf") # FIRST-SECOND GENERATION GRAPH FOR WOMEN # BASIC GRAPH ggplot(data_means %>% filter(sex == 2), aes(x = year, y = relative_wage, color = factor(generations))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means %>% filter(sex == 2), aes(x = year, y = relative_wage, color = factor(generations))) + geom_point() + geom_line() + labs(title = "Relative Wage of First and Second Generations, Women", x = "Year", y = "Log Wage Gap") + scale_x_continuous(limits = c(1994, 2022), breaks = seq(from = 1995, to = 2020, by = 5)) + scale_y_continuous(limits = c(-0.15, 0.1)) + scale_color_discrete(labels = c("Immigrants", "Children of Immigrants"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom")
166 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 8-2 Tidyverse.pdf") sink()
Chapter 9, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 9 Base.log") ################################################# # CHAPTER 8. THE CHILDREN OF IMMIGRANTS ################################################# data <- read.csv("C:/Projects/Data Explorer/data/cps_00009.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-64 data <- data[which((data$age >= 21) & (data$age <= 64)), ] # STARTS SAMPLE IN 1964 data <- data[which(data$year >= 1964), ] # EXCLUDES INVALID VALUES OF ANNUAL EARNINGS data <- data[which((data$incwage > 0) & (data$incwage < 99999998)), ] # DROPS PERSONS WHO DID NOT WORK data <- data[which((data$wkswork2 >= 1) & (data$wkswork2 <= 6)), ] # RECODES WEEKS WORKED INTO CONTINUOUS VARIABLE data$weeks <- NA data$weeks[which(data$wkswork2 == 1)] <- 7 data$weeks[which(data$wkswork2 == 2)] <- 20 data$weeks[which(data$wkswork2 == 3)] <- 33 data$weeks[which(data$wkswork2 == 4)] <- 43.5 data$weeks[which(data$wkswork2 == 5)] <- 48.5 data$weeks[which(data$wkswork2 == 6)] <- 51 # KEEPS ONLY BLACKS AND WHITES data <- data[which(data$race <= 200), ] data$black <- (data$race == 200) # DEFINES LOG WEEKLY EARNINGS data$lweekly <- log(data$incwage / data$weeks) # DEFINES INDICATOR VARIABLE FOR MORE THAN HIGH SCHOOL data$skill <- (data$edu >= 80) # DROPS NEGATIVE WEIGHTS data <- data[which(data$asecwt >= 0), ] aggregate(weeks ~ wkswork2, data = data, FUN = function(x) return(c(mean(x, na.rm = TRUE), length(x)))) table(data$educ, data$skill)
167 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# TRENDS IN RACIAL WAGE GAP, BY GENDER data$lweekly_weighted <- data$lweekly * data$asecwt data_means_1 <- aggregate(cbind(lweekly_weighted, asecwt) ~ year + sex + black, data = data, FUN = sum) data_means_1$lweekly <- data_means_1$lweekly_weighted / data_means_1$asecwt data_means_1 <- data_means_1[ , c("year", "sex", "black", "lweekly")] data_means_1 <- reshape(data_means_1, direction = "wide", idvar = c("year", "sex"), timevar = "black") # CALCULATE RACIAL WAGE GAP data_means_1$rblack <- data_means_1$lweekly.TRUE data_means_1$lweekly.FALSE data_means_1 <- data_means_1[ , c("year", "sex", "rblack")] data_means_1 <- reshape(data_means_1, direction = "wide", idvar = "year", timevar = "sex") # LABELED GRAPH plot(data_means_1$year, data_means_1$rblack.1, type = "o", pch = 19, main = "Trends in the Black-White Wage Gap, by Gender", ylab = "Log Wage Gap", xlab = "Year", xlim = c(1960, 2022), ylim = c(-0.62, 0.025), col = "blue") lines(data_means_1$year, data_means_1$rblack.2, type = "o", pch = 19, col = "red") legend("bottomright", legend = c("Men", "Women"), col = c("blue", "red"), lty = c(1, 1)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 9-1 Base.pdf") print(graph_1) dev.off() # TRENDS IN RACIAL WAGE GAP FOR MEN IN EACH SKILL GROUP data_means_2 <- aggregate(cbind(lweekly_weighted, asecwt) ~ year + skill + black, data = data[which(data$sex == 1), ], FUN = sum) data_means_2$lweekly <- data_means_2$lweekly_weighted / data_means_2$asecwt data_means_2 <- data_means_2[ , c("year", "skill", "black", "lweekly")] data_means_2 <- reshape(data_means_2, direction = "wide", idvar = c("year", "skill"), timevar = "black")
168 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# CALCULATE RACIAL WAGE GAP data_means_2$rblack <- data_means_2$lweekly.TRUE data_means_2$lweekly.FALSE data_means_2 <- data_means_2[ , c("year", "skill", "rblack")] data_means_2 <- reshape(data_means_2, direction = "wide", idvar = "year", timevar = "skill") # LABELED GRAPH plot(data_means_2$year, data_means_2$rblack.FALSE, type = "o", pch = 19, main = "Trends in the Black-White Wage Gap, Men", ylab = "Log Wage Gap", xlab = "Year", xlim = c(1960, 2022), ylim = c(-0.6, -0.1), col = "blue") lines(data_means_2$year, data_means_2$rblack.TRUE, type = "o", pch = 19, col = "red") legend("bottomright", legend = c("High School or Less", "More than High School"), col = c("blue", "red"), lty = c(1, 1)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 9-2 Base.pdf") print(graph_2) dev.off() # TRENDS IN RACIAL WAGE GAP FOR WOMEN IN EACH SKILL GROUP data_means_3 <- aggregate(cbind(lweekly_weighted, asecwt) ~ year + skill + black, data = data[which(data$sex == 2), ], FUN = sum) data_means_3$lweekly <- data_means_3$lweekly_weighted / data_means_3$asecwt data_means_3 <- data_means_3[ , c("year", "skill", "black", "lweekly")] data_means_3 <- reshape(data_means_3, direction = "wide", idvar = c("year", "skill"), timevar = "black") # CALCULATE RACIAL WAGE GAP data_means_3$rblack <- data_means_3$lweekly.TRUE data_means_3$lweekly.FALSE data_means_3 <- data_means_3[ , c("year", "skill", "rblack")] data_means_3 <- reshape(data_means_3, direction = "wide", idvar = "year", timevar = "skill") # LABELED GRAPH plot(data_means_3$year, data_means_3$rblack.FALSE, type = "o", pch = 19, main = "Trends in the Black-White Wage Gap, Women", ylab = "Log Wage Gap", xlab = "Year", xlim = c(1960, 2022), ylim = c(-0.7, 0.25), col = "blue") lines(data_means_3$year, data_means_3$rblack.TRUE, type = "o", pch = 19, 169 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
col = "red") legend("bottomright", legend = c("High School or Less", "More than High School"), col = c("blue", "red"), lty = c(1, 1)) graph_3 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 9-3 Base.pdf") print(graph_3) dev.off() sink()
Chapter 9, Tidyverse sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 9 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ###################################################################### # CHAPTER 9. GENDER AND SKILL DIFFERENCES IN THE BLACK-WHITE WAGE GAP ###################################################################### data <- read_csv("C:/Projects/Data Explorer/data/cps_00009.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-64 # STARTS SAMPLE IN 1964 # EXCLUDES INVALID VALUES OF ANNUAL EARNINGS # DROPS PERSONS WHO DID NOT WORK # KEEPS ONLY BLACKS AND WHITES # RECODES WEEKS WORKED INTO CONTINUOUS VARIABLE # DEFINES LOG WEEKLY EARNINGS # DEFINES INDICATOR VARIABLE FOR MORE THAN HIGH SCHOOL # DROPS NEGATIVE WEIGHTS data <- data %>% filter((age >= 21) & (age <= 64), year >= 1964, (incwage > 0) & (incwage < 99999998), (wkswork2 >= 1) & (wkswork2 <= 6), race <= 200, asecwt >= 0) %>% mutate(weeks = case_when( wkswork2 == 1 ~ 7, wkswork2 == 2 ~ 20, wkswork2 == 3 ~ 33, wkswork2 == 4 ~ 43.5, wkswork2 == 5 ~ 48.5, wkswork2 == 6 ~ 51, TRUE ~ NA_real_ ), black = (race == 200),
170 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
lweekly = log(incwage / weeks), skill = (educ >= 80)) data %>% group_by(wkswork2) %>% summarize(weeks_mean = mean(weeks, na.rm = TRUE), weeks_n = n()) table(data$educ, data$skill) # TRENDS IN RACIAL WAGE GAP, BY GENDER # CALCULATE RACIAL WAGE GAP data_means_1 <- data %>% group_by(year, sex, black) %>% summarize(lweekly = weighted.mean(lweekly, w = asecwt, na.rm = TRUE)) %>% pivot_wider(id_cols = c("year", "sex"), names_from = "black", names_prefix = "lweekly_", values_from = lweekly) %>% mutate(rblack = lweekly_TRUE - lweekly_FALSE) %>% select(year, sex, rblack) # BASIC GRAPH ggplot(data_means_1, aes(x = year, y = rblack, color = factor(sex))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_1, aes(x = year, y = rblack, color = factor(sex))) + geom_point() + geom_line() + labs(title = "Trends in the Black-White Wage Gap, by Gender", x = "Year", y = "Log Wage Gap") + scale_x_continuous(limits = c(1960, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + scale_y_continuous(limits = c(-0.62, 0.025)) + scale_color_discrete(labels = c("Men", "Women"), type = c("blue", "red"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 9-1 Tidyverse.pdf") # TRENDS IN RACIAL WAGE GAP FOR MEN IN EACH SKILL GROUP data_means_2 <- data %>% filter(sex == 1) %>% group_by(year, skill, black) %>% summarize(lweekly = weighted.mean(lweekly, w = asecwt, na.rm = TRUE)) %>% pivot_wider(id_cols = c("year", "skill"), names_from = "black", names_prefix = "lweekly_", values_from = lweekly) %>% 171 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
mutate(rblack = lweekly_TRUE - lweekly_FALSE) %>% select(year, skill, rblack) # BASIC GRAPH ggplot(data_means_2, aes(x = year, y = rblack, color = factor(skill))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_2, aes(x = year, y = rblack, color = factor(skill))) + geom_point() + geom_line() + labs(title = "Trends in the Black-White Wage Gap, Men", x = "Year", y = "Log Wage Gap") + scale_x_continuous(limits = c(1960, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + scale_y_continuous(limits = c(-0.6, -0.1), breaks = seq(from = -0.6, to = -0.1, by = 0.1)) + scale_color_discrete(labels = c("High School or Less", "More than High School"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 9-2 Tidyverse.pdf") # TRENDS IN RACIAL WAGE GAP FOR WOMEN IN EACH SKILL GROUP data_means_3 <- data %>% filter(sex == 2) %>% group_by(year, skill, black) %>% summarize(lweekly = weighted.mean(lweekly, w = asecwt, na.rm = TRUE)) %>% pivot_wider(id_cols = c("year", "skill"), names_from = "black", names_prefix = "lweekly_", values_from = lweekly) %>% mutate(rblack = lweekly_TRUE - lweekly_FALSE) %>% select(year, skill, rblack) # BASIC GRAPH ggplot(data_means_3, aes(x = year, y = rblack, color = factor(skill))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means_3, aes(x = year, y = rblack, color = factor(skill))) + geom_point() + geom_line() + labs(title = "Trends in the Black-White Wage Gap, Women", x = "Year", y = "Log Wage Gap") + scale_x_continuous(limits = c(1960, 2022), breaks = seq(from = 1960, to = 2020, by = 10)) + 172 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
scale_y_continuous(limits = c(-0.7, 0.25)) + scale_color_discrete(labels = c("High School or Less", "More than High School"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 9-3 Tidyverse.pdf") sink()
Chapter 10, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 10 Base.log") ####################################### # CHAPTER 10. GENDER AND UNIONIZATION ####################################### data <- read.csv("C:/Projects/Data Explorer/data/cps_00010.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-64 data <- data[which((data$age >= 21) & (data$age <= 64)), ] # STARTS SERIES IN 1984 data <- data[which(data$year >= 1984), ] # EXCLUDES PERSONS NOT IN ORG data <- data[which(data$union != 0), ] data$member <- (data$union == 2) # KEEPS WORKERS WITH VALID WEEKLY EARNINGS data <- data[which((data$earnweek > 0) & (data$earnweek < 9999.99)), ] # DEFINES LOG OF WEEKLY EARNINGS data$lweekly <- log(data$earnweek) # RECODES EDUC INTO CONTINUOUS YEARS OF SCHOOLING AND DROPS INVALID VALUES data$yrschool <- NA data$yrschool[which(data$educ == 2)] <- 0 data$yrschool[which(data$educ == 10)] <- 2.5 data$yrschool[which(data$educ == 11)] <- 1 data$yrschool[which(data$educ == 12)] <- 2 data$yrschool[which(data$educ == 13)] <- 3 data$yrschool[which(data$educ == 14)] <- 4 data$yrschool[which(data$educ == 20)] <- 5.5 data$yrschool[which(data$educ == 21)] <- 5 data$yrschool[which(data$educ == 22)] <- 6 data$yrschool[which(data$educ == 30)] <- 7.5 data$yrschool[which(data$educ == 31)] <- 7 data$yrschool[which(data$educ == 32)] <- 8 data$yrschool[which(data$educ == 40)] <- 9
173 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
data$yrschool[which(data$educ == 50)] <- 10 data$yrschool[which(data$educ == 60)] <- 11 data$yrschool[which((data$educ >= 70) & (data$educ <= 73))] <- 12 data$yrschool[which((data$educ == 80) | (data$educ == 81))] <- 13 data$yrschool[which((data$educ >= 90) & (data$educ <= 92))] <- 14 data$yrschool[which(data$educ == 100)] <- 15 data$yrschool[which((data$educ == 110) | (data$educ == 111))] <- 16 data$yrschool[which(data$educ == 120)] <- 18 data$yrschool[which(data$educ == 121)] <- 17 data$yrschool[which((data$educ == 122) | (data$educ == 123))] <- 18 data$yrschool[which(data$educ == 124)] <- 19 data$yrschool[which(data$educ == 125)] <- 20 # CHECKS RECODE OF SCHOOLING VARIABLE aggregate(yrschool ~ educ, data = data, FUN = function(x) return(c(mean(x, na.rm = TRUE), length(x)))) # DEFINES EXPERIENCE AND EXPERIENCE SQUARE data$exper <- data$age - data$yrschool - 6 data$exper2 <- data$exper * data$exper ############# EXERCISE 1 data$member_weighted <- data$member * data$earnwt data_means <- aggregate(cbind(member_weighted, earnwt) ~ year + sex, data = data, FUN = sum) data_means$member <- data_means$member_weighted / data_means$earnwt data_means <- data_means[ , c("year", "sex", "member")] data_means <- reshape(data_means, direction = "wide", idvar = "year", timevar = "sex") # LABELED GRAPH plot(data_means$year, data_means$member.1, type = "o", pch = 19, main = "Union Share, by Gender", ylab = "Fraction in Union", xlab = "Year", xlim = c(1980, 2022), ylim = c(0.1, 0.25), col = "blue") lines(data_means$year, data_means$member.2, type = "o", pch = 19, col = "red") legend("topright", legend = c("Men", "Women"), col = c("blue", "red"), lty = c(1, 1)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 10-1 Base.pdf") print(graph_1) dev.off() ############# EXERCISE 2 # RUNS MINCER EARNINGS FUNCTIONS, BY SEX AND YEAR
174 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# DEFINES VARIABLES THAT WILL CAPTURE THE COEFFICIENT OF UNION MEMBERSHIP reg_years <- 1984:2022 reg_results <- as.data.frame(matrix(NA, nrow = length(reg_years) * 2, ncol = 3)) colnames(reg_results) <- c("year", "sex", "rmember") for (j in c(1, 2)) { iteration_loops <- 0 for (k in reg_years) { iteration_loops <- iteration_loops + 1 data_relevant <- data[which((data$year == k) & (data$sex == j)), ] data_relevant_weights <- data$earnwt[which((data$year == k) & (data$sex == j))] reg_results_row <- (iteration_loops - 1) * 2 + j reg_results[reg_results_row, "year"] <- k reg_results[reg_results_row, "sex"] <- j reg_model <- lm(lweekly ~ yrschool + exper + exper2 + member, data = data_relevant, weights = data_relevant_weights) reg_results[reg_results_row, "rmember"] <coef(reg_model)["memberTRUE"] } } reg_means <- reshape(reg_results, direction = "wide", idvar = "year", timevar = "sex") # LABELED GRAPH plot(reg_means$year, reg_means$rmember.1, type = "o", pch = 19, main = "Union Wage Gap, by Gender", ylab = "Log Wage Gap", xlab = "Year", xlim = c(1980, 2022), ylim = c(0.075, 0.35), col = "blue") lines(reg_means$year, reg_means$rmember.2, type = "o", pch = 19, col = "red") legend("topright", legend = c("Men", "Women"), col = c("blue", "red"), lty = c(1, 1)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 10-2 Base.pdf") print(graph_2) dev.off() sink()
Chapter 10, Tidyverse 175 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 10 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ####################################### # CHAPTER 10. GENDER AND UNIONIZATION ####################################### data <- read_csv("C:/Projects/Data Explorer/data/cps_00010.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 21-64 # STARTS SERIES IN 1984 # EXCLUDES PERSONS NOT IN ORG # KEEPS WORKERS WITH VALID WEEKLY EARNINGS # DEFINES LOG OF WEEKLY EARNINGS # RECODES EDUC INTO CONTINUOUS YEARS OF SCHOOLING AND DROPS INVALID VALUES # DEFINES EXPERIENCE AND EXPERIENCE SQUARE data <- data %>% filter((age >= 21) & (age <= 64), year >= 1984, union != 0, (earnweek > 0) & (earnweek < 9999.99)) %>% mutate(member = (union == 2), lweekly = log(earnweek), yrschool = case_when( educ == 2 ~ 0, educ == 10 ~ 2.5, educ == 11 ~ 1, educ == 12 ~ 2, educ == 13 ~ 3, educ == 14 ~ 4, educ == 20 ~ 5.5, educ == 21 ~ 5, educ == 22 ~ 6, educ == 30 ~ 7.5, educ == 31 ~ 7, educ == 32 ~ 8, educ == 40 ~ 9, educ == 50 ~ 10, educ == 60 ~ 11, (educ >= 70) & (educ <= 73) ~ 12, (educ == 80) | (educ == 81) ~ 13, (educ >= 90) & (educ <= 92) ~ 14, educ == 100 ~ 15, (educ == 110) | (educ == 111) ~ 16, educ == 120 ~ 18, educ == 121 ~ 17, (educ == 122) | (educ == 123) ~ 18, educ == 124 ~ 19, educ == 125 ~ 20, TRUE ~ NA_real_ 176 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
), exper = age - yrschool - 6, exper2 = exper * exper) # CHECKS RECODE OF SCHOOLING VARIABLE data %>% group_by(educ) %>% summarize(yrschool_mean = mean(yrschool, na.rm = TRUE), yrschool_n = n()) ############# EXERCISE 1 data_means <- data %>% group_by(year, sex) %>% summarize(member = weighted.mean(member, w = earnwt, na.rm = TRUE)) # BASIC GRAPH ggplot(data_means, aes(x = year, y = member, color = factor(sex))) + geom_point() + geom_line() # LABELED GRAPH ggplot(data_means, aes(x = year, y = member, color = factor(sex))) + geom_point() + geom_line() + labs(title = "Union Share, by Gender", x = "Year", y = "Fraction in Union") + scale_x_continuous(limits = c(1980, 2022), breaks = seq(from = 1980, to = 2020, by = 10)) + scale_y_continuous(limits = c(0.1, 0.25)) + scale_color_discrete(labels = c("Men", "Women"), type = c("blue", "red"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 10-1 Tidyverse.pdf") ############# EXERCISE 2 # RUNS MINCER EARNINGS FUNCTIONS, BY SEX AND YEAR # DEFINES VARIABLES THAT WILL CAPTURE THE COEFFICIENT OF UNION MEMBERSHIP reg_years <- 1984:2022 reg_results <- as.data.frame(matrix(NA, nrow = length(reg_years) * 2, ncol = 3)) colnames(reg_results) <- c("year", "sex", "rmember") for (j in c(1, 2)) { iteration_loops <- 0 for (k in reg_years) { iteration_loops <- iteration_loops + 1 177 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
data_relevant <- data %>% filter(year == k, sex == j) data_relevant_weights <- data %>% filter(year == k, sex == j) %>% pull(earnwt) reg_results_row <- (iteration_loops - 1) * 2 + j reg_results[reg_results_row, "year"] <- k reg_results[reg_results_row, "sex"] <- j reg_model <- lm(lweekly ~ yrschool + exper + exper2 + member, data = data_relevant, weights = data_relevant_weights) reg_results[reg_results_row, "rmember"] <coef(reg_model)["memberTRUE"] } } # BASIC GRAPH ggplot(reg_results, aes(x = year, y = rmember, color = factor(sex))) + geom_point() + geom_line() # LABELED GRAPH ggplot(reg_results, aes(x = year, y = rmember, color = factor(sex))) + geom_point() + geom_line() + labs(title = "Union Wage Gap, by Gender", x = "Year", y = "Log Wage Gap") + scale_x_continuous(limits = c(1980, 2022), breaks = seq(from = 1980, to = 2020, by = 10)) + scale_y_continuous(limits = c(0.075, 0.35), breaks = seq(from = 0.1, to = 0.35, by = 0.05)) + scale_color_discrete(labels = c("Men", "Women"), type = c("blue", "red"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 10-2 Tidyverse.pdf") sink()
Chapter 11, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 11 Base.log")
178 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
############################################################### # CHAPTER 11. INTERINDUSTRY WAGE DIFFERENTIALS IN THE LONG RUN ############################################################### data <- read.csv("C:/Projects/Data Explorer/data/usa_00011.csv") colnames(data) <- tolower(colnames(data)) # DATA FROM ACS 2017-2019, CENSUS 1990 AND CENSUS 1960 # CREATES THE POOLED 2017-2019 ACS CROSS-SECTIONS # POOLS THE 2017, 2018, AND 2019 CROSS-SECTIONS data <- data[which(data$year %in% c(1960, 1990, 2017, 2018, 2019)), ] # KEEPS PERSONS AGED 21-64 data <- data[which((data$age >= 21) & (data$age <= 64)), ] # VALID INDUSTRY CODE data <- data[which((data$ind1990 >= 10) & (data$ind1990 <= 932)), ] # DROPS INCWAGE = 0 OR INCWAGE MISSING data <- data[which((data$incwage > 0) & (data$incwage < 999998)), ] # DROPS PERSONS WHO DID NOT WORK data <- data[which((data$wkswork2 >= 1) & (data$wkswork2 <= 6)), ] data$weeks <- NA data$weeks[which(data$wkswork2 == 1)] <- 7 data$weeks[which(data$wkswork2 == 2)] <- 20 data$weeks[which(data$wkswork2 == 3)] <- 33 data$weeks[which(data$wkswork2 == 4)] <- 43.5 data$weeks[which(data$wkswork2 == 5)] <- 48.5 data$weeks[which(data$wkswork2 == 6)] <- 51 # USES CPI DEFLATOR, CONVERTING EARNINGS FOR 2017 - 2019 INTO 2019 DOLLARS data$cpi <- NA data$cpi[which(data$year == 2017)] <- 245.120 data$cpi[which(data$year == 2018)] <- 251.107 data$cpi[which(data$year == 2019)] <- 255.657 data$incwage[which(!is.na(data$cpi))] <data$incwage[which(!is.na(data$cpi))] * (255.657 / data$cpi[which(!is.na(data$cpi))]) data$lweekly <- log(data$incwage / data$weeks) # WILL CALL THE 2017 - 2019 CROSS-SECTION THE 2020 DATA data$year[which(data$year %in% c(2017, 2018, 2019))] <- 2020 aggregate(weeks ~ wkswork2, data = data, FUN = function(x) return(c(mean(x, na.rm = TRUE), length(x)))) # CALCULATES AVERAGE WAGE IN EACH YEAR INDUSTRY COMBINATION data$lweekly_weighted <- data$lweekly * data$perwt data_means <- aggregate(cbind(lweekly_weighted, perwt) ~ year + ind1990, 179 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
data = data, FUN = sum) data_means$lweekly <- data_means$lweekly_weighted / data_means$perwt data_means <- data_means[, c("year", "ind1990", "lweekly")] data_means <- reshape(data_means, direction = "wide", idvar = "ind1990", timevar = "year") cor(data_means[ , c("lweekly.1960", "lweekly.1990", "lweekly.2020")], use = "pairwise.complete.obs") # BASIC GRAPH FOR 1990 - 2020 plot(data_means$lweekly.1990, data_means$lweekly.2020) # BASIC GRAPH FOR 1960 - 2020 plot(data_means$lweekly.1960, data_means$lweekly.2020) # LABELED GRAPH FOR 1990 - 2020 plot(data_means$lweekly.1990, data_means$lweekly.2020, pch = 19, main = "Persistence of Industry Wages, 1990-2020", ylab = "Log Weekly Wage, 2020", xlab = "Log Weekly Wage, 1990", xlim = c(4.5, 6.75), ylim = c(5.5, 7.5)) graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 11-1 Base.pdf") print(graph_1) dev.off() # LABELED GRAPH FOR 1960 - 2020 plot(data_means$lweekly.1960, data_means$lweekly.2020, pch = 19, main = "Persistence of Industry Wages, 1960-2020", ylab = "Log Weekly Wage, 2020", xlab = "Log Weekly Wage, 1960", xlim = c(2.5, 5), ylim = c(5.5, 7.5)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 11-2 Base.pdf") print(graph_2) dev.off() sink()
Chapter 11, Tidyverse sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 11 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) ############################################################### # CHAPTER 11. INTERINDUSTRY WAGE DIFFERENTIALS IN THE LONG RUN
180 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
############################################################### data <- read_csv("C:/Projects/Data Explorer/data/usa_00011.csv") colnames(data) <- tolower(colnames(data)) # DATA FROM ACS 2017-2019, CENSUS 1990 AND CENSUS 1960 # CREATES THE POOLED 2017-2019 ACS CROSS-SECTIONS # POOLS THE 2017, 2018, AND 2019 CROSS-SECTIONS # KEEPS PERSONS AGED 21-64 # VALID INDUSTRY CODE # DROPS INCWAGE = 0 OR INCWAGE MISSING # DROPS PERSONS WHO DID NOT WORK # USES CPI DEFLATOR, CONVERTING EARNINGS FOR 2017 - 2019 INTO 2019 DOLLARS # WILL CALL THE 2017 - 2019 CROSS-SECTION THE 2020 DATA data <- data %>% filter(year %in% c(1960, 1990, 2017, 2018, 2019), (age >= 21) & (age <= 64), (ind1990 >= 10) & (ind1990 <= 932), (incwage > 0) & (incwage < 999998), (wkswork2 >= 1) & (wkswork2 <= 6)) %>% mutate(weeks = case_when( wkswork2 == 1 ~ 7, wkswork2 == 2 ~ 20, wkswork2 == 3 ~ 33, wkswork2 == 4 ~ 43.5, wkswork2 == 5 ~ 48.5, wkswork2 == 6 ~ 51, TRUE ~ NA_real_ ), cpi = case_when( year == 2017 ~ 245.120, year == 2018 ~ 251.107, year == 2019 ~ 255.657, TRUE ~ NA_real_ ), incwage = if_else(year %in% c(2017, 2018, 2019), incwage * (255.657 / cpi), incwage), lweekly = log(incwage / weeks), year = if_else(year %in% c(2017, 2018, 2019), 2020, year)) data %>% group_by(wkswork2) %>% summarize(mean_weeks = mean(weeks, na.rm = TRUE), n_weeks = n()) # CALCULATES AVERAGE WAGE IN EACH YEAR INDUSTRY COMBINATION data_means <- data %>% group_by(year, ind1990) %>% summarize(lweekly = weighted.mean(lweekly, w = perwt, na.rm = TRUE)) %>% pivot_wider(id_cols = c("ind1990"), names_from = "year", names_prefix = "lweekly_", values_from = "lweekly") cor(data_means[ , c("lweekly_1960", "lweekly_1990", "lweekly_2020")], use = "pairwise.complete.obs")
181 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# BASIC GRAPH FOR 1990 - 2020 ggplot(data_means, aes(x = lweekly_1990, y = lweekly_2020)) + geom_point() # BASIC GRAPH FOR 1960 - 2020 ggplot(data_means, aes(x = lweekly_1960, y = lweekly_2020)) + geom_point() # LABELED GRAPH FOR 1990 - 2020 ggplot(data_means, aes(x = lweekly_1990, y = lweekly_2020)) + geom_point() + labs(title = "Persistence of Industry Wages, 1990-2020", x = "Log Weekly Wage, 1990", y = "Log Weekly Wage, 2020") + scale_x_continuous(limits = c(4.5, 6.75), breaks = seq(from = 4.5, to = 6.5, by = 0.5)) + scale_y_continuous(limits = c(5.5, 7.5), breaks = seq(from = 5.5, to = 7.5, by = 0.5)) + theme(plot.title = element_text(hjust = 0.5)) ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 11-1 Tidyverse.pdf") # LABELED GRAPH FOR 1960 - 2020 ggplot(data_means, aes(x = lweekly_1960, y = lweekly_2020)) + geom_point() + labs(title = "Persistence of Industry Wages, 1960-2020", x = "Log Weekly Wage, 1960", y = "Log Weekly Wage, 2020") + scale_x_continuous(limits = c(2.5, 5), breaks = seq(from = 2.5, to = 5, by = 0.5)) + scale_y_continuous(limits = c(5.5, 7.5), breaks = seq(from = 5.5, to = 7.5, by = 0.5)) + theme(plot.title = element_text(hjust = 0.5)) ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 11-2 Tidyverse.pdf") sink()
Chapter 12, Base sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 12 Base.log") #################################################################### # CHAPTER 12. THE GREAT RECESSION, THE PANDEMIC, AND UNEMPLOYMENT #################################################################### data <- read.csv("C:/Projects/Data Explorer/data/cps_00012.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 16-69 data <- data[which((data$age >= 16) & (data$age <= 69)), ]
182 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# KEEPS PERSONS IN LABOR FORCE data <- data[which(data$labforce == 2), ] # DEFINES AN UNEMPLOYMENT INDICATOR data$unemp <- (data$empstat >= 20) & (data$empstat <= 22) # KEEPS PERIOD BEFORE AND AFTER THE GREAT RECESSION # KEEPS PERIOD BEFORE AND AFTER THE PANDEMIC data <- data[which((data$year %in% c(2007, 2010, 2019)) | ((data$year == 2020) & (data$month >= 4) & (data$month <= 9))), ] # AGE RECODE data$agecode <- NA data$agecode[which((data$age >= 16) & (data$age <= 19))] <- 1 data$agecode[which((data$age >= 20) & (data$age <= 29))] <- 2 data$agecode[which((data$age >= 30) & (data$age <= 39))] <- 3 data$agecode[which((data$age >= 40) & (data$age <= 49))] <- 4 data$agecode[which((data$age >= 50) & (data$age <= 59))] <- 5 data$agecode[which((data$age >= 60) & (data$age <= 69))] <- 6 table(data$age, data$agecode) # EDUCATION RECODE data$eductype <- 1 * (data$educ <= 60) + 2 * ((data$educ >= 70) & (data$educ <= 73)) + 3 * ((data$educ >= 80) & (data$educ <= 100)) + 4 * (data$educ == 111) + 5 * (data$educ >= 123) table(data$educ, data$eductype) data$unemp_weighted <- data$unemp * data$wtfinl # GRAPHS BY AGE data_means_1 <- aggregate(cbind(unemp_weighted, wtfinl) ~ year + agecode, data = data, FUN = sum) data_means_1$unemp <- data_means_1$unemp_weighted / data_means_1$wtfinl data_means_1 <- data_means_1[, c("year", "agecode", "unemp")] data_means_1 <- reshape(data_means_1, direction = "wide", idvar = "agecode", timevar = "year") # LABELED GRAPH FOR 2007 - 2010, BY AGE plot(data_means_1$agecode, data_means_1$unemp.2007, type = "o", pch = 19, main = "Unemployment Rate in the Great Recession, by Age", ylab = "Unemployment Rate", xlab = "Age", xlim = c(1, 6), ylim = c(0.025, 0.255), col = "blue") lines(data_means_1$agecode, data_means_1$unemp.2010, type = "o", pch = 19, col = "red") legend("topright", legend = c("2007", "2010"), col = c("blue", "red"), lty = c(1, 1)) 183 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
graph_1 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 12-1 Base.pdf") print(graph_1) dev.off() # LABELED GRAPH FOR 2019 - 2020, BY AGE plot(data_means_1$agecode, data_means_1$unemp.2019, type = "o", pch = 19, main = "Unemployment Rate in the Pandemic, by Age", ylab = "Unemployment Rate", xlab = "Age", xlim = c(1, 6), ylim = c(0, 0.25), col = "blue") lines(data_means_1$agecode, data_means_1$unemp.2020, type = "o", pch = 19, col = "red") legend("topright", legend = c("2019", "2020"), col = c("blue", "red"), lty = c(1, 1)) graph_2 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 12-2 Base.pdf") print(graph_2) dev.off() # GRAPHS BY EDUCATION data_means_2 <- aggregate(cbind(unemp_weighted, wtfinl) ~ year + eductype, data = data, FUN = sum) data_means_2$unemp <- data_means_2$unemp_weighted / data_means_2$wtfinl data_means_2 <- data_means_2[, c("year", "eductype", "unemp")] data_means_2 <- reshape(data_means_2, direction = "wide", idvar = "eductype", timevar = "year") # LABELED GRAPH FOR 2007 - 2010, BY EDUCATION plot(data_means_2$eductype, data_means_2$unemp.2007, type = "o", pch = 19, main = "Unemployment Rate in the Great Recession, by Education", ylab = "Unemployment Rate", xlab = "Education Group", xlim = c(1, 5), ylim = c(0, 0.2), col = "blue") lines(data_means_2$eductype, data_means_2$unemp.2010, type = "o", pch = 19, col = "red") legend("topright", legend = c("2007", "2010"), col = c("blue", "red"), lty = c(1, 1)) graph_3 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 12-3 Base.pdf") print(graph_3) dev.off()
184 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# LABELED GRAPH FOR 2019 - 2020, BY EDUCATION plot(data_means_2$eductype, data_means_2$unemp.2019, type = "o", pch = 19, main = "Unemployment Rate in the Pandemic, by Education", ylab = "Unemployment Rate", xlab = "Education Group", xlim = c(1, 5), ylim = c(0, 0.2), col = "blue") lines(data_means_2$eductype, data_means_2$unemp.2020, type = "o", pch = 19, col = "red") legend("topright", legend = c("2019", "2020"), col = c("blue", "red"), lty = c(1, 1)) graph_4 <- recordPlot() pdf("C:/Projects/Data Explorer/R Figures/Data Explorer 12-4 Base.pdf") print(graph_4) dev.off() sink()
Chapter 12, Tidyverse sink("C:/Projects/Data Explorer/R Files/log/Data Explorer 12 Tidyverse.log") library(tidyverse) options(dplyr.print_max = 1e9) #################################################################### # CHAPTER 12. THE GREAT RECESSION, THE PANDEMIC, AND UNEMPLOYMENT #################################################################### data <- read_csv("C:/Projects/Data Explorer/data/cps_00012.csv") colnames(data) <- tolower(colnames(data)) # KEEPS AGE 16-69 # KEEPS PERSONS IN LABOR FORCE # KEEPS PERIOD BEFORE AND AFTER THE GREAT RECESSION # KEEPS PERIOD BEFORE AND AFTER THE PANDEMIC # DEFINES AN UNEMPLOYMENT INDICATOR # AGE RECODE # EDUCATION RECODE data <- data %>% filter((age >= 16) & (age <= 69), labforce == 2, (year %in% c(2007, 2010, 2019)) | ((year==2020) & (month >= 4) & (month <= 9))) %>% mutate(unemp = (empstat >= 20) & (empstat <= 22), agecode = case_when( (age >= 16) & (age <= 19) ~ 1, (age >= 20) & (age <= 29) ~ 2, (age >= 30) & (age <= 39) ~ 3, (age >= 40) & (age <= 49) ~ 4,
185 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(age >= 50) & (age <= 59) ~ 5, (age >= 60) & (age <= 69) ~ 6, TRUE ~ NA_real_ ), eductype = 1 * (educ <= 60) + 2 * ((educ >= 70) & (educ <= 73)) + 3 * ((educ >= 80) & (educ <= 100)) + 4 * (educ == 111) + 5 * (educ >= 123)) table(data$age, data$agecode) table(data$educ, data$eductype) # GRAPHS BY AGE data_means_1 <- data %>% group_by(year, agecode) %>% summarize(unemp = weighted.mean(unemp, w = wtfinl, na.rm = TRUE)) # BASIC GRAPH FOR 2007 - 2010, BY AGE ggplot(data_means_1 %>% filter(year %in% c(2007, 2010)), aes(x = agecode, y = unemp, color = factor(year))) + geom_point() + geom_line() # LABELED GRAPH FOR 2007 - 2010, BY AGE ggplot(data_means_1 %>% filter(year %in% c(2007, 2010)), aes(x = agecode, y = unemp, color = factor(year))) + geom_point() + geom_line() + labs(title = "Unemployment Rate in the Great Recession, by Age", x = "Age", y = "Unemployment Rate") + scale_x_continuous(limits = c(1, 6), breaks = seq(from = 1, to = 6, by = 1)) + scale_y_continuous(limits = c(0.025, 0.255), breaks = seq(from = 0.05, to = 0.25, by = 0.05)) + scale_color_discrete(labels = c("2007", "2010"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 12-1 Tidyverse.pdf") # BASIC GRAPH FOR 2019 - 2020, BY AGE ggplot(data_means_1 %>% filter(year %in% c(2019, 2020)), aes(x = agecode, y = unemp, color = factor(year))) + geom_point() + geom_line() # LABELED GRAPH FOR 2019 - 2020, BY AGE ggplot(data_means_1 %>% filter(year %in% c(2019, 2020)), aes(x = agecode, y = unemp, color = factor(year))) + geom_point() + 186 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
geom_line() + labs(title = "Unemployment Rate in the Pandemic, by Age", x = "Age", y = "Unemployment Rate") + scale_x_continuous(limits = c(1, 6), breaks = seq(from = 1, to = 6, by = 1)) + scale_y_continuous(limits = c(0, 0.25), breaks = seq(from = 0, to = 0.25, by = 0.05)) + scale_color_discrete(labels = c("2019", "2020"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 12-2 Tidyverse.pdf") # GRAPHS BY EDUCATION data_means_2 <- data %>% group_by(year, eductype) %>% summarize(unemp = weighted.mean(unemp, w = wtfinl, na.rm = TRUE)) # BASIC GRAPH FOR 2007 - 2010, BY EDUCATION ggplot(data_means_2 %>% filter(year %in% c(2007, 2010)), aes(x = eductype, y = unemp, color = factor(year))) + geom_point() + geom_line() # LABELED GRAPH FOR 2007 - 2010, BY EDUCATION ggplot(data_means_2 %>% filter(year %in% c(2007, 2010)), aes(x = eductype, y = unemp, color = factor(year))) + geom_point() + geom_line() + labs(title = "Unemployment Rate in the Great Recession, by Education", x = "Education Group", y = "Unemployment Rate") + scale_x_continuous(limits = c(1, 5), breaks = seq(from = 1, to = 5, by = 1)) + scale_y_continuous(limits = c(0, 0.2), breaks = seq(from = 0, to = 0.2, by = 0.05)) + scale_color_discrete(labels = c("2007", "2010"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 12-3 Tidyverse.pdf") # BASIC GRAPH FOR 2019 - 2020, BY EDUCATION ggplot(data_means_2 %>% filter(year %in% c(2019, 2020)), aes(x = eductype, y = unemp, color = factor(year))) + geom_point() + geom_line()
187 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
# LABELED GRAPH FOR 2019 - 2020, BY EDUCATION ggplot(data_means_2 %>% filter(year %in% c(2019, 2020)), aes(x = eductype, y = unemp, color = factor(year))) + geom_point() + geom_line() + labs(title = "Unemployment Rate in the Pandemic, by Education", x = "Education Group", y = "Unemployment Rate") + scale_x_continuous(limits = c(1, 5), breaks = seq(from = 1, to = 5, by = 1)) + scale_y_continuous(limits = c(0, 0.2), breaks = seq(from = 0, to = 0.2, by = 0.05)) + scale_color_discrete(labels = c("2019", "2020"), name = "") + theme(plot.title = element_text(hjust = 0.5), legend.position = "bottom") ggsave("C:/Projects/Data Explorer/R Figures/Data Explorer 12-4 Tidyverse.pdf") sink()
Solutions to Data Explorers: Chapter 1
188 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
189 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 2
190 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
191 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 3
192 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
193 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 4
194 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
195 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 5 . . *************************************************** . *CHAPTER 5. COMPENSATING DIFFERENTIALS AND THE NIGHT SHIFT . *************************************************** . . . use "/Volumes/Ddisk/ipumscps/may2004/cpsmay2004.dta", clear . . *KEEPS PERSONS AGED 16-64 . keep if age>=16 & age<=64 (48,741 observations deleted) . . *EXCLUDES PERSONS NOT IN ORG . keep if paidhour==1 | paidhour==2 (75,035 observations deleted) . . *EDUCATION RECODE . generate eductype=1*(educ<=60) + 2*(educ>=70 & educ<=73) + 3*(educ>=80 & educ<=1 > 00) + 4*(educ>=110) . tabulate educ eductype
196 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Educational | eductype attainment recode | 1 2 3 4 | Total ----------------------+--------------------------------------------+--------None or preschool | 23 0 0 0 | 23 Grades 1, 2, 3, or 4 | 74 0 0 0 | 74 Grades 5 or 6 | 161 0 0 0 | 161 Grades 7 or 8 | 136 0 0 0 | 136 Grade 9 | 251 0 0 0 | 251 Grade 10 | 374 0 0 0 | 374 Grade 11 | 484 0 0 0 | 484 12th grade, no diplom | 0 212 0 0 | 212 High school diploma o | 0 4,512 0 0 | 4,512 Some college but no d | 0 0 2,894 0 | 2,894 Associate's degree, o | 0 0 750 0 | 750 Associate's degree, a | 0 0 597 0 | 597 Bachelor's degree | 0 0 0 2,821 | 2,821 Master's degree | 0 0 0 958 | 958 Professional school d | 0 0 0 191 | 191 Doctorate degree | 0 0 0 167 | 167 ----------------------+--------------------------------------------+--------Total | 1,503 4,724 4,241 4,137 | 14,605 . . *DEFINE HOURLY WAGE RATE FOR ALL WORKERS, NOT JUST THOSE PAID BY HOUR . generate hourlywage = . (14,605 missing values generated) . replace hourlywage = earnweek/uhrswork1 if earnweek>0 & earnweek<9999.99 & uhrsw > ork1>0 & uhrswork1<997 & paidhour==1 (5,446 real changes made) . replace hourlywage = hourwage if hourwage>0 & hourwage<99 & paidhour==2 197 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
(8,741 real changes made) . . tabulate paidhour [aw=earnwt], sum(hourlywage) Paid by the | Summary of hourlywage hour | Mean Std. dev. Freq. Obs ------------+-----------------------------------------------No | 22.523971 13.198171 45248273 5,446 Yes | 12.966058 7.2476501 71082756 8,741 ------------+-----------------------------------------------Total | 16.683717 11.025211 116331029 14,187 . generate lhourly=log(hourlywage) (418 missing values generated) . drop if lhourly==. (418 observations deleted) . . tabulate paidhour [aw=earnwt], sum(hourlywage) Paid by the | Summary of hourlywage hour | Mean Std. dev. Freq. Obs ------------+-----------------------------------------------No | 22.523971 13.198171 45248273 5,446 Yes | 12.966058 7.2476501 71082756 8,741 ------------+-----------------------------------------------Total | 16.683717 11.025211 116331029 14,187 . . *DROPS PERSONS WHO DO NOT REPORT SHIFT; . drop if wsregshft>2 (1,590 observations deleted) . . . *GROUPS WORKERS INTO AGE GROUPS; . recode age (16/20 = 1) (21/30 = 2) (31/40 = 3) (41/50 = 4) (51/64 = 5), gen(aget > ype) (12597 differences between age and agetype) . . *CREATES VARIABLE INDICATING PERSON DOES NOT WORK REGULAR DAY SHIFT . generate irregular=(wsregshft==1) . . . *SELECTS 4 OCCUPATIONS WITH LARGE SAMPLES AND INCIDENCE OF IRREGULAR SHIFTS . *REGISTERED NURSES, CASHIERS, COOKS, TRUCK DRIVERS . gen goodocc=(occ1990==95 | occ1990==276 | occ1990==436 | occ1990==804)
198 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
. . . . **********************EXERCISE 1 . . tabulate eductype [aw=wssuppwt], sum(irregular) | Summary of irregular eductype | Mean Std. dev. Freq. Obs ------------+-----------------------------------------------1 | .27847143 .44842148 3,229,579 1,283 2 | .18549391 .38874567 9,308,804 4,054 3 | .20168697 .4013141 8,419,300 3,688 4 | .08941756 .28538546 8,121,555 3,572 ------------+-----------------------------------------------Total | .17367528 .37884505 29,079,239 12,597 . . . **********************EXERCISE 2 . . tabulate agetype [aw=wssuppwt], sum(irregular) RECODE of | Summary of irregular age (Age) | Mean Std. dev. Freq. Obs ------------+-----------------------------------------------1 | .49453471 .50026242 1,976,336 856 2 | .20958873 .40709379 6,712,993 2,587 3 | .14134656 .34843713 7,236,748 2,981 4 | .12233747 .32772239 7,406,111 3,470 5 | .12825295 .33443312 5,747,051 2,703 ------------+-----------------------------------------------Total | .17367528 .37884505 29,079,239 12,597 . . . . . **********************EXERCISE 3 . . tabulate eductype irregular [aw=earnwt], sum(lhourly) me noobs Means of lhourly | irregular eductype | 0 1 | Total -----------+----------------------+---------1 | 2.218133 2.0298154 | 2.1652036 2 | 2.5159262 2.3484457 | 2.4852607 3 | 2.6484771 2.3342779 | 2.5859717 4 | 3.0908444 2.7644271 | 3.0612356 -----------+----------------------+---------Total | 2.7008919 2.3467557 | 2.6397073
199 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
. . . . **********************EXERCISE 4 . . tabulate occ1990 [aw=wssuppwt] if goodocc==1, sum(irregular) Occupation, | Summary of irregular 1990 basis | Mean Std. dev. Freq. Obs ------------+-----------------------------------------------Registere | .26598134 .44271989 554,296 256 Cashiers | .48531386 .50070894 684,981 271 Cooks, va | .38176742 .48660042 741,612 312 Truck, de | .29814163 .45810642 825,234 345 ------------+-----------------------------------------------Total | .35957905 .4800798 2,806,124 1,184 . . . . **********************EXERCISE 5 . . tabulate occ1990 irregular if goodocc==1 [aw=earnwt], sum(lhourly) me noobs Means of lhourly Occupation | , 1990 | irregular basis | 0 1 | Total -----------+----------------------+---------Registere | 3.1380661 3.0915013 | 3.1255458 Cashiers | 2.1133862 1.99102 | 2.0541593 Cooks, va | 2.2783758 2.0960599 | 2.2083204 Truck, de | 2.5571568 2.542559 | 2.5528827 -----------+----------------------+---------Total | 2.5320089 2.3182463 | 2.4554229 . . . log close name: <unnamed> log: /Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Fil > es/Data Explorer 5.log log type: text closed on: 11 Jan 2022, 10:13:43 ---------------------------------------------------------------------------------
Chapter 6 200 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
. . *************************************************** . *CHAPTER 6. WAGE DIFFERENCES ACROSS COLLEGE MAJORS . *************************************************** . . . use /volumes/ddisk/ipumsacs/data/acs.dta, clear . . keep if year==2019 (47,790,499 observations deleted) . . *KEEPS PERSONS NOT ENROLLED IN SCHOOL . keep if school==1 (828,256 observations deleted) . . *KEEPS PERSONS AGED 21-30 . keep if (age>=21 & age<=30) (2,123,841 observations deleted) . . *KEEPS PERSONS WITH A BACHELOR'S DEGREE . keep if educ==10 (214,746 observations deleted) . . *DROPS INCWAGE = 0 OR INCWAGE MISSING . keep if incwage>0 & incwage<999998 (5,248 observations deleted) . . *DEFINES LOG ANNUAL EARNINGS . generate lannual=log(incwage) . . . *KEEPS "lARGE" MAJORS THAT HAVE MORE THAN 300 OBSERVATIONS IN 2019 . . tabulate degfield Field of degree [general version] | Freq. Percent Cum. ----------------------------------------+----------------------------------Agriculture | 949 1.41 1.41 Environment and Natural Resources | 803 1.19 2.60 Architecture | 374 0.55 3.15 Area, Ethnic, and Civilization Studies | 260 0.39 3.54 Communications | 4,401 6.52 10.06 Communication Technologies | 241 0.36 10.42 Computer and Information Sciences | 3,019 4.48 14.89 Cosmetology Services and Culinary Arts | 130 0.19 15.09 Education Administration and Teaching | 4,096 6.07 21.16 Engineering | 5,488 8.13 29.29 Engineering Technologies | 450 0.67 29.96 Linguistics and Foreign Languages | 550 0.82 30.77 Family and Consumer Sciences | 603 0.89 31.67 Law | 92 0.14 31.80 English Language, Literature, and Compo | 1,659 2.46 34.26 Liberal Arts and Humanities | 694 1.03 35.29 Library Science | 7 0.01 35.30
201 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Biology and Life Sciences | 3,276 4.86 40.16 Mathematics and Statistics | 794 1.18 41.34 Military Technologies | 3 0.00 41.34 Interdisciplinary and Multi-Disciplinar | 837 1.24 42.58 Physical Fitness, Parks, Recreation, an | 1,470 2.18 44.76 Philosophy and Religious Studies | 305 0.45 45.21 Theology and Religious Vocations | 255 0.38 45.59 Physical Sciences | 1,436 2.13 47.72 Nuclear, Industrial Radiology, and Biol | 32 0.05 47.77 Psychology | 3,247 4.81 52.58 Criminal Justice and Fire Protection | 1,987 2.95 55.52 Public Affairs, Policy, and Social Work | 706 1.05 56.57 Social Sciences | 4,792 7.10 63.67 Construction Services | 231 0.34 64.02 Electrical and Mechanic Repairs and Tec | 34 0.05 64.07 Transportation Sciences and Technologie | 202 0.30 64.37 Fine Arts | 4,140 6.14 70.50 Medical and Health Sciences and Service | 5,102 7.56 78.07 Business | 13,781 20.43 98.49 History | 1,016 1.51 100.00 ----------------------------------------+----------------------------------Total | 67,462 100.00 . . egen nobs=count(lannual), by(degfield) . drop if nobs<300 (1,487 observations deleted) . . tabulate degfield Field of degree [general version] | Freq. Percent Cum. ----------------------------------------+----------------------------------Agriculture | 949 1.44 1.44 Environment and Natural Resources | 803 1.22 2.66 Architecture | 374 0.57 3.22 Communications | 4,401 6.67 9.89 Computer and Information Sciences | 3,019 4.58 14.47 Education Administration and Teaching | 4,096 6.21 20.68 Engineering | 5,488 8.32 29.00 Engineering Technologies | 450 0.68 29.68 Linguistics and Foreign Languages | 550 0.83 30.51 Family and Consumer Sciences | 603 0.91 31.43 English Language, Literature, and Compo | 1,659 2.51 33.94 Liberal Arts and Humanities | 694 1.05 34.99 Biology and Life Sciences | 3,276 4.97 39.96 Mathematics and Statistics | 794 1.20 41.16 Interdisciplinary and Multi-Disciplinar | 837 1.27 42.43 Physical Fitness, Parks, Recreation, an | 1,470 2.23 44.66 Philosophy and Religious Studies | 305 0.46 45.12 Physical Sciences | 1,436 2.18 47.30 Psychology | 3,247 4.92 52.22 Criminal Justice and Fire Protection | 1,987 3.01 55.23 Public Affairs, Policy, and Social Work | 706 1.07 56.30 Social Sciences | 4,792 7.26 63.56 Fine Arts | 4,140 6.28 69.84 Medical and Health Sciences and Service | 5,102 7.73 77.57 Business | 13,781 20.89 98.46 History | 1,016 1.54 100.00 ----------------------------------------+----------------------------------Total | 65,975 100.00
202 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
. . . *SAVES DATA FOR FURTHER REUSE . save /volumes/ddisk/data/acsdata.dta, replace file /volumes/ddisk/data/acsdata.dta saved . . . *********************EXERCISE 1 . . use /volumes/ddisk/data/acsdata.dta, clear . . collapse (mean) lannual [aw=perwt], by(degfield) . . gsort - lannual . list degfield lannual +-----------------------------------------------------------------------+ | degfield lannual | |-----------------------------------------------------------------------| 1. | Engineering 10.86687 | 2. | Computer and Information Sciences 10.79799 | 3. | Architecture 10.7663 | 4. | Engineering Technologies 10.72053 | 5. | Mathematics and Statistics 10.64769 | |-----------------------------------------------------------------------| 6. | Business 10.62112 | 7. | Medical and Health Sciences and Services 10.53803 | 8. | Social Sciences 10.52385 | 9. | Agriculture 10.46606 | 10. | Communications 10.44969 | |-----------------------------------------------------------------------| 11. | Physical Sciences 10.44598 | 12. | Criminal Justice and Fire Protection 10.41834 | 13. | Philosophy and Religious Studies 10.345 | 14. | History 10.33615 | 15. | Interdisciplinary and Multi-Disciplinary Studies (General) 10.33483 | |-----------------------------------------------------------------------| 16. | Public Affairs, Policy, and Social Work 10.31035 | 17. | Environment and Natural Resources 10.30045 | 18. | Education Administration and Teaching 10.28708 | 19. | Liberal Arts and Humanities 10.27729 | 20. | Biology and Life Sciences 10.27596 | |-----------------------------------------------------------------------| 21. | English Language, Literature, and Composition 10.25035 | 22. | Linguistics and Foreign Languages 10.24501 | 23. | Physical Fitness, Parks, Recreation, and Leisure 10.24085 | 24. | Psychology 10.22307 | 25. | Fine Arts 10.20533 | |-----------------------------------------------------------------------| 26. | Family and Consumer Sciences 10.16557 | +-----------------------------------------------------------------------+ . . . . . *********************EXERCISE 2 . . use /volumes/ddisk/data/acsdata.dta, clear
203 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
. . tabulate degfield sex [aw=perwt] Field of degree | Sex [general version] | Male Female | Total ----------------------+----------------------+---------Agriculture | 416.05655 334.39828 | 750.45483 Environment and Natur | 380.66306 341.30755 | 721.97062 Architecture | 211.88441 180.61178 | 392.49619 Communications | 1,518.884 2,862.919 | 4,381.803 Computer and Informat | 2,374.787 627.790945 | 3,002.578 Education Administrat | 883.02818 3,137.234 |4,020.2622 Engineering | 4,223.481 1,116.426 |5,339.9071 Engineering Technolog | 341.02518 77.440345 | 418.46553 Linguistics and Forei | 163.20182 338.45737 | 501.65919 Family and Consumer S | 63.789455 531.23759 | 595.02704 English Language, Lit | 448.30865 1,129.371 | 1,577.679 Liberal Arts and Huma | 294.17801 486.843517 | 781.02153 Biology and Life Scie | 1,258.088 1,955.898 | 3,213.986 Mathematics and Stati | 508.08314 269.20579 | 777.28893 Interdisciplinary and | 254.17834 595.94475 | 850.12309 Physical Fitness, Par | 862.28271 656.44281 | 1,518.726 Philosophy and Religi | 223.62929 87.023323 | 310.65261 Physical Sciences | 916.23329 671.57615 | 1,587.809 Psychology | 822.46835 2,494.857 | 3,317.325 Criminal Justice and | 1,268.139 844.57273 | 2,112.711 Public Affairs, Polic | 144.4153 601.64512 | 746.06042 Social Sciences | 2,592.116 2,167.05 | 4,759.166 Fine Arts | 1,569.023 2,399.998 | 3,969.021 Medical and Health Sc | 870.93916 4,345.272 | 5,216.211 Business | 7,912.778 6,249.143 | 14,161.92 History | 592.10626 358.5675 | 950.67377 ----------------------+----------------------+---------Total | 31,113.77 34,861.23 | 65,975 . . generate female=(sex==2) . . *DEFINES ANNUAL WAGES SPECIFICALLY FOR MEN AND WOMEN . generate lannual1=lannual . generate lannual2=lannual . replace lannual1=. if sex==2 (35,338 real changes made, 35,338 to missing) . replace lannual2=. if sex==1 (30,637 real changes made, 30,637 to missing) . . collapse (mean) lannual1 lannual2 female [aw=perwt], by(degfield) . . generate gendergap=lannual1-lannual2 . . corr lannual1 lannual2 (obs=26) | lannual1 lannual2 -------------+------------------
204 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
lannual1 | lannual2 |
1.0000 0.8897
1.0000
. . gsort - gendergap . . list degfield gendergap +------------------------------------------------------------------------+ | degfield gendergap | |------------------------------------------------------------------------| 1. | Agriculture .3172417 | 2. | Physical Fitness, Parks, Recreation, and Leisure .2953997 | 3. | History .2557859 | 4. | Criminal Justice and Fire Protection .2354383 | 5. | Social Sciences .2037468 | |------------------------------------------------------------------------| 6. | Engineering Technologies .1981926 | 7. | Family and Consumer Sciences .1905575 | 8. | Computer and Information Sciences .1804895 | 9. | Business .1791658 | 10. | Psychology .1707945 | |------------------------------------------------------------------------| 11. | Physical Sciences .1593409 | 12. | Environment and Natural Resources .1510754 | 13. | Education Administration and Teaching .1399851 | 14. | Biology and Life Sciences .1365128 | 15. | Interdisciplinary and Multi-Disciplinary Studies (General) .1335411 | |------------------------------------------------------------------------| 16. | English Language, Literature, and Composition .1279964 | 17. | Liberal Arts and Humanities .1059923 | 18. | Engineering .0989122 | 19. | Architecture .0977478 | 20. | Medical and Health Sciences and Services .0948629 | |------------------------------------------------------------------------| 21. | Public Affairs, Policy, and Social Work .0644064 | 22. | Philosophy and Religious Studies .0552092 | 23. | Fine Arts .0538454 | 24. | Linguistics and Foreign Languages .0195322 | 25. | Mathematics and Statistics -.0278282 | |------------------------------------------------------------------------| 26. | Communications -.0574608 | +------------------------------------------------------------------------+ . . . . . *********************EXERCISE 3 . . scatter lannual1 female . . #delimit; delimiter now ; . *LABELED GRAPH; . twoway scatter lannual1 female, > title("Male Earnings and Femaleness of Field") > ytitle("Log Annual Earnings") > xtitle("Percent Female in Field") ;
205 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
. graph export > "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/ > Data Explorer 6-1.pdf", replace ; file /Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 6-1.pdf saved as PDF format . #delimit cr delimiter now cr . . . . . *********************EXERCISE 4 . . . . . use /volumes/ddisk/data/acsdata.dta, clear . . *SEPARATES OUT ECONOMICS MAJORS . *RECODE ECONOMICS MAJORS AS DEGFIELD = 1 . *SO DEGFIELD = 55 IS NOW ALL SOCIAL SCIENCE MAJORS, EXCEPT ECONOMICS . . replace degfield=1 if degfieldd==5501 (1,447 real changes made) . . collapse (mean) lannual [aw=perwt], by(degfield) . . gsort - lannual . list degfield lannual +-----------------------------------------------------------------------+ | degfield lannual | |-----------------------------------------------------------------------| 1. | Engineering 10.86687 | 2. | Computer and Information Sciences 10.79799 | 3. | 1 10.78245 | 4. | Architecture 10.7663 | 5. | Engineering Technologies 10.72053 | |-----------------------------------------------------------------------| 6. | Mathematics and Statistics 10.64769 | 7. | Business 10.62112 | 8. | Medical and Health Sciences and Services 10.53803 | 9. | Agriculture 10.46606 | 10. | Communications 10.44969 | |-----------------------------------------------------------------------| 11. | Physical Sciences 10.44598 | 12. | Criminal Justice and Fire Protection 10.41834 | 13. | Social Sciences 10.40849 | 14. | Philosophy and Religious Studies 10.345 | 15. | History 10.33615 | |-----------------------------------------------------------------------| 16. | Interdisciplinary and Multi-Disciplinary Studies (General) 10.33483 | 17. | Public Affairs, Policy, and Social Work 10.31035 | 18. | Environment and Natural Resources 10.30045 | 19. | Education Administration and Teaching 10.28708 | 20. | Liberal Arts and Humanities 10.27729 | |-----------------------------------------------------------------------| 21. | Biology and Life Sciences 10.27596 |
206 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
22. | English Language, Literature, and Composition 10.25035 | 23. | Linguistics and Foreign Languages 10.24501 | 24. | Physical Fitness, Parks, Recreation, and Leisure 10.24085 | 25. | Psychology 10.22307 | |-----------------------------------------------------------------------| 26. | Fine Arts 10.20533 | 27. | Family and Consumer Sciences 10.16557 | +-----------------------------------------------------------------------+ . . . . . log close name: <unnamed> log: /Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Fil > es/Data Explorer 6.log log type: text closed on: 11 Jan 2022, 08:47:37 ----------------------------------------------------------------------------------
Chapter 7
207 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
208 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 8
209 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 9
210 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
211 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
212 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 10
213 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 11
214 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
Chapter 12
215 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
DATA EXPLORER: STATA FILES (.do) 216 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 1.log", replace *************************************************** *CHAPTER 1. THE RETURNS TO A COLLEGE EDUCATION *************************************************** use "/Volumes/Ddisk/IPUMSCPS/Data/cps62-21.dta", clear *KEEPS AGE 21-30 keep if age>=21 & age<=30 *STARTS SAMPLE IN 1964 keep if year>=1964 *EXCLUDES INVALID VALUES OF ANNUAL EARNINGS keep if incwage>0 & incwage<99999998 *DEFINES LOG ANNUAL EARNINGS generate lannual=log(incwage) *INDICATOR FOR A COLLEGE EDUCATION *SAMPLE CONSISTS OF PERSONS WITH HIGH SCHOOL OR COLLEGE EDUCATION keep if (educ>=70 & educ<=73) | (educ==110 | educ==111) generate college=(educ>73) tabulate educ, sum(college) *GETS RID OF PERSONS WITH NEGATIVE WEIGHTS replace asecwt=0 if asecwt<0 collapse (mean) lannual [aw=asecwt], by(year college) reshape wide lannual, i(year) j(college) generate diff=lannual1-lannual0 list year lannual0 lannual1 *BASIC GRAPH scatter diff year, connect(l) #delimit; *LABELED GRAPH; twoway scatter diff year, connect(l) title("The Relative Wage of Young College Graduates") ytitle("Log Wage Gap") xtitle("Year") 217 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
xlabel(#7); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 1-1.pdf", replace ; log close
218 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 2.log", replace *************************************************** *CHAPTER 2. FERTILITY AND LABOR SUPPLY *************************************************** use "/Volumes/Ddisk/IPUMSCPS/Data/cps62-21.dta", clear *KEEPS AGE 20-50 keep if age>=20 & age<=50 *STARTS SAMPLE IN 1968 keep if year>=1968 *LABOR FORCE STATUS INDICATOR *PERSONS IN ARMED FORCES ARE NOT IN UNIVERSE, THEY ARE EXCLUDED drop if labforce==0 generate lfp=(labforce==2) *YOUNG CHILDREN PRESENT generate child=(nchlt5>=1) *RECODES NEGATIVE SAMPLE WEIGHTS TO ZERO replace asecwt=0 if asecwt<0 *SAVES CREATED DATA FOR LATER REUSE save /volumes/ddisk/data/cpsdata.dta, replace
*****************EXERCISE 1 use /volumes/ddisk/data/cpsdata.dta, clear collapse (mean) lfp [aw=asecwt], by(year sex) reshape wide lfp, i(year) j(sex) scatter lfp* year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter lfp* year, connect(l l) title("Labor Force Participation Rates of Men and Women") ytitle("Participation Rate") xtitle("Year") legend(label(1 "Men") label(2 "Women")) ;
219 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 2-1.pdf", replace ; #delimit cr
*****************EXERCISE 2 use /volumes/ddisk/data/cpsdata.dta, clear *KEEPS WOMEN keep if sex==2 collapse (mean) lfp [aw=asecwt], by(year child) reshape wide lfp, i(year) j(child) scatter lfp* year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter lfp* year, connect(l l) title("LFPR of Women and Presence of Young Children") ytitle("Participation Rate") xtitle("Year") legend(label(1 "No Children") label(2 "With Children")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 2-2.pdf", replace ; #delimit cr
**************** EXERCISE 3 use /volumes/ddisk/data/cpsdata.dta, clear *KEEPS MEN keep if sex==1 collapse (mean) lfp [aw=asecwt], by(year child) reshape wide lfp, i(year) j(child) scatter lfp* year, connect(l l)
220 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
#delimit; *LABELED GRAPH; twoway scatter lfp* year, connect(l l) title("LFPR of Men and Presence of Young Children") ytitle("Participation Rate") xtitle("Year") legend(label(1 "No Children") label(2 "With Children")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 2-3.pdf", replace ; #delimit cr log close
221 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 3.log", replace *************************************************** *CHAPTER 3. DEMOGRAPHICS OF LOW-WAGE WORKFORCE *************************************************** use "/Volumes/Ddisk/COVIDimm/Data/cpsbasic.dta", clear *KEEPS PERSONS AGED 16-69 keep if age>=16 & age<=69 *KEEPS 2021 SURVEY keep if year==2021 *EXCLUDES PERSONS NOT IN ORG keep if paidhour==1 | paidhour==2 *RACE RECODE: 1=white, 2=black, 3=asian, 4=hisp, and 5 is everything else generate racetype=1*(race==100 & hispan==0) + 2*(race==200 & hispan==0) + 3*(race==651 & hispan==0) + 4*(hispan>0) replace racetype=5 if racetype==0 *EDUCATION RECODE generate eductype=1*(educ<=60) + 2*(educ>=70 & educ<=73) + 3*(educ>=80 & educ<=100) + 4*(educ>=110) *DEFINE HOURLY WAGE RATE FOR ALL WORKERS, NOT JUST THOSE PAID BY HOUR generate hourlywage = . replace hourlywage = earnweek/uhrswork1 if earnweek>0 & earnweek<9999.99 & uhrswork1>0 & uhrswork1<997 & paidhour==1 replace hourlywage = hourwage if hourwage>0 & hourwage<99 & paidhour==2 tabulate paidhour [aw=earnwt], sum(hourlywage) generate low=(hourlywage<15)
*SAVES CREATED DATA FOR LATER REUSE save /volumes/ddisk/data/cpsdata.dta, replace
*****************EXERCISE 1 use /volumes/ddisk/data/cpsdata.dta, clear collapse (mean) low [aw=earnwt], by(age sex) 222 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
reshape wide low, i(age) j(sex) scatter low* age, connect(l l) #delimit; *LABELED GRAPH; twoway scatter low* age, connect(l l) title("Workers in Low-Wage Workforce, by Gender") ytitle("Fraction") xtitle("Age") legend(label(1 "Men") label(2 "Women")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 3-1.pdf", replace ; #delimit cr
**************** EXERCISE 2 use /volumes/ddisk/data/cpsdata.dta, clear drop if racetype==5 collapse (mean) low [aw=earnwt], by(age racetype) reshape wide low, i(age) j(racetype) scatter low* age, connect(l l l l) #delimit; *LABELED GRAPH; twoway scatter low* age, connect(l l l l) title("Workers in Low-Wage Workforce, by Race") ytitle("Fraction") xtitle("Age") legend(label(1 "White") label(2 "Black") label(3 "Asian") label(4 "Hispanic")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 3-2.pdf", replace ; #delimit cr
223 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
**************** EXERCISE 3 use /volumes/ddisk/data/cpsdata.dta, clear collapse (mean) low [aw=earnwt], by(age eductype) reshape wide low, i(age) j(eductype) scatter low* age, connect(l l l l)
#delimit; *LABELED GRAPH; twoway scatter low* age, connect(l l l l) title("Workers in Low-Wage Workforce, by Education") ytitle("Fraction") xtitle("Age") legend(label(1 "Less than High School") label(2 "High School") label(3 "Some College") label(4 "College")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 3-3.pdf", replace ; #delimit cr log close
224 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 4.log", replace *************************************************** *CHAPTER 4. DEMOGRAPHICS DIFFERENCES IN THE IMPACT OF THE PANDEMIC *************************************************** use "/Volumes/Ddisk/ipumsbasic/cpsbasic.dta", clear *KEEPS PERIOD SINCE 2018; keep if year>=2018 *KEEPS PERSONS AGED 18-64 keep if age>=18 & age<=64 *EMPLOYMENT INDICATOR generate work=(empstat==10) keep if empstat>=10 *RACE RECODE: 1=white, 2=black, 3=asian, 4=hisp, and 5 is everything else generate racetype=1*(race==100 & hispan==0) + 2*(race==200 & hispan==0) + 3*(race==651 & hispan==0) + 4*(hispan>0) replace racetype=5 if racetype==0 *EDUCATION RECODE generate eductype=1*(educ<=60) + 2*(educ>=70 & educ<=73) + 3*(educ>=80 & educ<=100) + 4*(educ>=110) *DEFINE TIME INDICATOR IN TERMS OF YEAR-MONTH; generate time=year + (month-1)/12 tabulate time *ORG LOG WEEKLY EARNINGS: generate lweekly = log(earnweek) if earnweek>0 & earnweek<9999.99 **********************EXERCISE 1 save /volumes/ddisk/data/cpsdata.dta, replace collapse (mean) work [aw=wtfinl], by(time) scatter work time, connect(l) #delimit; *LABELED GRAPH; twoway scatter work time, connect(l) title("Trends in Employment-Population Ratio") ytitle("Ratio") 225 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
xtitle("Year") xmtick(##12); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 4-1.pdf", replace ; #delimit cr
**********************EXERCISE 2 use /volumes/ddisk/data/cpsdata.dta, clear collapse (mean) work [aw=wtfinl], by(time sex) reshape wide work, i(time) j(sex) scatter work* time, connect(l l) #delimit; *LABELED GRAPH; twoway scatter work* time, connect(l l) title("Trends in Employment-Population Ratio, by Gender") ytitle("Ratio") xtitle("Year") legend(label(1 "Men") label(2 "Women")) xmtick(##12); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 4-2.pdf", replace ; #delimit cr
**********************EXERCISE 3 use /volumes/ddisk/data/cpsdata.dta, clear drop if racetype==5 collapse (mean) work [aw=wtfinl], by(time racetype) reshape wide work, i(time) j(racetype) scatter work* time, connect(l l l l) #delimit; *LABELED GRAPH;
226 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
twoway scatter work* time, connect(l l l l) title("Trends in Employment-Population Ratio, by Race") ytitle("Ratio") xtitle("Year") legend(label(1 "White") label(2 "Black") label(3 "Asian") label(4 "Hispanic")) xmtick(##12); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 4-3.pdf", replace ; #delimit cr
**********************EXERCISE 4 use /volumes/ddisk/data/cpsdata.dta, clear collapse (mean) work [aw=wtfinl], by(time eductype) reshape wide work, i(time) j(eductype) scatter work* time, connect(l l l l) #delimit; *LABELED GRAPH; twoway scatter work* time, connect(l l l l) title("Trends in Employment-Population Ratio, by Education") ytitle("Ratio") xtitle("Year") legend(label(1 "Less than High School") label(2 "High School") label(3 "Some College") label(4 "College")) xmtick(##12); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 4-4.pdf", replace ; #delimit cr
**********************EXERCISE 5 use /volumes/ddisk/data/cpsdata.dta, clear drop if lweekly==.
227 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
collapse (mean) lweekly [aw=earnwt], by(time) scatter lweekly time, connect(l)
#delimit; *LABELED GRAPH; twoway scatter lweekly time, connect(l) title("Trend in Log Weekly Earnings") ytitle("Log Weekly Earnings") xtitle("Year") xmtick(##12); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 4-5.pdf", replace ; #delimit cr log close
228 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 5.log", replace *************************************************** *CHAPTER 5. COMPENSATING DIFFERENTIALS AND THE NIGHT SHIFT *************************************************** use "/Volumes/Ddisk/ipumscps/may2004/cpsmay2004.dta", clear *KEEPS PERSONS AGED 16-64 keep if age>=16 & age<=64 *EXCLUDES PERSONS NOT IN ORG keep if paidhour==1 | paidhour==2 *EDUCATION RECODE generate eductype=1*(educ<=60) + 2*(educ>=70 & educ<=73) + 3*(educ>=80 & educ<=100) + 4*(educ>=110) tabulate educ eductype *DEFINE HOURLY WAGE RATE FOR ALL WORKERS, NOT JUST THOSE PAID BY HOUR generate hourlywage = . replace hourlywage = earnweek/uhrswork1 if earnweek>0 & earnweek<9999.99 & uhrswork1>0 & uhrswork1<997 & paidhour==1 replace hourlywage = hourwage if hourwage>0 & hourwage<99 & paidhour==2 tabulate paidhour [aw=earnwt], sum(hourlywage) generate lhourly=log(hourlywage) drop if lhourly==. tabulate paidhour [aw=earnwt], sum(hourlywage) *DROPS PERSONS WHO DO NOT REPORT SHIFT; drop if wsregshft>2 *GROUPS WORKERS INTO AGE GROUPS; recode age (16/20 = 1) (21/30 = 2) (31/40 = 3) (41/50 = 4) (51/64 = 5), gen(agetype) *CREATES VARIABLE INDICATING PERSON DOES NOT WORK REGULAR DAY SHIFT generate irregular=(wsregshft==1) *SELECTS 4 OCCUPATIONS WITH LARGE SAMPLES AND INCIDENCE OF IRREGULAR SHIFTS *REGISTERED NURSES, CASHIERS, COOKS, TRUCK DRIVERS gen goodocc=(occ1990==95 | occ1990==276 | occ1990==436 | occ1990==804)
229 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
**********************EXERCISE 1 tabulate eductype [aw=wssuppwt], sum(irregular) **********************EXERCISE 2 tabulate agetype [aw=wssuppwt], sum(irregular)
**********************EXERCISE 3 tabulate eductype irregular [aw=earnwt], sum(lhourly) me noobs
**********************EXERCISE 4 tabulate occ1990 [aw=wssuppwt] if goodocc==1, sum(irregular)
**********************EXERCISE 5 tabulate occ1990 irregular if goodocc==1 [aw=earnwt], sum(lhourly) me noobs log close
230 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 6.log", replace *************************************************** *CHAPTER 6. WAGE DIFFERENCES ACROSS COLLEGE MAJORS *************************************************** use /volumes/ddisk/ipumsacs/data/acs.dta, clear keep if year==2019 *KEEPS PERSONS NOT ENROLLED IN SCHOOL keep if school==1 *KEEPS PERSONS AGED 21-30 keep if (age>=21 & age<=30) *KEEPS PERSONS WITH A BACHELOR'S DEGREE keep if educ==10 *DROPS INCWAGE = 0 OR INCWAGE MISSING keep if incwage>0 & incwage<999998 *DEFINES LOG ANNUAL EARNINGS generate lannual=log(incwage) *KEEPS "lARGE" MAJORS THAT HAVE MORE THAN 300 OBSERVATIONS IN 2019 tabulate degfield egen nobs=count(lannual), by(degfield) drop if nobs<300 tabulate degfield *SAVES DATA FOR FURTHER REUSE save /volumes/ddisk/data/acsdata.dta, replace *********************EXERCISE 1 use /volumes/ddisk/data/acsdata.dta, clear collapse (mean) lannual [aw=perwt], by(degfield) gsort - lannual list degfield lannual
231 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
*********************EXERCISE 2 use /volumes/ddisk/data/acsdata.dta, clear tabulate degfield sex [aw=perwt] generate female=(sex==2) *DEFINES ANNUAL WAGES SPECIFICALLY FOR MEN AND WOMEN generate lannual1=lannual generate lannual2=lannual replace lannual1=. if sex==2 replace lannual2=. if sex==1 collapse (mean) lannual1 lannual2 female [aw=perwt], by(degfield) generate gendergap=lannual1-lannual2 corr lannual1 lannual2 gsort - gendergap list degfield gendergap
*********************EXERCISE 3 scatter lannual1 female #delimit; *LABELED GRAPH; twoway scatter lannual1 female, title("Male Earnings and Femaleness of Field") ytitle("Log Annual Earnings") xtitle("Percent Female in Field") ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 6-1.pdf", replace ; #delimit cr
*********************EXERCISE 4
232 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
use /volumes/ddisk/data/acsdata.dta, clear *SEPARATES OUT ECONOMICS MAJORS *RECODE ECONOMICS MAJORS AS DEGFIELD = 1 *SO DEGFIELD = 55 IS NOW ALL SOCIAL SCIENCE MAJORS, EXCEPT ECONOMICS replace degfield=1 if degfieldd==5501 collapse (mean) lannual [aw=perwt], by(degfield) gsort - lannual list degfield lannual
log close
233 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 7.log", replace *************************************************** *CHAPTER 7. THE MINCER EARNINGS FUNCTION OVER TIME *************************************************** use "/Volumes/Ddisk/IPUMSCPS/Data/cps62-21.dta", clear *KEEPS AGE 21-64 keep if age>=21 & age<=64 *STARTS SAMPLE IN 1964 keep if year>=1964 *EXCLUDES INVALID VALUES OF ANNUAL EARNINGS keep if incwage>0 & incwage<99999998 *RECODES WEEKS WORKED INTO CONTINUOUS VARIABLE *DROPS PERSONS WHO DID NOT WORK keep if wkswork2>=1 & wkswork2<=6 generate weeks=7 if wkswork2==1 replace weeks=20 if wkswork2==2 replace weeks=33 if wkswork2==3 replace weeks=43.5 if wkswork2==4 replace weeks=48.5 if wkswork2==5 replace weeks=51 if wkswork2==6 tabulate wkswork2, sum(weeks) *DEFINES LOG WEEKLY EARNINGS generate lweekly=log(incwage/weeks) *RECODES EDUC INTO CONTINUOUS YEARS OF SCHOOLING AND DROPS INVALID VALUES generate yrschool=. replace yrschool=0 if educ==2 replace yrschool=2.5 if educ==10 replace yrschool=1 if educ==11 replace yrschool=2 if educ==12 replace yrschool=3 if educ==13 replace yrschool=4 if educ==14 replace yrschool=5.5 if educ==20 replace yrschool=5 if educ==21 replace yrschool=6 if educ==22 replace yrschool=7.5 if educ==30 replace yrschool=7 if educ==31 replace yrschool=8 if educ==32 replace yrschool=9 if educ==40 replace yrschool=10 if educ==50 replace yrschool=11 if educ==60 replace yrschool=12 if educ>=70 & educ<=73 234 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
replace yrschool=13 if educ==80 | educ==81 replace yrschool=14 if educ>=90 & educ<=92 replace yrschool=15 if educ==100 replace yrschool=16 if educ==110 | educ==111 replace yrschool=18 if educ==120 replace yrschool=17 if educ==121 replace yrschool=18 if educ==122 | educ==123 replace yrschool=19 if educ==124 replace yrschool=20 if educ==125 drop if yrschool==. *CHECKS RECODE OF SCHOOLING VARIABLE tabulate educ, sum(yrschool) *DEFINES EXPERIENCE AND EXPERIENCE SQUARE generate exper=age-yrschool-6 generate exper2=exper*exper *DEFINES VARIABLES THAT WILL RETRIEVE THE COEFFICIENT OF SCHOOLING AND EXPERIENCE IN EACH SEX-YEAR PAIRING *THE COEFF OF EXPERIENCE WILL BE DEFINED AS SLOPE AT 10 YEARS OF EXPERIENCE generate rschool=. generate rexper=. *RUNS MINCER EARNINGS FUNCTIONS, BY SEX AND YEAR forvalues j = 1(1)2 { forvalues k = 1964(1)2021 { regress lweekly yrschool exper exper2 [aw=asecwt] if sex==`j' & year==`k' replace rschool=_b[yrschool] if sex==`j' & year==`k' replace rexper=_b[exper] + 2*10*_b[exper2] if sex==`j' & year==`k' } } collapse (mean) rschool rexper, by(year sex) reshape wide rschool rexper, i(year) j(sex) *FIGURE FOR RATE OF RETURN TO SCHOOL scatter rschool* year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter rschool* year, connect(l l) title("Trends in the Rate of Return to School") 235 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
ytitle("Rate of Return") xtitle("Year") legend(label(1 "Men") label(2 "Women")) xlabel(#7); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 7-1.pdf", replace ; #delimit cr
*FIGURE FOR RATE OF RETURN TO EXPERIENCE scatter rexper* year, connect(l l)
#delimit; *LABELED GRAPH; twoway scatter rexper* year, connect(l l) title("Trends in the Rate of Return to Experience") ytitle("Rate of Return") xtitle("Year") legend(label(1 "Men") label(2 "Women")) xlabel(#7); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 7-2.pdf", replace ; #delimit cr
log close
236 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 8.log", replace *************************************************** *CHAPTER 8. THE CHILDREN OF IMMIGRANTS *************************************************** use "/Volumes/Ddisk/IPUMSCPS/Data/cps.dta", clear *KEEPS AGE 21-64 keep if age>=21 & age<=64 *STARTS SAMPLE IN 1994 keep if year>=1994 *EXCLUDES INVALID VALUES OF ANNUAL EARNINGS OR WEEKLY EARNINGS keep if incwage>0 & incwage<99999998 keep if wkswork1>0 *DEFINES LOG WEEKLY EARNINGS generate lweekly=log(incwage/wkswork1) *DEFINES GENERATION drop if nativity==0 generate generation=1*(nativity==5) + 2*(nativity>=2 & nativity<=4) + 3*(nativity==1) tabulate nativity generation collapse (mean) lweekly [aw=asecwt], by(year sex generation) reshape wide lweekly, i(year sex) j(generation) list year lweekly* if sex==1 list year lweekly* if sex==2 *CALCULATE RELATIVE WAGES generate rfirst=lweekly1-lweekly3 generate rsecond=lweekly2-lweekly3 keep year sex rfirst rsecond *CALCULATES RELATIVE WAGES FOR EACH YEAR-SEX PAIR reshape wide rfirst rsecond, i(year) j(sex) 237 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
*FIRST-SECOND GENERATION GRAPH FOR MEN scatter rfirst1 rsecond1 year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter rfirst1 rsecond1 year, connect(l l) title("Relative Wage of First and Second Generations, Men") ytitle("Log Wage Gap") xtitle("Year") legend(label(1 "Immigrants") label(2 "Children of Immigrants")) xlabel(#7); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 8-1.pdf", replace ; #delimit cr
*FIRST-SECOND GENERATION GRAPH FOR WOMEN scatter rfirst2 rsecond2 year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter rfirst2 rsecond2 year, connect(l l) title("Relative Wage of First and Second Generations, Women") ytitle("Log Wage Gap") xtitle("Year") legend(label(1 "Immigrants") label(2 "Children of Immigrants")) xlabel(#7); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 8-2.pdf", replace ; #delimit cr
log close
238 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 9.log", replace *************************************************** *CHAPTER 9. GENDER AND SKILL DIFFERENCES IN THE BLACK-WHITE WAGE GAP *************************************************** use "/Volumes/Ddisk/IPUMSCPS/Data/cps62-21.dta", clear *KEEPS AGE 21-64 keep if age>=21 & age<=64 *STARTS SAMPLE IN 1964 keep if year>=1964 *EXCLUDES INVALID VALUES OF ANNUAL EARNINGS keep if incwage>0 & incwage<99999998 *RECODES WEEKS WORKED INTO CONTINUOUS VARIABLE *DROPS PERSONS WHO DID NOT WORK keep if wkswork2>=1 & wkswork2<=6 generate weeks=7 if wkswork2==1 replace weeks=20 if wkswork2==2 replace weeks=33 if wkswork2==3 replace weeks=43.5 if wkswork2==4 replace weeks=48.5 if wkswork2==5 replace weeks=51 if wkswork2==6 tabulate wkswork2, sum(weeks) *KEEPS ONLY BLACKS AND WHITES drop if race>200 generate black=(race==200) *DEFINES LOG WEEKLY EARNINGS generate lweekly=log(incwage/weeks) *DEFINES INDICATOR VARIABLE FOR MORE THAN HIGH SCHOOL generate skill=(educ>=80) tabulate educ skill *DROPS NEGATIVE WEIGHTS drop if asecwt<0 *CALCULATES MEAN WAGE FOR EACH YEAR-SEX-BLACK-SKILL GROUP *collapse (mean) lweekly [aw=asecwt], by(year sex black skill) 239 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
save /volumes/ddisk/data/datacps.dta, replace
*TRENDS IN RACIAL WAGE GAP, BY GENDER use /volumes/ddisk/data/datacps.dta, clear collapse (mean) lweekly [aw=asecwt], by(year sex black) reshape wide lweekly, i(year sex) j(black) *CALCULATE RACIAL WAGE GAP generate rblack=lweekly1-lweekly0 keep year sex rblack reshape wide rblack, i(year) j(sex) scatter rblack* year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter rblack* year, connect(l l) title("Trends in the Black-White Wage Gap, by Gender") ytitle("Log Wage Gap") xtitle("Year") legend(label(1 "Men") label(2 "Women")) xlabel(#7); graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 9-1.pdf", replace ; #delimit cr
*TRENDS IN RACIAL WAGE GAP FOR MEN IN EACH SKILL GROUP use /volumes/ddisk/data/datacps.dta, clear keep if sex==1
240 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
collapse (mean) lweekly [aw=asecwt], by(year skill black) reshape wide lweekly, i(year skill) j(black) *CALCULATE RACIAL WAGE GAP generate rblack=lweekly1-lweekly0 keep year skill rblack reshape wide rblack, i(year) j(skill) scatter rblack* year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter rblack* year, connect(l l) title("Trends in the Black-White Wage Gap, Men") ytitle("Log Wage Gap") xtitle("Year") legend(label(1 "High School or Less") label(2 "More than High School")) xlabel(#7);
graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 9-2.pdf", replace ; #delimit cr
*TRENDS IN RACIAL WAGE GAP FOR WOMEN IN EACH SKILL GROUP use /volumes/ddisk/data/datacps.dta, clear keep if sex==2 collapse (mean) lweekly [aw=asecwt], by(year skill black) reshape wide lweekly, i(year skill) j(black) *CALCULATE RACIAL WAGE GAP generate rblack=lweekly1-lweekly0
241 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
keep year skill rblack reshape wide rblack, i(year) j(skill) scatter rblack* year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter rblack* year, connect(l l) title("Trends in the Black-White Wage Gap, Women") ytitle("Log Wage Gap") xtitle("Year") legend(label(1 "High School or Less") label(2 "More than High School")) xlabel(#7);
graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 9-3.pdf", replace ; #delimit cr
log close
242 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 10.log", replace *************************************************** *CHAPTER 10. GENDER AND UNIONIZATION *************************************************** use "/Volumes/Ddisk/ipumsbasic/cpsbasic.dta", clear *KEEPS PERSONS AGED 21-64 keep if age>=21 & age<=64 *STARTS SERIES IN 1984 keep if year>=1984 *EXCLUDES PERSONS NOT IN ORG drop if union==0 generate member=(union==2) *KEEPS WORKERS WITH VALID WEEKLY EARNINGS keep if earnweek>0 & earnweek<9999.99 *DEFINES LOG OF WEEKLY EARNINGS generate lweekly=log(earnweek) *RECODES EDUC INTO CONTINUOUS YEARS OF SCHOOLING AND DROPS INVALID VALUES generate yrschool=. replace yrschool=0 if educ==2 replace yrschool=2.5 if educ==10 replace yrschool=1 if educ==11 replace yrschool=2 if educ==12 replace yrschool=3 if educ==13 replace yrschool=4 if educ==14 replace yrschool=5.5 if educ==20 replace yrschool=5 if educ==21 replace yrschool=6 if educ==22 replace yrschool=7.5 if educ==30 replace yrschool=7 if educ==31 replace yrschool=8 if educ==32 replace yrschool=9 if educ==40 replace yrschool=10 if educ==50 replace yrschool=11 if educ==60 replace yrschool=12 if educ>=70 & educ<=73 replace yrschool=13 if educ==80 | educ==81 replace yrschool=14 if educ>=90 & educ<=92 replace yrschool=15 if educ==100 replace yrschool=16 if educ==110 | educ==111 replace yrschool=18 if educ==120 replace yrschool=17 if educ==121 replace yrschool=18 if educ==122 | educ==123 243 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
replace yrschool=19 if educ==124 replace yrschool=20 if educ==125 drop if yrschool==. *CHECKS RECODE OF SCHOOLING VARIABLE tabulate educ, sum(yrschool) *DEFINES EXPERIENCE AND EXPERIENCE SQUARE generate exper=age-yrschool-6 generate exper2=exper*exper
*SAVES CREATED DATA FOR LATER REUSE save /volumes/ddisk/data/cpsdata.dta, replace
*****************EXERCISE 1 use /volumes/ddisk/data/cpsdata.dta, clear collapse (mean) member [aw=earnwt], by(year sex) reshape wide member, i(year) j(sex) scatter member* year, connect(l l) #delimit; *LABELED GRAPH; twoway scatter member* year, connect(l l) title("Union Share, by Gender") ytitle("Fraction in Union") xtitle("Year") legend(label(1 "Men") label(2 "Women")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 10-1.pdf", replace ; #delimit cr
**************** EXERCISE 2 *RUNS MINCER EARNINGS FUNCTIONS, BY SEX AND YEAR use /volumes/ddisk/data/cpsdata.dta, clear
244 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
*DEFINES VARIABLES THAT WILL CAPTURE THE COEFFICIENT OF THE UNION VARIABLE *DONE FOR MEN AND WOMEN SEPARATELY generate rmemberm=. generate rmemberf=. forvalues k = 1984(1)2017 { regress lweekly yrschool exper exper2 member [aw=earnwt] if sex==1 & year==`k' replace rmemberm=_b[member] if sex==1 & year==`k' regress lweekly yrschool exper exper2 member [aw=earnwt] if sex==2 & year==`k' replace rmemberf=_b[member] if sex==2 & year==`k' } collapse (mean) rmemberm rmemberf, by(year) scatter rmemberm rmemberf year, connect(l l)
#delimit; *LABELED GRAPH; twoway scatter rmemberm rmemberf year, connect(l l) title("Union Wage Gap, by Gender") ytitle("Log Wage Gap") xtitle("Year") legend(label(1 "Men") label(2 "Women")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 10-2.pdf", replace ; #delimit cr
log close
245 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 11.log", replace *************************************************** *CHAPTER 11. INTERINDUSTRY WAGE DIFFERENTIALS IN THE LONG RUN *************************************************** *CREATES THE POOLED 2017-2019 ACS CROSS-SECTIONS use /volumes/ddisk/ipumsacs/data/acs.dta, clear *POOLS THE 2017, 2018, AND 2019 CROSS-SECTIONS keep if year>=2017 & year<=2019 *VALID INDUSTRY CODE keep if ind1990>=10 & ind1990<=932 *KEEPS PERSONS AGED 21-64 keep if age>=21 & age<=64 *DROPS INCWAGE = 0 OR INCWAGE MISSING keep if incwage>0 & incwage<999998 *DROPS PERSONS WHO DID NOT WORK keep if wkswork2>=1 & wkswork2<=6 generate weeks=7 if wkswork2==1 replace weeks=20 if wkswork2==2 replace weeks=33 if wkswork2==3 replace weeks=43.5 if wkswork2==4 replace weeks=48.5 if wkswork2==5 replace weeks=51 if wkswork2==6 tabulate wkswork2, sum(weeks) *USES CPI DEFLATOR, CONVERTING EARNINGS INTO 2019 DOLLARS generate cpi=245.120 if year==2017 replace cpi=251.107 if year==2018 replace cpi=255.657 if year==2019 replace incwage=incwage*(255.657/cpi) generate lweekly=log(incwage/weeks) *WILL CALL THIS CROSS-SECTION THE 2020 DATA replace year=2020 *SAVES DATA FOR FURTHER REUSE save /volumes/ddisk/data/ind2020.dta, replace
246 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
use /volumes/ddisk/ipums8/ipums90.dta, clear *VALID INDUSTRY CODE keep if ind1990>=10 & ind1990<=932 *DROPS INCWAGE = 0 OR INCWAGE MISSING keep if incwage>0 & incwage<999998 *DROPS PERSONS WHO DID NOT WORK keep if wkswork2>=1 & wkswork2<=6 generate weeks=7 if wkswork2==1 replace weeks=20 if wkswork2==2 replace weeks=33 if wkswork2==3 replace weeks=43.5 if wkswork2==4 replace weeks=48.5 if wkswork2==5 replace weeks=51 if wkswork2==6 tabulate wkswork2, sum(weeks) generate lweekly=log(incwage/weeks)
*SAVES DATA FOR FURTHER REUSE save /volumes/ddisk/data/ind1990.dta, replace
use /volumes/ddisk/ipums8/ipums60_5pct.dta, clear *VALID INDUSTRY CODE keep if ind1990>=10 & ind1990<=932 *DROPS INCWAGE = 0 OR INCWAGE MISSING keep if incwage>0 & incwage<999998 *DROPS PERSONS WHO DID NOT WORK keep if wkswork2>=1 & wkswork2<=6 generate weeks=7 if wkswork2==1 replace weeks=20 if wkswork2==2 replace weeks=33 if wkswork2==3 replace weeks=43.5 if wkswork2==4 replace weeks=48.5 if wkswork2==5 replace weeks=51 if wkswork2==6 tabulate wkswork2, sum(weeks)
247 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
generate lweekly=log(incwage/weeks)
*POOLS 1960, 1990, AND "2020" AND SAVES FOR FURTHER REUSE save /volumes/ddisk/data/ind1960.dta, replace
*CALCULATES AVERAGE WAGE IN EACH YEAR INDUSTRY COMBINATION use /volumes/ddisk/data/ind1960.dta, clear append using /volumes/ddisk/data/ind1990.dta append using /volumes/ddisk/data/ind2020.dta
collapse (mean) lweekly [aw=perwt], by(year ind1990) reshape wide lweekly, i(ind1990) j(year) corr lweekly* scatter lweekly2020 lweekly1990 scatter lweekly2020 lweekly1960
#delimit; *LABELED GRAPH FOR 1990-2020; twoway scatter lweekly2020 lweekly1990, title("Persistence of Industry Wages, 1990-2020") ytitle("Log Weekly Wage, 2020") xtitle("Log Weekly Wage, 1990") ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 11-1.pdf", replace ; #delimit cr
#delimit; *LABELED GRAPH FOR 1960-2020;
248 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
twoway scatter lweekly2020 lweekly1960, title("Persistence of Industry Wages, 1960-2020") ytitle("Log Weekly Wage, 2020") xtitle("Log Weekly Wage, 1960") ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 11-2.pdf", replace ; #delimit cr
log close
249 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
clear set more 1 log using "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Do Files/Data Explorer 12.log", replace *************************************************** *CHAPTER 12. THE GREAT RECESSION, THE PANDEMIC, AND UNEMPLOYMENT *************************************************** use "/Volumes/Ddisk/IPUMSbasic/cpsbasic.dta", clear *KEEPS AGE 16-69 keep if age>=16 & age<=69 *KEEPS PERSONS IN LABOR FORCE keep if labforce==2 *DEFINES AN UNEMPLOYMENT INDICATOR generate unemp=(empstat>=20 & empstat<=22) *KEEPS PERIOD BEFORE AND AFTER THE GREAT RECESSION *KEEPS PERIOD BEFORE AND AFTER THE PANDEMIC keep if year==2007 | year==2010 | year==2019 | (year==2020 & month>=4 & month<=9) *AGE RECODE recode age (16/19 = 1) (20/29 = 2) (30/39 = 3) (40/49 = 4) (50/59 = 5) (60/69 = 6), gen(agecode) tabulate age agecode *EDUCATION RECODE generate eductype=1*(educ<=60) + 2*(educ>=70 & educ<=73) + 3*(educ>=80 & educ<=100) + 4*(educ==111) + 5*(educ>=123) tabulate educ eductype save /volumes/ddisk/data/datacps.dta, replace
*GRAPHS BY AGE use /volumes/ddisk/data/datacps.dta, clear collapse (mean) unemp [aw=wtfinl], by(year agecode) reshape wide unemp, i(agecode) j(year) scatter unemp2007 unemp2010 agecode, connect(l l) 250 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
#delimit; *LABELED GRAPH FOR 2007-2010, BY AGE; twoway scatter unemp2007 unemp2010 agecode, connect(l l) title("Unemployment Rate in the Great Recession, by Age") ytitle("Unemployment Rate") xtitle("Age") legend(label(1 "2007") label(2 "2010")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 12-1.pdf", replace ; #delimit cr
scatter unemp2019 unemp2020 agecode, connect(l l) #delimit; *LABELED GRAPH FOR 2019-2020, BY AGE; twoway scatter unemp2019 unemp2020 agecode, connect(l l) title("Unemployment Rate in the Pandemic, by Age") ytitle("Unemployment Rate") xtitle("Age") legend(label(1 "2019") label(2 "2020")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 12-2.pdf", replace ; #delimit cr
*GRAPHS BY EDUCATION use /volumes/ddisk/data/datacps.dta, clear collapse (mean) unemp [aw=wtfinl], by(year eductype)
251 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
reshape wide unemp, i(eductype) j(year) scatter unemp2007 unemp2010 eductype, connect(l l) #delimit; *LABELED GRAPH FOR 2007-2010, BY EDUCATION; twoway scatter unemp2007 unemp2010 eductype, connect(l l) title("Unemployment Rate in the Great Recession, by Education") ytitle("Unemployment Rate") xtitle("Education Group") legend(label(1 "2007") label(2 "2010")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 12-3.pdf", replace ; #delimit cr
scatter unemp2019 unemp2020 eductype, connect(l l) #delimit; *LABELED GRAPH FOR 2019-2020, BY EDUCATION; twoway scatter unemp2019 unemp2020 eductype, connect(l l) title("Unemployment Rate in the Pandemic, by Education") ytitle("Unemployment Rate") xtitle("Education Group") legend(label(1 "2019") label(2 "2020")) ; graph export "/Users/George/Documents/Books/Labor, 9th Edition/Data Explorer/Figures/Data Explorer 12-4.pdf", replace ; #delimit cr
log close
252 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
253 © McGraw Hill LLC. All rights reserved. No reproduction or distribution without the prior written consent of McGraw Hill LLC.
This Page is Intentionally Left Blank
This Page is Intentionally Left Blank