Skip to content

Commit

Permalink
Merge pull request #8 from mtyszler/feature/version_adjustment
Browse files Browse the repository at this point in the history
Feature/version adjustment
  • Loading branch information
Marcelo Tyszler authored Aug 7, 2020
2 parents d99974a + 149f635 commit 32eabc0
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 28 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![License: CC BY-SA 4.0](https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-sa/4.0/)

## Developed by [KIT](http://www.kit.nl) and [COSA](http://thecosa.org/)
[Last update 24/7/2020]
[Last update 07/08/2020]

`kit_livingincome` provides stata ado-files to produce tables and charts of the Gap to the Living Income Benchmark.

Expand All @@ -16,6 +16,11 @@ A detailed Guidance Manual can be found at:

https://www.living-income.com/papersandreports

or directly at:

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2F0c5ab38c-aabb-4d3d-84e9-056ccebab450.usrfiles.com%2Fugd%2F0c5ab3_74a43f3647724bc58caf4daaa570482b.pdf&data=02%7C01%7Cm.tyszler%40kit.nl%7Cf199ee7ce9bd423b54ff08d838827f5f%7C99193bd4318d47c6a89624e15f7a7e1b%7C1%7C1%7C637321480450701968&sdata=HkxU0DQng8cl3PW%2B6oL7NK%2BuHGcQQzhtpKXT5UMAhZE%3D&reserved=0


### Authors

Marcelo Tyszler. KIT Royal Tropical Institute, Netherlands. m.tyszler@kit.nl
Expand All @@ -33,7 +38,7 @@ Suchitra Yegna Narayan. Laudes Foundation

### Requirements

* Stata version 13
* Stata version 14

## Installing `kit_livingincome`
To install directly from the [SSC archive](https://econpapers.repec.org/software/bocbocode/S458819.htm), type:
Expand Down Expand Up @@ -90,7 +95,7 @@ or
help kitli_compare2bm
```

And take notice of the version and date at the top. The latest version is _v1.3, 24jul2020_
And take notice of the version and date at the top. The latest version is _v1.4, 07aug2020_

## Citation

Expand Down
4 changes: 2 additions & 2 deletions kit_livingincome.pkg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v 1.3
v 1.4
d 'kit_livingincome': LIVING INCOME CALCULATIONS AND OUTPUTS: stata package to produce tables and charts of the Gap to the Living Income Benchmark
d Marcelo Tyszler, PhD, KIT Royal Tropical Institute
d
Expand All @@ -11,7 +11,7 @@ d
d package maintained at:
d https://github.com/mtyszler/KIT_LivingIncome/
d
d Distribution-Date: 20200724
d Distribution-Date: 20200807
d
F kitli_gap2bm.ado
F kitli_gap2bm.sthlp
Expand Down
Binary file modified kit_livingincome.zip
Binary file not shown.
11 changes: 8 additions & 3 deletions kitli_compare2bm.ado
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/
-----------------------------------------------------------------------------
Last Update:
24/07/2020
07/08/2020
*****************************************************************************/

version 13
capture program drop kitli_compare2bm
program define kitli_compare2bm, sortpreserve rclass
syntax varname(numeric) [if] [in], ///
Expand All @@ -53,6 +52,7 @@ program define kitli_compare2bm, sortpreserve rclass
save_graph_as(string) ///
]

version 14


********************************************
Expand Down Expand Up @@ -95,7 +95,12 @@ program define kitli_compare2bm, sortpreserve rclass

capture confirm existence `colors'
if _rc == 6 {
local colors = "ebblue%30 | blue%30 | green%30 | orange%30"
if `c(stata_version)' < 15 {
local colors = "ebblue | blue | green | orange"
}
else {
local colors = "ebblue%30 | blue%30 | green%30 | orange%30"
}
}

capture confirm existence `ytitle'
Expand Down
13 changes: 9 additions & 4 deletions kitli_compare2bm.sthlp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{smcl}
{* *! version 1.3 24jul2020}{...}
{it: v1.3, 24jul2020}
{* *! version 1.4 07aug2020}{...}
{it: v1.4, 07aug2020}

{title:Title}

Expand Down Expand Up @@ -45,7 +45,8 @@ Used if {opth food_value:(varname)} is provided {p_end}
{synopt :{opt spacing:(number)}} Value for spacing between the boxes of the combined graph of all groups. Defaults to 0.02 {p_end}
{synopt :{opt placement:(text)}} Placement of the boxes of the indicating the share of those below the benchmark. Defaults to {it:right}. {p_end}
{synopt :{opt step_size:(integer)}} Value for step size in the x-axis. Defaults to a value calculated internally {p_end}
{synopt :{opt colors:(text)}} String with colors for the graph. Default "ebblue%30 | blue%30 | green%30 | orange%30" {p_end}
{synopt :{opt colors:(text)}} String with colors for the graph. Default "ebblue%30 | blue%30 | green%30 | orange%30"
if stata 15 or newer and "ebblue | blue | green | orange" otherwise {p_end}

{syntab: Graph exporting}

Expand Down Expand Up @@ -140,7 +141,11 @@ Because the internal calculation might not suit all ranges of values,
the user can choose to override its value {p_end}

{pmore}
{opt colors:(text)} Colors for the curves. Multiple colors need to be separated by a "|". Default "ebblue%30 | blue%30 | green%30 | orange%30". {p_end}
{opt colors:(text)} Colors for the curves. Multiple colors need to be separated by a "|".
Default "ebblue%30 | blue%30 | green%30 | orange%30" if stata 15 or newer and
"ebblue | blue | green | orange" otherwise. Please notice that
transparency in colors ("%30") is only
available from stata version 15 onwards. {p_end}

{pmore}{it:For more information see {help colorstyle}}

Expand Down
40 changes: 33 additions & 7 deletions kitli_gap2bm.ado
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/
-----------------------------------------------------------------------------
Last Update:
24/07/2020
07/08/2020
*****************************************************************************/

version 13
capture program drop kitli_gap2bm
program define kitli_gap2bm, sortpreserve rclass
syntax varname(numeric) [if] [in], ///
Expand All @@ -59,6 +58,8 @@ program define kitli_gap2bm, sortpreserve rclass
save_graph_as(string) ///
as_share ///
]

version 14



Expand Down Expand Up @@ -167,23 +168,48 @@ program define kitli_gap2bm, sortpreserve rclass
}
capture confirm existence `color_hh_income'
if _rc == 6 {
local color_hh_income = "blue%30"
if `c(stata_version)' < 15 {
local color_hh_income = "blue"
}
else {
local color_hh_income = "blue%30"
}
}
capture confirm existence `color_main_income'
if _rc == 6 {
local color_main_income = "blue%30"
if `c(stata_version)' < 15 {
local color_main_income = "blue"
}
else {
local color_main_income = "blue%30"
}
}
capture confirm existence `color_other_than_main_income'
if _rc == 6 {
local color_other_than_main_income = "ebblue%30"
if `c(stata_version)' < 15 {
local color_other_than_main_income = "ebblue"
}
else {
local color_other_than_main_income = "ebblue%30"
}
}
capture confirm existence `color_gap'
if _rc == 6 {
local color_gap = "red%80"
if `c(stata_version)' < 15 {
local color_gap = "red"
}
else {
local color_gap = "red%80"
}
}
capture confirm existence `color_food_value'
if _rc == 6 {
local color_food_value = "orange%30"
if `c(stata_version)' < 15 {
local color_food_value = "orange"
}
else {
local color_food_value = "orange%30"
}
}


Expand Down
23 changes: 15 additions & 8 deletions kitli_gap2bm.sthlp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{smcl}
{* *! version 1.3 24jul2020}{...}
{it: v1.3, 24jul2020}
{* *! version 1.4 07aug2020}{...}
{it: v1.4, 07aug2020}

{title:Title}

Expand Down Expand Up @@ -56,11 +56,16 @@

{syntab: Graph colors}

{synopt :{opth color_hh_income:(colorstyle)}} Color of total income. Default "blue%30". Used if {opth main_income:(varname)} is NOT provided {p_end}
{synopt :{opth color_main_income:(colorstyle)}} Color of main source of income. Default "blue%30". Used if {opth main_income:(varname)} is provided{p_end}
{synopt :{opth color_other_than_main_income:(colorstyle)}} Color of remaining income. Default "ebblue%30". Used if {opth main_income:(varname)} is provided {p_end}
{synopt :{opth color_food_value:(colorstyle)}} Color of the intrinsic value of food consumed at home. Default "orange%30". Used if {opth food_value:(varname)} is provided {p_end}
{synopt :{opth color_gap:(colorstyle)}} Color of the gap to the living income benchmark. Default "red%30" {p_end}
{synopt :{opth color_hh_income:(colorstyle)}} Color of total income. Default "blue%30"
(or "blue" if older than stata 15). Used if {opth main_income:(varname)} is NOT provided {p_end}
{synopt :{opth color_main_income:(colorstyle)}} Color of main source of income. Default "blue%30"
(or "blue" if older than stata 15). Used if {opth main_income:(varname)} is provided{p_end}
{synopt :{opth color_other_than_main_income:(colorstyle)}} Color of remaining income. Default "ebblue%30" (or "ebblue" if older than stata 15)
. Used if {opth main_income:(varname)} is provided {p_end}
{synopt :{opth color_food_value:(colorstyle)}} Color of the intrinsic value of food consumed at home. Default "orange%30" (or
"orange" if older than stata 15). Used if {opth food_value:(varname)} is provided {p_end}
{synopt :{opth color_gap:(colorstyle)}} Color of the gap to the living income benchmark. Default "red%30" (or "red"
if older than stata 15) {p_end}


{syntab: Graph exporting}
Expand Down Expand Up @@ -182,7 +187,9 @@ above the benchmark line. {p_end}


{dlgtab: Graph colors}
{pmore}{it:For more information see {help colorstyle}}
{pmore}{it:For more information see {help colorstyle}}. Please notice that transparency in colors ("%30")
is only available from stata version 15 onwards. If stata version is older than 15
the default values will skip the transparency.

{pmore}
{opth color_hh_income:(colorstyle)} Color of main source of income. Default "blue%30". {p_end}
Expand Down
2 changes: 1 addition & 1 deletion stata.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v 1.3
v 1.4
d Marcelo Tyszler, PhD, KIT Royal Tropical Institute
d
d 'KIT_LIVINGINCOME': LIVING INCOME CALCULATIONS AND OUTPUTS: stata ado-file produces tables and charts of the Gap to the Living Income Benchmark
Expand Down

0 comments on commit 32eabc0

Please sign in to comment.