|
| 1 | +<!-- |
| 2 | +
|
| 3 | +@license Apache-2.0 |
| 4 | +
|
| 5 | +Copyright (c) 2018 The Stdlib Authors. |
| 6 | +
|
| 7 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | +you may not use this file except in compliance with the License. |
| 9 | +You may obtain a copy of the License at |
| 10 | +
|
| 11 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +
|
| 13 | +Unless required by applicable law or agreed to in writing, software |
| 14 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +See the License for the specific language governing permissions and |
| 17 | +limitations under the License. |
| 18 | +
|
| 19 | +--> |
| 20 | + |
| 21 | +# CPS Wages Data |
| 22 | + |
| 23 | +> Data of a random sample of 534 workers from the Current Population Survey (CPS) from 1985. |
| 24 | +
|
| 25 | +<section class="intro"> |
| 26 | + |
| 27 | +</section> |
| 28 | + |
| 29 | +<!-- /.intro --> |
| 30 | + |
| 31 | +<section class="usage"> |
| 32 | + |
| 33 | +## Usage |
| 34 | + |
| 35 | +```javascript |
| 36 | +var cps = require( '@stdlib/datasets/cps-wages-1985' ); |
| 37 | +``` |
| 38 | + |
| 39 | +#### cps() |
| 40 | + |
| 41 | +Returns data of a random sample of 534 workers from the Current Population Survey (CPS) from 1985, including their wages and and other characteristics. |
| 42 | + |
| 43 | +```javascript |
| 44 | +var data = cps(); |
| 45 | +// returns [{...},{...},...] |
| 46 | +``` |
| 47 | + |
| 48 | +Each `array` element has the following eleven fields: |
| 49 | + |
| 50 | +- **education**: number of years of education. |
| 51 | + |
| 52 | +- **south**: indicator variable for southern region (1 = person lives in the |
| 53 | +South, 0 = person does not live in the South). |
| 54 | + |
| 55 | +- **gender**: indicator for the gender of the person (1 = female, 0 = male). |
| 56 | + |
| 57 | +- **experience**: number of years of work experience. |
| 58 | + |
| 59 | +- **union**: indicator variable for union membership (1 = union member, 0 = not |
| 60 | +a union member). |
| 61 | + |
| 62 | +- **wage**: wage (in dollars per hour). |
| 63 | + |
| 64 | +- **age**: age (in years). |
| 65 | + |
| 66 | +- **race**: ethnicity/race ('White', 'Hispanic', and 'Other'). |
| 67 | + |
| 68 | +- **occupation**: occupational category ('Management', 'Sales', 'Clerical', |
| 69 | +'Service', 'Professional', and 'Other'). |
| 70 | + |
| 71 | +- **sector**: sector ('Other', 'Manufacturing', or 'Construction'). |
| 72 | + |
| 73 | +- **married**: marital Status (0 = unmarried, 1 = married). |
| 74 | + |
| 75 | +</section> |
| 76 | + |
| 77 | +<!-- /.usage --> |
| 78 | + |
| 79 | +<section class="examples"> |
| 80 | + |
| 81 | +## Examples |
| 82 | + |
| 83 | +<!-- eslint no-undef: "error" --> |
| 84 | + |
| 85 | +```javascript |
| 86 | +var Plot = require( '@stdlib/plot' ); |
| 87 | +var dataset = require( '@stdlib/datasets/cps-wages-1985' ); |
| 88 | + |
| 89 | +var data; |
| 90 | +var plot; |
| 91 | +var opts; |
| 92 | +var x; |
| 93 | +var y; |
| 94 | +var i; |
| 95 | + |
| 96 | +data = dataset(); |
| 97 | + |
| 98 | +// Extract housing data... |
| 99 | +x = []; |
| 100 | +y = []; |
| 101 | +for ( i = 0; i < data.length; i++ ) { |
| 102 | + x.push( data[ i ].age ); |
| 103 | + y.push( data[ i ].wage ); |
| 104 | +} |
| 105 | + |
| 106 | +// Create a plot instance: |
| 107 | +opts = { |
| 108 | + 'lineStyle': 'none', |
| 109 | + 'symbols': 'closed-circle' |
| 110 | +}; |
| 111 | +plot = new Plot( [ x ], [ y ], opts ); |
| 112 | +``` |
| 113 | + |
| 114 | +</section> |
| 115 | + |
| 116 | +<!-- /.examples --> |
| 117 | + |
| 118 | +* * * |
| 119 | + |
| 120 | +<section class="cli"> |
| 121 | + |
| 122 | +## CLI |
| 123 | + |
| 124 | +<section class="usage"> |
| 125 | + |
| 126 | +### Usage |
| 127 | + |
| 128 | +```text |
| 129 | +Usage: cps-wages-1985 [options] |
| 130 | +
|
| 131 | +Options: |
| 132 | +
|
| 133 | + -h, --help Print this message. |
| 134 | + -V, --version Print the package version. |
| 135 | + --format fmt Output format: 'csv' or 'ndjson'. |
| 136 | +``` |
| 137 | + |
| 138 | +</section> |
| 139 | + |
| 140 | +<!-- /.usage --> |
| 141 | + |
| 142 | +<section class="notes"> |
| 143 | + |
| 144 | +### Notes |
| 145 | + |
| 146 | +- The CLI supports two output formats: comma-separated values ([CSV][csv]) and newline-delimited JSON ([NDJSON][ndjson]). The default output format is [CSV][csv]. |
| 147 | + |
| 148 | +</section> |
| 149 | + |
| 150 | +<!-- /.notes --> |
| 151 | + |
| 152 | +<section class="examples"> |
| 153 | + |
| 154 | +### Examples |
| 155 | + |
| 156 | +```bash |
| 157 | +$ cps-wages-1985 |
| 158 | +education,south,gender,experience,union,wage,age,race,occupation,sector,married |
| 159 | +8,0,female,21,1,5.1,35,hispanic,other,manufacturing,0 |
| 160 | +9,0,female,42,1,4.95,57,white,other,manufacturing,0 |
| 161 | +12,0,male,1,1,6.67,19,white,other,manufacturing,1 |
| 162 | +12,0,male,4,1,4,22,white,other,other,1 |
| 163 | +12,0,male,17,1,7.5,35,white,other,other,0 |
| 164 | +... |
| 165 | +``` |
| 166 | + |
| 167 | +</section> |
| 168 | + |
| 169 | +<!-- /.examples --> |
| 170 | + |
| 171 | +</section> |
| 172 | + |
| 173 | +<!-- /.cli --> |
| 174 | + |
| 175 | +<section class="references"> |
| 176 | + |
| 177 | +## References |
| 178 | + |
| 179 | +- Berndt, ER. The Practice of Econometrics. 1991. NY: Addison-Wesley. |
| 180 | + |
| 181 | +</section> |
| 182 | + |
| 183 | +<!-- /.references --> |
| 184 | + |
| 185 | +<!-- <license> --> |
| 186 | + |
| 187 | +* * * |
| 188 | + |
| 189 | +## License |
| 190 | + |
| 191 | +The data files (databases) are licensed under an [Open Data Commons Public Domain Dedication & License 1.0][pddl-1.0] and their contents are licensed under [Creative Commons Zero v1.0 Universal][cc0]. The software is licensed under [Apache License, Version 2.0][apache-license]. |
| 192 | + |
| 193 | +<!-- </license> --> |
| 194 | + |
| 195 | +<section class="links"> |
| 196 | + |
| 197 | +[csv]: https://tools.ietf.org/html/rfc4180 |
| 198 | + |
| 199 | +[ndjson]: http://specs.frictionlessdata.io/ndjson/ |
| 200 | + |
| 201 | +[pddl-1.0]: http://opendatacommons.org/licenses/pddl/1.0/ |
| 202 | + |
| 203 | +[cc0]: https://creativecommons.org/publicdomain/zero/1.0 |
| 204 | + |
| 205 | +[apache-license]: https://www.apache.org/licenses/LICENSE-2.0 |
| 206 | + |
| 207 | +</section> |
| 208 | + |
| 209 | +<!-- /.links --> |
0 commit comments