From bc0e3ff6dfb00872deabaf685cdd749059f40e35 Mon Sep 17 00:00:00 2001 From: Benjamin Elbers Date: Sun, 15 Apr 2018 15:11:13 -0400 Subject: [PATCH] update according to CRAN --- LICENSE | 23 +---------- README.Rmd | 2 +- README.md | 103 ++++++++++++++++++++++++++++++----------------- cran-comments.md | 5 ++- 4 files changed, 72 insertions(+), 61 deletions(-) diff --git a/LICENSE b/LICENSE index 7e813b1..0caed85 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,2 @@ -MIT License - -Copyright (c) 2018 Benjamin Elbers - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +YEAR: 2018 +COPYRIGHT HOLDER: Benjamin Elbers diff --git a/README.Rmd b/README.Rmd index a6f32ad..bfad5e0 100644 --- a/README.Rmd +++ b/README.Rmd @@ -25,7 +25,7 @@ on the Mutual Information Index (M). - calculate total, between, within, and local segregation - decompose differences in total segregation over time - estimate standard errors via bootstrapping -- every method returns a [tidy](https://cran.r-project.org/web/packages/tidyr/vignettes/tidy-data.html) data frame (or [tibble](https://cran.r-project.org/web/packages/tibble/vignettes/tibble.html), if the package is installed) for easy post-processing and plotting +- every method returns a [tidy](http://vita.had.co.nz/papers/tidy-data.html) data frame (or [tibble](http://tibble.tidyverse.org), if the package is installed) for easy post-processing and plotting - it's fast, because it uses the [`data.table`](https://github.com/Rdatatable/data.table/wiki) package internally ## Example diff --git a/README.md b/README.md index e4fa116..626be65 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,25 @@ segregation =========== -An R package to calculate entropy-based segregation indices, with a focus on the Mutual Information Index (M). +An R package to calculate entropy-based segregation indices, with a +focus on the Mutual Information Index (M). - calculate total, between, within, and local segregation - decompose differences in total segregation over time - estimate standard errors via bootstrapping -- every method returns a [tidy](https://cran.r-project.org/web/packages/tidyr/vignettes/tidy-data.html) data frame (or [tibble](https://cran.r-project.org/web/packages/tibble/vignettes/tibble.html), if the package is installed) for easy post-processing and plotting -- it's fast, because it uses the [`data.table`](https://github.com/Rdatatable/data.table/wiki) package internally +- every method returns a + [tidy](http://vita.had.co.nz/papers/tidy-data.html) data frame (or + [tibble](http://tibble.tidyverse.org), if the package is installed) + for easy post-processing and plotting +- it’s fast, because it uses the + [`data.table`](https://github.com/Rdatatable/data.table/wiki) + package internally Example ------- -The package provides an easy way to calculate total and local segregation, based on the Mutual Information Index. +The package provides an easy way to calculate total and local +segregation, based on the Mutual Information Index. ``` r library(segregation) @@ -22,7 +29,7 @@ mutual_total(schools00, "school", "race", weight = "n") #> # A tibble: 3 x 2 #> stat est #> * -#> 1 M 0.425 +#> 1 M 0.426 #> 2 M_min 0. #> 3 M_max 1.61 ``` @@ -35,37 +42,39 @@ mutual_total(schools00, "school", "race", weight = "n", se = TRUE) #> # A tibble: 3 x 3 #> stat est se #> * -#> 1 M 0.429 0.000851 +#> 1 M 0.429 0.000935 #> 2 M_min 0. 0. #> 3 M_max 1.61 0. ``` -Local segregation (`ls`) of racial groups, with group-specific standard errors: +Local segregation (`ls`) of racial groups, with group-specific standard +errors: ``` r mutual_local(schools00, "school", "race", weight = "n", se = TRUE) #> .......... #> # A tibble: 15 x 4 -#> race stat est se -#> -#> 1 native ls 1.53 0.0134 -#> 2 asian ls 0.663 0.00302 -#> 3 hisp ls 0.781 0.00141 -#> 4 black ls 0.889 0.00251 -#> 5 white ls 0.184 0.000806 -#> 6 native p 0.00760 0.0000859 -#> 7 asian p 0.0227 0.000136 -#> 8 hisp p 0.152 0.000426 -#> 9 black p 0.189 0.000254 -#> 10 white p 0.629 0.000584 -#> 11 native M_group 0.0116 0.000162 -#> 12 asian M_group 0.0151 0.000134 -#> 13 hisp M_group 0.119 0.000391 -#> 14 black M_group 0.168 0.000502 -#> 15 white M_group 0.115 0.000427 +#> race stat est se +#> +#> 1 asian ls 0.667 0.00674 +#> 2 black ls 0.885 0.00259 +#> 3 hisp ls 0.782 0.00258 +#> 4 white ls 0.184 0.000725 +#> 5 native ls 1.53 0.0229 +#> 6 asian p 0.0226 0.000124 +#> 7 black p 0.190 0.000465 +#> 8 hisp p 0.152 0.000317 +#> 9 white p 0.628 0.000687 +#> 10 native p 0.00745 0.000135 +#> 11 asian M_group 0.0151 0.000193 +#> 12 black M_group 0.168 0.000354 +#> 13 hisp M_group 0.119 0.000336 +#> 14 white M_group 0.116 0.000357 +#> 15 native M_group 0.0114 0.000101 ``` -Decompose the difference in segregation between 2000 and 2005, using the method developed by Mora and Ruiz-Castillo (2009): +Decompose the difference in segregation between 2000 and 2005, using the +method developed by Mora and Ruiz-Castillo (2009): ``` r mutual_difference(schools00, schools05, "school", "race", @@ -73,12 +82,12 @@ mutual_difference(schools00, schools05, "school", "race", #> # A tibble: 6 x 2 #> stat est #> * -#> 1 M1 0.425 -#> 2 M2 0.415 -#> 3 diff -0.0102 -#> 4 group_marginal 0.00768 -#> 5 unit_entropy -0.0639 -#> 6 invariant 0.0460 +#> 1 M1 0.426 +#> 2 M2 0.413 +#> 3 diff -0.0122 +#> 4 group_marginal 0.00747 +#> 5 unit_entropy -0.0641 +#> 6 invariant 0.0445 ``` How to install @@ -103,18 +112,36 @@ Papers using the Mutual information index (list incomplete) -- DiPrete, T. A., Eller, C. C., Bol, T., & van de Werfhorst, H. G. (2017). School-to-Work Linkages in the United States, Germany, and France. American Journal of Sociology, 122(6), 1869-1938. -- Forster, A. G., & Bol, T. (2017). Vocational education and employment over the life course using a new measure of occupational specificity. Social Science Research, 70, 176-197. -- Van Puyenbroeck, T., De Bruyne, K., & Sels, L. (2012). More than ‘Mutual Information’: Educational and sectoral gender segregation and their interaction on the Flemish labor market. Labour Economics, 19(1), 1-8. -- Mora, R., & Ruiz-Castillo, J. (2003). Additively decomposable segregation indexes. The case of gender segregation by occupations and human capital levels in Spain. The Journal of Economic Inequality, 1(2), 147-179. +- DiPrete, T. A., Eller, C. C., Bol, T., & van de Werfhorst, H. G. + (2017). School-to-Work Linkages in the United States, Germany, and + France. American Journal of Sociology, 122(6), 1869-1938. + +- Forster, A. G., & Bol, T. (2017). Vocational education and + employment over the life course using a new measure of occupational + specificity. Social Science Research, 70, 176-197. + +- Van Puyenbroeck, T., De Bruyne, K., & Sels, L. (2012). More than + ‘Mutual Information’: Educational and sectoral gender segregation + and their interaction on the Flemish labor market. Labour Economics, + 19(1), 1-8. +- Mora, R., & Ruiz-Castillo, J. (2003). Additively decomposable + segregation indexes. The case of gender segregation by occupations + and human capital levels in Spain. The Journal of Economic + Inequality, 1(2), 147-179. References on entropy-based segregation indices ----------------------------------------------- Theil, Henri. (1971). Principles of Econometrics. New York: Wiley. -Frankel, D. M., & Volij, O. (2011). Measuring school segregation. Journal of Economic Theory, 146(1), 1-38. +Frankel, D. M., & Volij, O. (2011). Measuring school segregation. +Journal of Economic Theory, 146(1), 1-38. + -Mora, R., & Ruiz-Castillo, J. (2009). The Invariance Properties of the Mutual Information Index of Multigroup Segregation. Research on Economic Inequality, 17, 33-53. +Mora, R., & Ruiz-Castillo, J. (2009). The Invariance Properties of the +Mutual Information Index of Multigroup Segregation. Research on Economic +Inequality, 17, 33-53. -Mora, R., & Ruiz-Castillo, J. (2011). Entropy-based Segregation Indices. Sociological Methodology, 41(1), 159–194. +Mora, R., & Ruiz-Castillo, J. (2011). Entropy-based Segregation Indices. +Sociological Methodology, 41(1), 159–194. + diff --git a/cran-comments.md b/cran-comments.md index f2ad55b..609b3fb 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,4 +1,7 @@ -This is the first submission of this package. +This is a resubmission. + +* fixed LICENSE file +* updated URLs in README ## Test environments