Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e83226bcc | ||
|
|
059f7feb1c | ||
|
|
2c7713a45c | ||
|
|
8a41c32d7c | ||
|
|
88092381eb | ||
|
|
8778f39ce4 | ||
|
|
dd158fc596 | ||
|
|
8ceeeaadae | ||
|
|
f6f520b0d0 | ||
|
|
72595e978a |
@@ -51,10 +51,12 @@ libname NEW "%workPath()/new";
|
|||||||
%put %date(yymmddn10.) %time(time5.) %datetime(e8601dt.);
|
%put %date(yymmddn10.) %time(time5.) %datetime(e8601dt.);
|
||||||
|
|
||||||
%put %monthShift(2023,1,-5);
|
%put %monthShift(2023,1,-5);
|
||||||
|
|
||||||
|
%put #%expandDataSetsList(lib=sashelp,datasets=_all_)#;
|
||||||
```
|
```
|
||||||
and more.
|
and more.
|
||||||
|
|
||||||
SHA256 digest for the latest version of `BasePlus`: F*68BB953CD732EB43119A3339656670292317FE1C3B764EC57484C7D5C9DF23EB
|
SHA256 digest for the latest version of `BasePlus`: F*71DC1AFA709B2977E8AEA452721776F62EEC8240ABD658AC83AA6D4310FC49B6
|
||||||
|
|
||||||
[**Documentation for BasePlus**](./baseplus.md "Documentation for BasePlus")
|
[**Documentation for BasePlus**](./baseplus.md "Documentation for BasePlus")
|
||||||
|
|
||||||
|
|||||||
585
baseplus.md
@@ -9,22 +9,22 @@
|
|||||||
### Version information:
|
### Version information:
|
||||||
|
|
||||||
- Package: BasePlus
|
- Package: BasePlus
|
||||||
- Version: 1.43.0
|
- Version: 2.3.0
|
||||||
- Generated: 2024-07-22T08:50:35
|
- Generated: 2025-08-04T14:12:30
|
||||||
- Author(s): Bartosz Jablonski (yabwon@gmail.com), Quentin McMullen (qmcmullen@gmail.com)
|
- Author(s): Bartosz Jablonski (yabwon@gmail.com), Quentin McMullen (qmcmullen@gmail.com)
|
||||||
- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
|
- Maintainer(s): Bartosz Jablonski (yabwon@gmail.com)
|
||||||
- License: MIT
|
- License: MIT
|
||||||
- File SHA256: `F*68BB953CD732EB43119A3339656670292317FE1C3B764EC57484C7D5C9DF23EB` for this version
|
- File SHA256: `F*71DC1AFA709B2977E8AEA452721776F62EEC8240ABD658AC83AA6D4310FC49B6` for this version
|
||||||
- Content SHA256: `C*7436BD6446CDA2F57163B7BA45482750D460CA9AEFDCA4012253D742B8EE5E65` for this version
|
- Content SHA256: `C*9CEDE8C64D2C619EBC27AC85B4904D2CE2423C832C6C313E526946FC1417EFD1` for this version
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# The `BasePlus` package, version: `1.43.0`;
|
# The `BasePlus` package, version: `2.3.0`;
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# The BasePlus package [ver. 1.43.0] <a name="baseplus-package"></a> ###############################################
|
# The BasePlus package [ver. 2.3.0] <a name="baseplus-package"></a> ###############################################
|
||||||
|
|
||||||
The **BasePlus** package implements useful
|
The **BasePlus** package implements useful
|
||||||
functions and functionalities I miss in the BASE SAS.
|
functions and functionalities I miss in the BASE SAS.
|
||||||
@@ -368,6 +368,25 @@ run;
|
|||||||
%put &=y.;
|
%put &=y.;
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 28** Converting variables names to lowercases:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data a1 a2 a3 b_x b_y b_z;
|
||||||
|
set sashelp.class(obs=1);
|
||||||
|
run;
|
||||||
|
|
||||||
|
%put #%expandDataSetsList(lib=work,datasets=a1-a3 b_:)#;
|
||||||
|
|
||||||
|
proc print data=a1;
|
||||||
|
proc print data=b_x;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%unifyVarsCaseSize(work,a1-a3 b_:)
|
||||||
|
|
||||||
|
proc print data=a1;
|
||||||
|
proc print data=b_x;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -384,7 +403,7 @@ localization (only if additional content was deployed during the installation pr
|
|||||||
|
|
||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
*SAS package generated by SAS Package Framework, version `20240711`*
|
*SAS package generated by SAS Package Framework, version `20250729`*
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -439,38 +458,42 @@ The `BasePlus` package consists of the following content:
|
|||||||
46. [`deldataset()` function ](#deldataset-functions-46 )
|
46. [`deldataset()` function ](#deldataset-functions-46 )
|
||||||
47. [`semicolonc()` function ](#semicolonc-functions-47 )
|
47. [`semicolonc()` function ](#semicolonc-functions-47 )
|
||||||
48. [`semicolonn()` function ](#semicolonn-functions-48 )
|
48. [`semicolonn()` function ](#semicolonn-functions-48 )
|
||||||
49. [`$brackets.` format/informat ](#brackets-format-49 )
|
49. [`$bpklenght.` format/informat ](#bpklenght-formats-49 )
|
||||||
50. [`$semicolon.` format/informat ](#semicolon-format-50 )
|
50. [`$bplenght.` format/informat ](#bplenght-formats-50 )
|
||||||
51. [`qsortincbyprocproto()` proto ](#qsortincbyprocproto-proto-51 )
|
51. [`$brackets.` format/informat ](#brackets-formats-51 )
|
||||||
52. [`frommissingtonumberbs()` function ](#frommissingtonumberbs-functions-52 )
|
52. [`$semicolon.` format/informat ](#semicolon-formats-52 )
|
||||||
53. [`fromnumbertomissing()` function ](#fromnumbertomissing-functions-53 )
|
53. [`qsortincbyprocproto()` proto ](#qsortincbyprocproto-proto-53 )
|
||||||
54. [`quicksort4notmiss()` function ](#quicksort4notmiss-functions-54 )
|
54. [`frommissingtonumberbs()` function ](#frommissingtonumberbs-functions-54 )
|
||||||
55. [`quicksorthash()` function ](#quicksorthash-functions-55 )
|
55. [`fromnumbertomissing()` function ](#fromnumbertomissing-functions-55 )
|
||||||
56. [`quicksorthashsddv()` function ](#quicksorthashsddv-functions-56 )
|
56. [`quicksort4notmiss()` function ](#quicksort4notmiss-functions-56 )
|
||||||
57. [`quicksortlight()` function ](#quicksortlight-functions-57 )
|
57. [`quicksorthash()` function ](#quicksorthash-functions-57 )
|
||||||
58. [`%date()` macro ](#date-macro-58 )
|
58. [`quicksorthashsddv()` function ](#quicksorthashsddv-functions-58 )
|
||||||
59. [`%datetime()` macro ](#datetime-macro-59 )
|
59. [`quicksortlight()` function ](#quicksortlight-functions-59 )
|
||||||
60. [`%downloadfilesto()` macro ](#downloadfilesto-macro-60 )
|
60. [`%date()` macro ](#date-macro-60 )
|
||||||
61. [`%filepath()` macro ](#filepath-macro-61 )
|
61. [`%datetime()` macro ](#datetime-macro-61 )
|
||||||
62. [`%finddswithvarval()` macro ](#finddswithvarval-macro-62 )
|
62. [`%downloadfilesto()` macro ](#downloadfilesto-macro-62 )
|
||||||
63. [`%fmt()` macro ](#fmt-macro-63 )
|
63. [`%expanddatasetslist()` macro ](#expanddatasetslist-macro-63 )
|
||||||
64. [`%generateoneliners()` macro ](#generateoneliners-macro-64 )
|
64. [`%filepath()` macro ](#filepath-macro-64 )
|
||||||
65. [`%gettitle()` macro ](#gettitle-macro-65 )
|
65. [`%finddswithvarval()` macro ](#finddswithvarval-macro-65 )
|
||||||
66. [`%iffunc()` macro ](#iffunc-macro-66 )
|
66. [`%fmt()` macro ](#fmt-macro-66 )
|
||||||
67. [`%infmt()` macro ](#infmt-macro-67 )
|
67. [`%generateoneliners()` macro ](#generateoneliners-macro-67 )
|
||||||
68. [`%letters()` macro ](#letters-macro-68 )
|
68. [`%gettitle()` macro ](#gettitle-macro-68 )
|
||||||
69. [`%libpath()` macro ](#libpath-macro-69 )
|
69. [`%iffunc()` macro ](#iffunc-macro-69 )
|
||||||
70. [`%minclude()` macro ](#minclude-macro-70 )
|
70. [`%infmt()` macro ](#infmt-macro-70 )
|
||||||
71. [`%monthshift()` macro ](#monthshift-macro-71 )
|
71. [`%letters()` macro ](#letters-macro-71 )
|
||||||
72. [`%replist()` macro ](#replist-macro-72 )
|
72. [`%libpath()` macro ](#libpath-macro-72 )
|
||||||
73. [`%time()` macro ](#time-macro-73 )
|
73. [`%minclude()` macro ](#minclude-macro-73 )
|
||||||
74. [`%today()` macro ](#today-macro-74 )
|
74. [`%monthshift()` macro ](#monthshift-macro-74 )
|
||||||
75. [`%translate()` macro ](#translate-macro-75 )
|
75. [`%replist()` macro ](#replist-macro-75 )
|
||||||
76. [`%tranwrd()` macro ](#tranwrd-macro-76 )
|
76. [`%time()` macro ](#time-macro-76 )
|
||||||
77. [`%workpath()` macro ](#workpath-macro-77 )
|
77. [`%today()` macro ](#today-macro-77 )
|
||||||
|
78. [`%translate()` macro ](#translate-macro-78 )
|
||||||
|
79. [`%tranwrd()` macro ](#tranwrd-macro-79 )
|
||||||
|
80. [`%unifyvarscasesize()` macro ](#unifyvarscasesize-macro-80 )
|
||||||
|
81. [`%workpath()` macro ](#workpath-macro-81 )
|
||||||
|
|
||||||
|
|
||||||
78. [License note](#license)
|
82. [License note](#license)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -966,7 +989,12 @@ The QgetVars() returns quoted value [by %superq()].
|
|||||||
|
|
||||||
See examples below for the details.
|
See examples below for the details.
|
||||||
|
|
||||||
The `%getVars()` macro executes like a pure macro code.
|
When `mcArray=` is not used the `%getVars()` macro executes like
|
||||||
|
a pure macro code. When `mcArray=` is not null (creation of a
|
||||||
|
macro variable array is requested) them a single semicolon is returned.
|
||||||
|
|
||||||
|
When `validvarname=ANY` in set special care should be kept.
|
||||||
|
See dedicated examples below.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
@@ -980,6 +1008,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
<,quote=>
|
<,quote=>
|
||||||
<,mcArray=>
|
<,mcArray=>
|
||||||
<,ignoreCases>
|
<,ignoreCases>
|
||||||
|
<,nlit=>
|
||||||
)
|
)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@@ -1002,23 +1031,32 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
* `mcArray=` - *Optional*, default value is blank.
|
* `mcArray=` - *Optional*, default value is blank.
|
||||||
1) When *null* - the macro behaves like a macro function
|
1) When *null* - the macro behaves like a macro function
|
||||||
and returns a text string with variables list.
|
and ban be used in the `%put` or `%let=` statements.
|
||||||
2) When *not null* - behaviour of the macro is altered.
|
The returned text is a string with variables list.
|
||||||
|
2) When *not null* - behavior of the macro is altered.
|
||||||
In such case a macro array of selected variables, named
|
In such case a macro array of selected variables, named
|
||||||
with `mcArray` value as a prefix, is created.
|
with `mcArray` value as a prefix, is created.
|
||||||
Furthermore a macro named as `mcArray` value is generated.
|
Furthermore a macro named as `mcArray` value is generated.
|
||||||
(see the macroArray package for the details).
|
(see the macroArray package for the details).
|
||||||
When `mcArray=` parameter is active the `getVars` macro
|
When `mcArray=` parameter is active the `getVars` macro
|
||||||
cannot be called within the `%put` statement. Execution like:
|
should not be called within the `%put` or `%let=` statements.
|
||||||
`%put %getVars(..., mcArray=XXX);` will result with
|
A single semicolon is produced as the macro result, hence
|
||||||
an Explicit & Radical Refuse Of Run (aka ERROR).
|
execution like: `%put %getVars(..., mcArray=XXX) some text;`
|
||||||
|
will result with an Explicit & Radical Refuse Of Run (aka ERROR).
|
||||||
|
|
||||||
* `ignoreCases=` - *Optional*, default value is 1.
|
* `ignoreCases=` - *Optional*, default value is 1.
|
||||||
Indicates if search should be case insensitive.
|
Indicates if search should be case insensitive.
|
||||||
|
|
||||||
|
* `nlit=` - *Optional*, default value is 0.
|
||||||
|
Introduced to improve `validvarname=ANY` handling.
|
||||||
|
Indicates if the `NLITERAL()` function should be
|
||||||
|
executed to cover spacial characters.
|
||||||
|
|
||||||
|
|
||||||
### EXAMPLES AND USECASES: ####################################################
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**When `validvarname=` option is _not_ `ANY`.**
|
||||||
|
|
||||||
**EXAMPLE 1.** A list of all variables from the
|
**EXAMPLE 1.** A list of all variables from the
|
||||||
sashelp.class dataset:
|
sashelp.class dataset:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
@@ -1244,6 +1282,44 @@ run;
|
|||||||
%put %do_over(XYZ);
|
%put %do_over(XYZ);
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**When the `validvarname=ANY` option is set.**
|
||||||
|
|
||||||
|
**EXAMPLE 12.** Get all variables and handle special characters.
|
||||||
|
Without `nlit=1` the code will fail.
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
options validvarname = any;
|
||||||
|
data varnameANY;
|
||||||
|
set sashelp.class(obs=3);
|
||||||
|
|
||||||
|
'A&B'n=42;
|
||||||
|
'space name'n=101;
|
||||||
|
'2025-08'n=234;
|
||||||
|
'2025%09'n=235;
|
||||||
|
"2025'10"n=236;
|
||||||
|
'2025"11'n=237;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%put %getVars(varnameANY, nlit=1);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 13.** Create macro variable array ABC for all variables.
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%getVars(varnameANY, mcArray=ABC, nlit=1);
|
||||||
|
%put %ABC(1) %ABC(6) %ABC(7) %ABC(11);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**EXAMPLE 14.** Get only variables with illegal characters in names.
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%let notV7compliant = %getVars(varnameANY, pattern=[^a-z0-9_], nlit=1);
|
||||||
|
%put ¬V7compliant.;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 14.** Print variables starting with a digit.
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%put %getVars(varnameANY, pattern=^\d, nlit=1);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -1906,6 +1982,11 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
* `ignoreCases=` - *Optional*, default value is 1.
|
* `ignoreCases=` - *Optional*, default value is 1.
|
||||||
Indicates if search should be case insensitive.
|
Indicates if search should be case insensitive.
|
||||||
|
|
||||||
|
* `nlit=` - *Optional*, default value is 0.
|
||||||
|
Introduced to improve `validvarname=ANY` handling.
|
||||||
|
Indicates if the `NLITERAL()` function should be
|
||||||
|
executed to cover spacial characters.
|
||||||
|
|
||||||
|
|
||||||
### EXAMPLES AND USECASES: ####################################################
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
@@ -2012,6 +2093,9 @@ plots of kernel density estimates, jitter data values, and box-and-whiskers plot
|
|||||||
|
|
||||||
See examples below for the details.
|
See examples below for the details.
|
||||||
|
|
||||||
|
The "Here Comes the Rain (Cloud Plot) Again" (B. Jablonski, 2024) article
|
||||||
|
describing the macro is attached as an additional content to the package.
|
||||||
|
|
||||||
### SYNTAX: ###################################################################
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
The basic syntax is the following, the `<...>` means optional parameters:
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
@@ -2029,6 +2113,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
<,boxPlotSymbolSize=>
|
<,boxPlotSymbolSize=>
|
||||||
<,boxPlotLineSize=>
|
<,boxPlotLineSize=>
|
||||||
<,boxPlotFill=>
|
<,boxPlotFill=>
|
||||||
|
<,whiskerScale=>
|
||||||
<,meanShiftLine=>
|
<,meanShiftLine=>
|
||||||
<,meanShiftStep=>
|
<,meanShiftStep=>
|
||||||
<,meanShiftColors=>
|
<,meanShiftColors=>
|
||||||
@@ -2124,6 +2209,12 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
Transparency of the box plot.
|
Transparency of the box plot.
|
||||||
Ranges from 0.0 (opaque) to 1.0 (full translucent).
|
Ranges from 0.0 (opaque) to 1.0 (full translucent).
|
||||||
|
|
||||||
|
* `whiskerScale=` - *Optional*, default value `1.5`.
|
||||||
|
It provides `WS` parameter in the `Q1 - WS*IQR`
|
||||||
|
formula and the `Q3 + WS*IQR` formula.
|
||||||
|
Provided value should be a positive number.
|
||||||
|
Otherwise it is set to 0.
|
||||||
|
|
||||||
* `meanShiftLine` - *Optional*, default value `0`.
|
* `meanShiftLine` - *Optional*, default value `0`.
|
||||||
Indicates if a line connecting mean symbol
|
Indicates if a line connecting mean symbol
|
||||||
on the Box Plot should be added.
|
on the Box Plot should be added.
|
||||||
@@ -2343,12 +2434,14 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
The box-and-whiskers plot has the following interpretation:
|
The box-and-whiskers plot has the following interpretation:
|
||||||
- left vertical bar indicates the *minimum*,
|
- left vertical bar indicates the *minimum*,
|
||||||
- left whisker line starts at `max(Q1 - 1.5IQR, minimum)` and ends at lower quartile (Q1),
|
- left whisker line starts at `max(Q1 - WS*IQR, minimum)` and ends at lower quartile (Q1),
|
||||||
- diamond indicates mean,
|
- diamond indicates mean,
|
||||||
- vertical bar inside of the box indicates median,
|
- vertical bar inside of the box indicates median,
|
||||||
- right whisker line starts at upper quartile (Q3) and ends at `min(Q3 + 1.5IQR, maximum)`,
|
- right whisker line starts at upper quartile (Q3) and ends at `min(Q3 + WS*IQR, maximum)`,
|
||||||
- right vertical bar indicates the *maximum*.
|
- right vertical bar indicates the *maximum*.
|
||||||
|
|
||||||
|
The `WS` value is provided through `whiskerScale=` parameter. Default value is `1.5`.
|
||||||
|
|
||||||
With above setup it may happen that
|
With above setup it may happen that
|
||||||
there is a gap between the minimum marker and the beginning of the left whisker
|
there is a gap between the minimum marker and the beginning of the left whisker
|
||||||
or
|
or
|
||||||
@@ -2510,6 +2603,7 @@ The output can be seen in the `md` file.
|
|||||||
, vertical = 1
|
, vertical = 1
|
||||||
, title = %nrstr(title1 J=C HEIGHT=3 "The VERTICAL plotting is cool, ...";)
|
, title = %nrstr(title1 J=C HEIGHT=3 "The VERTICAL plotting is cool, ...";)
|
||||||
, footnote = %nrstr(footnote1 J=L HEIGHT=2 "... isn't it?";)
|
, footnote = %nrstr(footnote1 J=L HEIGHT=2 "... isn't it?";)
|
||||||
|
, whiskerScale = 1.5
|
||||||
)
|
)
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@@ -4496,7 +4590,129 @@ semicolonN(X)
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `$brackets.` format/informat <a name="brackets-format-49"></a> ######
|
## `$bpklenght.` format/informat <a name="bpklenght-formats-49"></a> ######
|
||||||
|
|
||||||
|
## >>> `bpklength` format/informat: <<< <a name="bpklength-format"></a> #######################
|
||||||
|
|
||||||
|
The **bpklength** format and informats uses the `klength()` function
|
||||||
|
to count the number of letters in a word. For empty string returns 0.
|
||||||
|
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**Example 1.** Informats and format:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data work.count_letters;
|
||||||
|
input x $ 32.;
|
||||||
|
n = input (x, bpklength.);
|
||||||
|
c = input (x, $bpklength.);
|
||||||
|
format x $bpklength.;
|
||||||
|
cards;
|
||||||
|
ż
|
||||||
|
żó
|
||||||
|
żół
|
||||||
|
żółć
|
||||||
|
a
|
||||||
|
ab
|
||||||
|
abc
|
||||||
|
abcd
|
||||||
|
空
|
||||||
|
空手
|
||||||
|
空手道
|
||||||
|
1
|
||||||
|
12
|
||||||
|
123
|
||||||
|
1234
|
||||||
|
12345
|
||||||
|
123456
|
||||||
|
1234567
|
||||||
|
12345678
|
||||||
|
123456789
|
||||||
|
1234567890
|
||||||
|
;
|
||||||
|
run;
|
||||||
|
proc print data=work.count_letters;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Example 2.** Format:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data _null_;
|
||||||
|
length x $ 32767;
|
||||||
|
do i = 32767/3 to 0 by -1111, 10 to 0 by -1;
|
||||||
|
x=repeat("空",i);
|
||||||
|
put x $bpklength.;
|
||||||
|
end;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## `$bplenght.` format/informat <a name="bplenght-formats-50"></a> ######
|
||||||
|
|
||||||
|
## >>> `bplength` format/informat: <<< <a name="bplength-format"></a> #######################
|
||||||
|
|
||||||
|
The **bplength** format and informats use the `lengthn()` function
|
||||||
|
to count the number of bytes in a word.
|
||||||
|
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**Example 1.** Informats and format:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data work.count_bytes;
|
||||||
|
input x $ 32.;
|
||||||
|
n = input (x, bplength.);
|
||||||
|
c = input (x, $bplength.);
|
||||||
|
format x $bplength.;
|
||||||
|
cards;
|
||||||
|
ż
|
||||||
|
żó
|
||||||
|
żół
|
||||||
|
żółć
|
||||||
|
a
|
||||||
|
ab
|
||||||
|
abc
|
||||||
|
abcd
|
||||||
|
空
|
||||||
|
空手
|
||||||
|
空手道
|
||||||
|
1
|
||||||
|
12
|
||||||
|
123
|
||||||
|
1234
|
||||||
|
12345
|
||||||
|
123456
|
||||||
|
1234567
|
||||||
|
12345678
|
||||||
|
123456789
|
||||||
|
1234567890
|
||||||
|
;
|
||||||
|
run;
|
||||||
|
proc print data=work.count_bytes;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Example 2.** Format:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data _null_;
|
||||||
|
length x $ 32767;
|
||||||
|
do i = 32767/3 to 0 by -1111, 10 to 0 by -1;
|
||||||
|
x=repeat("空",i);
|
||||||
|
put x $bplength.;
|
||||||
|
end;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## `$brackets.` format/informat <a name="brackets-formats-51"></a> ######
|
||||||
|
|
||||||
## >>> `brackets.` format: <<< <a name="brackets-format"></a> #######################
|
## >>> `brackets.` format: <<< <a name="brackets-format"></a> #######################
|
||||||
|
|
||||||
@@ -4527,7 +4743,7 @@ run;
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `$semicolon.` format/informat <a name="semicolon-format-50"></a> ######
|
## `$semicolon.` format/informat <a name="semicolon-formats-52"></a> ######
|
||||||
|
|
||||||
## >>> `semicolon.` format: <<< <a name="semicolon-format"></a> #######################
|
## >>> `semicolon.` format: <<< <a name="semicolon-format"></a> #######################
|
||||||
|
|
||||||
@@ -4551,7 +4767,7 @@ run;
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `qsortincbyprocproto()` proto <a name="qsortincbyprocproto-proto-51"></a> ######
|
## `qsortincbyprocproto()` proto <a name="qsortincbyprocproto-proto-53"></a> ######
|
||||||
|
|
||||||
## >>> `qsortInCbyProcProto()` proto function: <<< <a name="qsortincbyprocproto-proto-function"></a> #######################
|
## >>> `qsortInCbyProcProto()` proto function: <<< <a name="qsortincbyprocproto-proto-function"></a> #######################
|
||||||
|
|
||||||
@@ -4613,7 +4829,7 @@ Based on the code from the following pages [2020.08.14]:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `frommissingtonumberbs()` function <a name="frommissingtonumberbs-functions-52"></a> ######
|
## `frommissingtonumberbs()` function <a name="frommissingtonumberbs-functions-54"></a> ######
|
||||||
|
|
||||||
## >>> `fromMissingToNumberBS()` function: <<< <a name="frommissingtonumberbs-function"></a> #######################
|
## >>> `fromMissingToNumberBS()` function: <<< <a name="frommissingtonumberbs-function"></a> #######################
|
||||||
|
|
||||||
@@ -4666,7 +4882,7 @@ fromMissingToNumberBS(x)
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `fromnumbertomissing()` function <a name="fromnumbertomissing-functions-53"></a> ######
|
## `fromnumbertomissing()` function <a name="fromnumbertomissing-functions-55"></a> ######
|
||||||
|
|
||||||
## >>> `fromNumberToMissing()` function: <<< <a name="fromnumbertomissing-function"></a> #######################
|
## >>> `fromNumberToMissing()` function: <<< <a name="fromnumbertomissing-function"></a> #######################
|
||||||
|
|
||||||
@@ -4718,7 +4934,7 @@ fromNumberToMissing(x)
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `quicksort4notmiss()` function <a name="quicksort4notmiss-functions-54"></a> ######
|
## `quicksort4notmiss()` function <a name="quicksort4notmiss-functions-56"></a> ######
|
||||||
|
|
||||||
## >>> `quickSort4NotMiss()` subroutine: <<< <a name="quicksort4notmiss-subroutine"></a> #######################
|
## >>> `quickSort4NotMiss()` subroutine: <<< <a name="quicksort4notmiss-subroutine"></a> #######################
|
||||||
|
|
||||||
@@ -4812,7 +5028,7 @@ call quickSort4NotMiss(A)
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `quicksorthash()` function <a name="quicksorthash-functions-55"></a> ######
|
## `quicksorthash()` function <a name="quicksorthash-functions-57"></a> ######
|
||||||
|
|
||||||
## >>> `quickSortHash()` subroutine: <<< <a name="quicksorthash-subroutine"></a> #######################
|
## >>> `quickSortHash()` subroutine: <<< <a name="quicksorthash-subroutine"></a> #######################
|
||||||
|
|
||||||
@@ -5053,7 +5269,7 @@ call quickSortHash(A)
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `quicksorthashsddv()` function <a name="quicksorthashsddv-functions-56"></a> ######
|
## `quicksorthashsddv()` function <a name="quicksorthashsddv-functions-58"></a> ######
|
||||||
|
|
||||||
## >>> `quickSortHashSDDV()` subroutine: <<< <a name="quicksorthashsddv-subroutine"></a> #######################
|
## >>> `quickSortHashSDDV()` subroutine: <<< <a name="quicksorthashsddv-subroutine"></a> #######################
|
||||||
|
|
||||||
@@ -5184,7 +5400,7 @@ call quickSortHashSDDV(A, SDDV)
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `quicksortlight()` function <a name="quicksortlight-functions-57"></a> ######
|
## `quicksortlight()` function <a name="quicksortlight-functions-59"></a> ######
|
||||||
|
|
||||||
## >>> `quickSortLight()` subroutine: <<< <a name="quicksortlight-subroutine"></a> #######################
|
## >>> `quickSortLight()` subroutine: <<< <a name="quicksortlight-subroutine"></a> #######################
|
||||||
|
|
||||||
@@ -5393,7 +5609,7 @@ call quickSortLight(A)
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%date()` macro <a name="date-macro-58"></a> ######
|
## `%date()` macro <a name="date-macro-60"></a> ######
|
||||||
|
|
||||||
## >>> `%date()` macro: <<< <a name="date-macro"></a> #######################
|
## >>> `%date()` macro: <<< <a name="date-macro"></a> #######################
|
||||||
|
|
||||||
@@ -5436,7 +5652,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%datetime()` macro <a name="datetime-macro-59"></a> ######
|
## `%datetime()` macro <a name="datetime-macro-61"></a> ######
|
||||||
|
|
||||||
## >>> `%datetime()` macro: <<< <a name="datetime-macro"></a> #######################
|
## >>> `%datetime()` macro: <<< <a name="datetime-macro"></a> #######################
|
||||||
|
|
||||||
@@ -5493,7 +5709,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%downloadfilesto()` macro <a name="downloadfilesto-macro-60"></a> ######
|
## `%downloadfilesto()` macro <a name="downloadfilesto-macro-62"></a> ######
|
||||||
|
|
||||||
## >>> `%downloadFilesTo()` macro: <<< <a name="downloadfilesto-macro"></a> #######################
|
## >>> `%downloadFilesTo()` macro: <<< <a name="downloadfilesto-macro"></a> #######################
|
||||||
|
|
||||||
@@ -5625,7 +5841,111 @@ run;
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%filepath()` macro <a name="filepath-macro-61"></a> ######
|
## `%expanddatasetslist()` macro <a name="expanddatasetslist-macro-63"></a> ######
|
||||||
|
|
||||||
|
## >>> `%expandDataSetsList()` macro: <<< <a name="expanddatasetslist-macro"></a> #######################
|
||||||
|
|
||||||
|
The `%expandDataSetsList()` macro is dedicated to "lazy typers".
|
||||||
|
|
||||||
|
It allows to expand data set names provides in form of a SAS list for a given library.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%expandDataSetsList()` macro works as pure macro code.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%expandDataSetsList(
|
||||||
|
lib
|
||||||
|
,datasets
|
||||||
|
<,quote=>
|
||||||
|
<,views=>
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `lib` - *Required*, is a name of a library
|
||||||
|
where data sets are looked-up.
|
||||||
|
|
||||||
|
2. `datasets` - *Required*, is a list of data sets or views
|
||||||
|
to be expanded. Can be named list (e.g. `x_:`),
|
||||||
|
can be enumerated list (e.g. `y_1-y_5`), or both.
|
||||||
|
Also the `_ALL_` value is accepted.
|
||||||
|
|
||||||
|
*. `quote` - *Optional*, binary indicator (default `0` means "no").
|
||||||
|
Tells if data set names should be quoted.
|
||||||
|
|
||||||
|
*. `views` - *Optional*, binary indicator (default `1` means "yes").
|
||||||
|
Tells if views names should be listed too.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 0.** Create data sets for tests:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data x_a x_b x_c x_d x_e x_f;
|
||||||
|
x=17;
|
||||||
|
run;
|
||||||
|
data y1 y2 y3 y4 y9 y10 y11 y12;
|
||||||
|
y=42;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Display names of listed datasets, handle not existing too:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%PUT #%expandDataSetsList(lib=work,datasets=x_: y1-y4 y9)#;
|
||||||
|
|
||||||
|
%PUT #%expandDataSetsList(lib=work,datasets=x_: y1-y4 notExist_1-notExist_10)#;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** Display one and all datasets from `WORK`, names quoted:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%PUT %expandDataSetsList(lib=work,datasets=_ALL_, quote=1);
|
||||||
|
|
||||||
|
%PUT %expandDataSetsList(lib=work,datasets=x_a, quote=1);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** In tandem with the `resolve()` function:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data _null_;
|
||||||
|
test=resolve('%expandDataSetsList(lib=work,datasets=x_:, quote=1)');
|
||||||
|
put test / test hex72.;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 4.** Workaround for `proc delete` not working with colon operator,
|
||||||
|
observe a warning info for `x_:` list:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
proc delete lib=work data=%expandDataSetsList(lib=work,datasets=x_:)
|
||||||
|
;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%PUT #%expandDataSetsList(lib=work,datasets=x_: y1-y4 y9)#;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 5.** Including and excluding views:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%PUT %expandDataSetsList(lib=sashelp,datasets=_ALL_);
|
||||||
|
|
||||||
|
%PUT %expandDataSetsList(lib=sashelp,datasets=_ALL_,views=0);
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## `%filepath()` macro <a name="filepath-macro-64"></a> ######
|
||||||
|
|
||||||
## >>> `%filePath()` macro: <<< <a name="filepath-macro"></a> #######################
|
## >>> `%filePath()` macro: <<< <a name="filepath-macro"></a> #######################
|
||||||
|
|
||||||
@@ -5665,7 +5985,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%finddswithvarval()` macro <a name="finddswithvarval-macro-62"></a> ######
|
## `%finddswithvarval()` macro <a name="finddswithvarval-macro-65"></a> ######
|
||||||
|
|
||||||
## >>> `%findDSwithVarVal()` macro: <<< <a name="finddswithvarval-macro"></a> #######################
|
## >>> `%findDSwithVarVal()` macro: <<< <a name="finddswithvarval-macro"></a> #######################
|
||||||
|
|
||||||
@@ -5793,7 +6113,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%fmt()` macro <a name="fmt-macro-63"></a> ######
|
## `%fmt()` macro <a name="fmt-macro-66"></a> ######
|
||||||
|
|
||||||
## >>> `%fmt()` macro: <<< <a name="fmt-macro"></a> #######################
|
## >>> `%fmt()` macro: <<< <a name="fmt-macro"></a> #######################
|
||||||
|
|
||||||
@@ -5862,7 +6182,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%generateoneliners()` macro <a name="generateoneliners-macro-64"></a> ######
|
## `%generateoneliners()` macro <a name="generateoneliners-macro-67"></a> ######
|
||||||
|
|
||||||
## >>> `%GenerateOneLiners()` macro: <<< <a name="generateoneliners-macro"></a> #######################
|
## >>> `%GenerateOneLiners()` macro: <<< <a name="generateoneliners-macro"></a> #######################
|
||||||
|
|
||||||
@@ -5980,7 +6300,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%gettitle()` macro <a name="gettitle-macro-65"></a> ######
|
## `%gettitle()` macro <a name="gettitle-macro-68"></a> ######
|
||||||
|
|
||||||
## >>> `%getTitle()` macro: <<< <a name="gettitle-macro"></a> #######################
|
## >>> `%getTitle()` macro: <<< <a name="gettitle-macro"></a> #######################
|
||||||
|
|
||||||
@@ -6066,7 +6386,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%iffunc()` macro <a name="iffunc-macro-66"></a> ######
|
## `%iffunc()` macro <a name="iffunc-macro-69"></a> ######
|
||||||
|
|
||||||
## >>> `%iffunc()` macro: <<< <a name="iffunc-macro"></a> #######################
|
## >>> `%iffunc()` macro: <<< <a name="iffunc-macro"></a> #######################
|
||||||
|
|
||||||
@@ -6133,7 +6453,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
3. `false` - *Required*, value returned when condition is false.
|
3. `false` - *Required*, value returned when condition is false.
|
||||||
|
|
||||||
4 `v=` - *Optional*, v for verbose. If set to `1` extra notes
|
* `v=` - *Optional*, v for verbose. If set to `1` extra notes
|
||||||
are printed.
|
are printed.
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -6267,7 +6587,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%infmt()` macro <a name="infmt-macro-67"></a> ######
|
## `%infmt()` macro <a name="infmt-macro-70"></a> ######
|
||||||
|
|
||||||
## >>> `%infmt()` macro: <<< <a name="infmt-macro"></a> #######################
|
## >>> `%infmt()` macro: <<< <a name="infmt-macro"></a> #######################
|
||||||
|
|
||||||
@@ -6324,7 +6644,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%letters()` macro <a name="letters-macro-68"></a> ######
|
## `%letters()` macro <a name="letters-macro-71"></a> ######
|
||||||
|
|
||||||
## >>> `%letters()` macro: <<< <a name="letters-macro"></a> #######################
|
## >>> `%letters()` macro: <<< <a name="letters-macro"></a> #######################
|
||||||
|
|
||||||
@@ -6442,7 +6762,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%libpath()` macro <a name="libpath-macro-69"></a> ######
|
## `%libpath()` macro <a name="libpath-macro-72"></a> ######
|
||||||
|
|
||||||
## >>> `%libPath()` macro: <<< <a name="libpath-macro"></a> #######################
|
## >>> `%libPath()` macro: <<< <a name="libpath-macro"></a> #######################
|
||||||
|
|
||||||
@@ -6487,7 +6807,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%minclude()` macro <a name="minclude-macro-70"></a> ######
|
## `%minclude()` macro <a name="minclude-macro-73"></a> ######
|
||||||
|
|
||||||
## >>> `%mInclude()` macro: <<< <a name="minclude-macro"></a> #######################
|
## >>> `%mInclude()` macro: <<< <a name="minclude-macro"></a> #######################
|
||||||
|
|
||||||
@@ -6700,7 +7020,7 @@ quit;
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%monthshift()` macro <a name="monthshift-macro-71"></a> ######
|
## `%monthshift()` macro <a name="monthshift-macro-74"></a> ######
|
||||||
|
|
||||||
## >>> `%monthShift()` macro: <<< <a name="monthshift-macro"></a> #######################
|
## >>> `%monthShift()` macro: <<< <a name="monthshift-macro"></a> #######################
|
||||||
|
|
||||||
@@ -6849,7 +7169,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%replist()` macro <a name="replist-macro-72"></a> ######
|
## `%replist()` macro <a name="replist-macro-75"></a> ######
|
||||||
|
|
||||||
## >>> `%repList()` macro: <<< <a name="replist-macro"></a> #######################
|
## >>> `%repList()` macro: <<< <a name="replist-macro"></a> #######################
|
||||||
|
|
||||||
@@ -6965,7 +7285,7 @@ run;
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%time()` macro <a name="time-macro-73"></a> ######
|
## `%time()` macro <a name="time-macro-76"></a> ######
|
||||||
|
|
||||||
## >>> `%time()` macro: <<< <a name="time-macro"></a> #######################
|
## >>> `%time()` macro: <<< <a name="time-macro"></a> #######################
|
||||||
|
|
||||||
@@ -7008,7 +7328,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%today()` macro <a name="today-macro-74"></a> ######
|
## `%today()` macro <a name="today-macro-77"></a> ######
|
||||||
|
|
||||||
## >>> `%today()` macro: <<< <a name="today-macro"></a> #######################
|
## >>> `%today()` macro: <<< <a name="today-macro"></a> #######################
|
||||||
|
|
||||||
@@ -7051,7 +7371,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%translate()` macro <a name="translate-macro-75"></a> ######
|
## `%translate()` macro <a name="translate-macro-78"></a> ######
|
||||||
|
|
||||||
## >>> `%translate()` macro: <<< <a name="translate-macro"></a> #######################
|
## >>> `%translate()` macro: <<< <a name="translate-macro"></a> #######################
|
||||||
|
|
||||||
@@ -7115,7 +7435,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%tranwrd()` macro <a name="tranwrd-macro-76"></a> ######
|
## `%tranwrd()` macro <a name="tranwrd-macro-79"></a> ######
|
||||||
|
|
||||||
## >>> `%tranwrd()` macro: <<< <a name="tranwrd-macro"></a> #######################
|
## >>> `%tranwrd()` macro: <<< <a name="tranwrd-macro"></a> #######################
|
||||||
|
|
||||||
@@ -7182,7 +7502,118 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## `%workpath()` macro <a name="workpath-macro-77"></a> ######
|
## `%unifyvarscasesize()` macro <a name="unifyvarscasesize-macro-80"></a> ######
|
||||||
|
|
||||||
|
## >>> `%unifyVarsCaseSize()` macro: <<< <a name="unifyvarscasesize-macro"></a> #######################
|
||||||
|
|
||||||
|
The `%unifyVarsCaseSize()` macro converts *all* variables names into low-case or
|
||||||
|
upcase letters for given library and list of datasets. Only necessary conversion is
|
||||||
|
done, i.e., variable `abc` will not be converted to low-case letters.
|
||||||
|
|
||||||
|
See examples below for the details.
|
||||||
|
|
||||||
|
The `%unifyVarsCaseSize()` macro works as pure macro code.
|
||||||
|
|
||||||
|
[NOTE:] The macro internally uses the `%expandDataSetsList()` macro.
|
||||||
|
|
||||||
|
### SYNTAX: ###################################################################
|
||||||
|
|
||||||
|
The basic syntax is the following, the `<...>` means optional parameters:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%unifyVarsCaseSize(
|
||||||
|
lib
|
||||||
|
,ds
|
||||||
|
<,case=>
|
||||||
|
<,debug=>
|
||||||
|
)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**Arguments description**:
|
||||||
|
|
||||||
|
1. `lib` - *Required*, is a name of a library
|
||||||
|
where data sets are looked-up.
|
||||||
|
|
||||||
|
2. `ds` - *Required*, is a list of data sets
|
||||||
|
to be expanded. Can be named list (e.g. `x_:`),
|
||||||
|
can be enumerated list (e.g. `y_1-y_5`), or both.
|
||||||
|
Also the `_ALL_` value is accepted.
|
||||||
|
|
||||||
|
*. `case` - *Optional*, single letter indicator (default `L` means "low-case").
|
||||||
|
Tells if variables names should low-cased (`l`,`L`) or upcased ("u", "U").
|
||||||
|
|
||||||
|
*. `debug` - *Optional*, binary indicator (default `0` means "no").
|
||||||
|
Tells if processing notes should be printed.
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
### EXAMPLES AND USECASES: ####################################################
|
||||||
|
|
||||||
|
**EXAMPLE 0.** Create data sets for tests:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data aclass1 aclass2 aclass3 bclass4 bclass5 bclass6;
|
||||||
|
set sashelp.class(obs=6);
|
||||||
|
Nn=_N_;
|
||||||
|
if 1=_N_ then output aclass1;
|
||||||
|
if 2=_N_ then output aclass2;
|
||||||
|
if 3=_N_ then output aclass3;
|
||||||
|
if 4=_N_ then output bclass4;
|
||||||
|
if 5=_N_ then output bclass5;
|
||||||
|
if 6=_N_ then output bclass6;
|
||||||
|
run;
|
||||||
|
proc print data=aclass1;
|
||||||
|
run;
|
||||||
|
proc print data=bclass6;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 1.** Convert all variables names to low-case:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%unifyVarsCaseSize(work,aclass:)
|
||||||
|
|
||||||
|
proc print data=aclass1;
|
||||||
|
proc print data=aclass2;
|
||||||
|
proc print data=aclass3;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 2.** Convert all variables names to upcase:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%unifyVarsCaseSize(work,bclass4-bclass6,case=U)
|
||||||
|
|
||||||
|
proc print data=bclass4;
|
||||||
|
proc print data=bclass5;
|
||||||
|
proc print data=bclass6;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 3.** No conversion done:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
data work.abc;
|
||||||
|
abc=42;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%unifyVarsCaseSize(work,abc,debug=1)
|
||||||
|
|
||||||
|
proc print data=abc;
|
||||||
|
run;
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
**EXAMPLE 4.** Variables in all data sets in `WORK` converted to upcase:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~sas
|
||||||
|
%unifyVarsCaseSize(work,_ALL_,case=L)
|
||||||
|
%unifyVarsCaseSize(work,_ALL_,case=U)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## `%workpath()` macro <a name="workpath-macro-81"></a> ######
|
||||||
|
|
||||||
## >>> `%workPath()` macro: <<< <a name="workpath-macro"></a> #######################
|
## >>> `%workPath()` macro: <<< <a name="workpath-macro"></a> #######################
|
||||||
|
|
||||||
@@ -7225,7 +7656,7 @@ The basic syntax is the following, the `<...>` means optional parameters:
|
|||||||
|
|
||||||
# License <a name="license"></a> ######
|
# License <a name="license"></a> ######
|
||||||
|
|
||||||
Copyright (c) 2020 - 2023 Bartosz Jablonski
|
Copyright (c) 2020 - 2025 Bartosz Jablonski
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
BIN
baseplus.zip
698
extras/Paper_164-WUSS2024.sas
Normal file
@@ -0,0 +1,698 @@
|
|||||||
|
/* WUSS 2024 Paper 164 */
|
||||||
|
/* "Here Comes the Rain (Cloud Plot) Again" */
|
||||||
|
/* by Bartosz Jablonski */
|
||||||
|
|
||||||
|
/* Rain Cloud Plots - PART 1 - Article Plots */
|
||||||
|
|
||||||
|
/* SETUP *//*
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Only the first time:
|
||||||
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
filename packages "/path/to/my/packages";
|
||||||
|
|
||||||
|
filename SPFinit url "https://bit.ly/SPFinit"; *(1);
|
||||||
|
%include SPFinit;
|
||||||
|
|
||||||
|
%installPackage(SPFinit BasePlus) *(2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
On start of fresh SAS session:
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
filename packages "/path/to/my/packages";
|
||||||
|
%include packages(SPFinit.sas);
|
||||||
|
|
||||||
|
%loadPackageS(BasePlus) *(3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*footnotes**********************************************************
|
||||||
|
*(1); Bitly points to:
|
||||||
|
https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/SPFinit.sas
|
||||||
|
|
||||||
|
*(2); BasePlus is loaded for the %RainCloudPlot() macro.
|
||||||
|
|
||||||
|
*(3); RainCloudPlot can be just "cherry picked" from BasePlus:
|
||||||
|
%loadPackage(BasePlus, cherryPick=RainCloudPlot)
|
||||||
|
*********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/* basePlus, version 1.41.0 or later is required */
|
||||||
|
/* Help notes in log */
|
||||||
|
%helpPackage(basePlus, RainCloudPlot)
|
||||||
|
|
||||||
|
|
||||||
|
%let path=/path/for/plots/; /* adjust for your session */
|
||||||
|
|
||||||
|
resetline;
|
||||||
|
data have;
|
||||||
|
call streaminit(42);
|
||||||
|
do i = 1 to 3;
|
||||||
|
groupingVar = byte(64+i);
|
||||||
|
do j = 1 to rand("integer",17,42);
|
||||||
|
select(i);
|
||||||
|
when(1) analysisVar = rand("uniform", 1, 7);
|
||||||
|
when(2) analysisVar = rand("normal", -3, 2);
|
||||||
|
when(3) analysisVar = rand("exponential", 2);
|
||||||
|
otherwise;
|
||||||
|
end;
|
||||||
|
output;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
drop i j;
|
||||||
|
run;
|
||||||
|
proc print;
|
||||||
|
run;
|
||||||
|
|
||||||
|
/* utility macros */
|
||||||
|
%macro beforePlot(N,orientation=landscape,papersize=A4);
|
||||||
|
ods printer close; ods pdf close;
|
||||||
|
options orientation=&orientation. nodate nonumber papersize=&papersize. center;
|
||||||
|
options topmargin=0cm leftmargin=0cm rightmargin=0cm bottommargin=0cm;
|
||||||
|
ods pdf file="&path.//WUSS2024paper164plot&n..pdf" contents=no notoc dpi=600;
|
||||||
|
ods printer file="&path.//WUSS2024paper164plot&n..svg" printer=svg dpi=600;
|
||||||
|
%mend beforePlot;
|
||||||
|
|
||||||
|
%macro afterPlot();
|
||||||
|
ods printer close;
|
||||||
|
ods pdf close;
|
||||||
|
%mend afterPlot;
|
||||||
|
|
||||||
|
|
||||||
|
/* 1 */
|
||||||
|
%beforePlot(1);
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
/* 2 */
|
||||||
|
%beforePlot(2)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, TITLE = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";
|
||||||
|
)
|
||||||
|
, FOOTNOTE =
|
||||||
|
%str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
/* 3 */
|
||||||
|
%beforePlot(3)
|
||||||
|
data colors;
|
||||||
|
input color :$20. @@;
|
||||||
|
retain y -0.5;
|
||||||
|
value=1;
|
||||||
|
x=1;
|
||||||
|
y+1;
|
||||||
|
cards;
|
||||||
|
BlueViolet RoyalBlue OliveDrab
|
||||||
|
Gold HotPink Crimson
|
||||||
|
MediumPurple CornflowerBlue YellowGreen
|
||||||
|
Goldenrod Orchid IndianRed
|
||||||
|
;
|
||||||
|
run;
|
||||||
|
proc sgplot data=colors noborder noautolegend nowall subpixel;
|
||||||
|
styleattrs
|
||||||
|
DATACOLORS = (
|
||||||
|
BlueViolet RoyalBlue OliveDrab
|
||||||
|
Gold HotPink Crimson
|
||||||
|
MediumPurple CornflowerBlue YellowGreen
|
||||||
|
Goldenrod Orchid IndianRed
|
||||||
|
)
|
||||||
|
;
|
||||||
|
vbarparm response=value category=value/
|
||||||
|
group=color
|
||||||
|
grouporder=data
|
||||||
|
nooutline
|
||||||
|
groupdisplay=stack
|
||||||
|
clusterwidth=1
|
||||||
|
baselineattrs=(thickness=0)
|
||||||
|
;
|
||||||
|
text X=x Y=y TEXT=color /
|
||||||
|
backlight=.5
|
||||||
|
position=right
|
||||||
|
discreteoffset=-0.42
|
||||||
|
textattrs=(family="Courier New" size=14 weight=bold)
|
||||||
|
;
|
||||||
|
|
||||||
|
xaxis display=none offsetmax=0 offsetmin=0;
|
||||||
|
yaxis display=none;
|
||||||
|
run;
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
/* 4 */
|
||||||
|
%beforePlot(4)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";
|
||||||
|
)
|
||||||
|
, footnote =
|
||||||
|
%str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, MONOCHROME=1
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
/* 5 */
|
||||||
|
%beforePlot(5)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, COLORSLIST = CornflowerBlue OliveDrab IndianRed
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
/* 6 */
|
||||||
|
%beforePlot(6)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, RAINDROPSIZE = 8px
|
||||||
|
, KERNEL_K = quadratic
|
||||||
|
, KERNEL_C = 0.99
|
||||||
|
, VSCALE = Percent
|
||||||
|
, VSCALEmax = 60
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
/* 7 */
|
||||||
|
%beforePlot(7)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud (without BOX) Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, BOXPLOT=0
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 8 */
|
||||||
|
%beforePlot(8)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, BOXPLOT=1
|
||||||
|
, BOXPLOTFILL = 0.5
|
||||||
|
, BOXPLOTLINESIZE = 2px
|
||||||
|
, BOXPLOTSYMBOLSIZE = 12px 8px
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
resetline;
|
||||||
|
proc format;
|
||||||
|
value $ FormatForGroup
|
||||||
|
"A" = 'Uniform[1, 7]'
|
||||||
|
"B" = 'Normal(-4, 2)'
|
||||||
|
"C" = 'Exponential(2)'
|
||||||
|
other = "Unknown!"
|
||||||
|
;
|
||||||
|
|
||||||
|
picture myPercent
|
||||||
|
0-100 = "099.9%"
|
||||||
|
other = "Wrong value"
|
||||||
|
;
|
||||||
|
run;
|
||||||
|
|
||||||
|
proc datasets lib=work nolist;
|
||||||
|
modify have;
|
||||||
|
format groupingVar $FormatForGroup.;
|
||||||
|
run;
|
||||||
|
quit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 9 */
|
||||||
|
%let labelStyle = size=10 family="Courier New" color=MidnightBlue weight=bold;
|
||||||
|
%let valuesStyle = size=8 family="Courier New" style=italic;
|
||||||
|
|
||||||
|
%beforePlot(9)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, boxplot=1
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
|
||||||
|
, XLABELS = ("Analyzed variable")
|
||||||
|
, XLABELPOS = CENTER
|
||||||
|
, XLABELATTRS = &labelStyle.
|
||||||
|
, XAXISVALUEATTRS = &valuesStyle.
|
||||||
|
, XAXISTICKSTYLE = ACROSS
|
||||||
|
, XBOTHAXIS = 0
|
||||||
|
|
||||||
|
, XAXISVALUES=(-10 to 10 by 2)
|
||||||
|
, XAXISVALUESFORMAT=F5.2 /* instead w.d format use Fw.d !! */
|
||||||
|
, XAXISOTHER=grid gridattrs=(thickness=0)
|
||||||
|
minor minorgrid minorgridattrs=(color=cxefefef pattern=dot)
|
||||||
|
|
||||||
|
, CATLABELS = ("Grouping variable with formated values")
|
||||||
|
, CATLABELPOS = TOP
|
||||||
|
, CATLABELATTRS = &labelStyle.
|
||||||
|
, CATAXISVALUEATTRS = &valuesStyle.
|
||||||
|
, FORMATED = 1
|
||||||
|
|
||||||
|
, Y2AXIS = 1
|
||||||
|
, Y2AXISLEVELS = 5
|
||||||
|
, Y2AXISVALUEATTRS = &valuesStyle.
|
||||||
|
, Y2AXISFORMAT = myPercent.
|
||||||
|
, Y2AXISLINES = 1
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 10 */
|
||||||
|
%let labelStyle = size=10 family="Courier New" color=MidnightBlue weight=bold;
|
||||||
|
%let valuesStyle = size=8 family="Courier New" style=italic;
|
||||||
|
|
||||||
|
%beforePlot(10)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, boxplot=1
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, xlabels = ("Analyzed variable")
|
||||||
|
, xlabelpos = CENTER
|
||||||
|
, xlabelattrs = &labelStyle.
|
||||||
|
, xaxisvalueattrs = &valuesStyle.
|
||||||
|
, xaxistickstyle = ACROSS
|
||||||
|
, xbothaxis = 0
|
||||||
|
, xaxisValues=(-8 to 8 by 2)
|
||||||
|
, xaxisValuesFormat=F5.2
|
||||||
|
, xaxisOther=GRID MINOR MINORGRID MINORGRIDATTRS=(color=CXeFeFeF pattern=dot) GRIDATTRS=(thickness=0)
|
||||||
|
, catlabels = ("Grouping variable with formated values")
|
||||||
|
, catlabelpos = TOP
|
||||||
|
, catlabelattrs = &labelStyle.
|
||||||
|
, cataxisvalueattrs = &valuesStyle.
|
||||||
|
, formated = 1
|
||||||
|
, y2axis = 1
|
||||||
|
, y2axislevels = 5
|
||||||
|
, y2axisvalueattrs = &valuesStyle.
|
||||||
|
, y2axisformat = myPercent.
|
||||||
|
, y2axislines = 1
|
||||||
|
|
||||||
|
, WIDTHPX = 1200
|
||||||
|
, HEIGHTPX = 300
|
||||||
|
|
||||||
|
, MINRANGE = -8
|
||||||
|
, MAXRANGE = 8
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
/* 11 */
|
||||||
|
%let labelStyle = size=10 family="Courier New" color=MidnightBlue weight=bold;
|
||||||
|
%let valuesStyle = size=8 family="Courier New" style=italic;
|
||||||
|
|
||||||
|
%beforePlot(11)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, boxplot=1
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, xlabels = ("Analyzed variable")
|
||||||
|
, xlabelpos = CENTER
|
||||||
|
, xlabelattrs = &labelStyle.
|
||||||
|
, xaxisvalueattrs = &valuesStyle.
|
||||||
|
, xaxistickstyle = ACROSS
|
||||||
|
, xbothaxis = 0
|
||||||
|
, xaxisValues=(-8 to 8 by 2)
|
||||||
|
, xaxisValuesFormat=F5.2
|
||||||
|
, xaxisOther=GRID MINOR MINORGRID MINORGRIDATTRS=(color=CXeFeFeF pattern=dot) GRIDATTRS=(thickness=0)
|
||||||
|
, catlabels = ("Grouping variable with formated values")
|
||||||
|
, catlabelpos = TOP
|
||||||
|
, catlabelattrs = &labelStyle.
|
||||||
|
, cataxisvalueattrs = &valuesStyle.
|
||||||
|
, formated = 1
|
||||||
|
, y2axis = 1
|
||||||
|
, y2axislevels = 5
|
||||||
|
, y2axisvalueattrs = &valuesStyle.
|
||||||
|
, y2axisformat = myPercent.
|
||||||
|
, y2axislines = 1
|
||||||
|
, widthpx = 1200
|
||||||
|
, heightpx = 300
|
||||||
|
, minrange = -8
|
||||||
|
, maxrange = 8
|
||||||
|
|
||||||
|
, ODSGRAPHICSOPTIONS = NOBORDER
|
||||||
|
, SGPLOTOPTIONS = NOAUTOLEGEND NOBORDER NOWALL PAD=0
|
||||||
|
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 12 */
|
||||||
|
%let labelStyle = size=10 family="Courier New" color=MidnightBlue weight=bold;
|
||||||
|
%let valuesStyle = size=8 family="Courier New" style=italic;
|
||||||
|
|
||||||
|
data WORK.IN_PROGRESS;
|
||||||
|
function="TEXT"; transparency=0.5;
|
||||||
|
textcolor="GOLD"; textweight="BOLD";
|
||||||
|
widthunit="PERCENT"; drawspace="GRAPHPERCENT";
|
||||||
|
width=500;
|
||||||
|
|
||||||
|
|
||||||
|
label="*) will be ready for WUSS 2024";
|
||||||
|
textsize=24; anchor="LEFT ";
|
||||||
|
x1=2; y1=3; rotate=0;
|
||||||
|
output;
|
||||||
|
|
||||||
|
label="Draft(*ESC*){sup '*'}";
|
||||||
|
textsize=128; anchor="CENTER";
|
||||||
|
x1=50; y1=50; rotate=30;
|
||||||
|
output;
|
||||||
|
run;
|
||||||
|
|
||||||
|
|
||||||
|
%beforePlot(12)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, boxplot=1
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, xlabels = ("Analyzed variable")
|
||||||
|
, xlabelpos = CENTER
|
||||||
|
, xlabelattrs = &labelStyle.
|
||||||
|
, xaxisvalueattrs = &valuesStyle.
|
||||||
|
, xaxistickstyle = ACROSS
|
||||||
|
, xbothaxis = 0
|
||||||
|
, xaxisValues=(-8 to 8 by 2)
|
||||||
|
, xaxisValuesFormat=F5.2
|
||||||
|
, xaxisOther=GRID MINOR MINORGRID MINORGRIDATTRS=(color=CXeFeFeF pattern=dot) GRIDATTRS=(thickness=0)
|
||||||
|
, catlabels = ("Grouping variable with formated values")
|
||||||
|
, catlabelpos = TOP
|
||||||
|
, catlabelattrs = &labelStyle.
|
||||||
|
, cataxisvalueattrs = &valuesStyle.
|
||||||
|
, formated = 1
|
||||||
|
, y2axis = 1
|
||||||
|
, y2axislevels = 5
|
||||||
|
, y2axisvalueattrs = &valuesStyle.
|
||||||
|
, y2axisformat = myPercent.
|
||||||
|
, y2axislines = 1
|
||||||
|
, widthpx = 1200
|
||||||
|
, heightpx = 300
|
||||||
|
, minrange = -8
|
||||||
|
, maxrange = 8
|
||||||
|
, odsgraphicsoptions = noborder
|
||||||
|
, sgplotoptions = noautolegend noborder nowall pad=0
|
||||||
|
|
||||||
|
, SGANNO = WORK.IN_PROGRESS
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 13 */
|
||||||
|
%beforePlot(13)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have2
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot - vertical";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE2, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, boxplot=1
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, xlabels = ("Analyzed variable")
|
||||||
|
, xlabelpos = CENTER
|
||||||
|
, xlabelattrs = &labelStyle.
|
||||||
|
, xaxisvalueattrs = &valuesStyle.
|
||||||
|
, xaxistickstyle = ACROSS
|
||||||
|
, xbothaxis = 0
|
||||||
|
, xaxisValues=(-8 to 8 by 2)
|
||||||
|
, xaxisValuesFormat=F5.2
|
||||||
|
, xaxisOther=GRID MINOR MINORGRID MINORGRIDATTRS=(color=CXeFeFeF pattern=dot) GRIDATTRS=(thickness=0)
|
||||||
|
, catlabels = ("Grouping variable (formatted)")
|
||||||
|
, catlabelpos = CENTER
|
||||||
|
, catlabelattrs = &labelStyle.
|
||||||
|
, cataxisvalueattrs = &valuesStyle.
|
||||||
|
, formated = 1
|
||||||
|
, y2axis = 1
|
||||||
|
, y2axislevels = 5
|
||||||
|
, y2axisvalueattrs = &valuesStyle.
|
||||||
|
, y2axisformat = myPercent.
|
||||||
|
, y2axislines = 1
|
||||||
|
, widthpx = 1200
|
||||||
|
, heightpx = 300
|
||||||
|
, minrange = .
|
||||||
|
, maxrange = .
|
||||||
|
, odsgraphicsoptions = noborder
|
||||||
|
, sgplotoptions = noautolegend noborder nowall pad=0
|
||||||
|
, sganno = work.in_progress
|
||||||
|
|
||||||
|
, MEANSHIFTLINE=1
|
||||||
|
, MEANSHIFTSTEP=0.1
|
||||||
|
, MEANSHIFTCOLORS=Blue Green Red
|
||||||
|
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
resetline;
|
||||||
|
/* 14 */
|
||||||
|
data have2;
|
||||||
|
set have;
|
||||||
|
groupingVar2 = ifc(0=mod(_N_,2),"Even","Odd");
|
||||||
|
analysisVar2 = rannor(42);
|
||||||
|
run;
|
||||||
|
|
||||||
|
|
||||||
|
%beforePlot(14)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have2
|
||||||
|
, groupingVar groupingVar2
|
||||||
|
, analysisVar analysisVar2
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot &gi. &xj.";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE2, with 87 observations, four variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, boxplot=1
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, xlabels = ("First analyzed variable", "Second analyzed variable")
|
||||||
|
, xlabelpos = CENTER
|
||||||
|
, xlabelattrs = &labelStyle.
|
||||||
|
, xaxisvalueattrs = &valuesStyle.
|
||||||
|
, xaxistickstyle = ACROSS
|
||||||
|
, xbothaxis = 0
|
||||||
|
/*, xaxisValues=(-8 to 8 by 2)*/
|
||||||
|
, xaxisValuesFormat=F5.2
|
||||||
|
, xaxisOther=GRID MINOR MINORGRID MINORGRIDATTRS=(color=CXeFeFeF pattern=dot) GRIDATTRS=(thickness=0)
|
||||||
|
, catlabels = ("Grouping variable one", "Grouping variable two")
|
||||||
|
, catlabelpos = TOP
|
||||||
|
, catlabelattrs = &labelStyle.
|
||||||
|
, cataxisvalueattrs = &valuesStyle.
|
||||||
|
, formated = 1
|
||||||
|
, y2axis = 1
|
||||||
|
, y2axislevels = 5
|
||||||
|
, y2axisvalueattrs = &valuesStyle.
|
||||||
|
, y2axisformat = myPercent.
|
||||||
|
, y2axislines = 1
|
||||||
|
, widthpx = 1200
|
||||||
|
, heightpx = 300
|
||||||
|
, minrange = .
|
||||||
|
, maxrange = .
|
||||||
|
, odsgraphicsoptions = noborder
|
||||||
|
, sgplotoptions = noautolegend noborder nowall pad=0
|
||||||
|
, sganno = work.in_progress
|
||||||
|
, meanShiftLine =1
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
/* 15 */
|
||||||
|
%beforePlot(15,orientation=PORTRAIT)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have2
|
||||||
|
, groupingVar
|
||||||
|
, analysisVar
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "The Rain Cloud Plot - vertical";
|
||||||
|
title2 J=C HEIGHT=1 "Plotting for groups: &list_g.";)
|
||||||
|
, footnote = %str(footnote1 J=R H=1 C=Gray
|
||||||
|
"Data set HAVE2, with 87 observations, two variables.";)
|
||||||
|
, colorslist = CornflowerBlue OliveDrab IndianRed
|
||||||
|
, raindropsize = 8px
|
||||||
|
, kernel_k = quadratic
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 60
|
||||||
|
, boxplot=1
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, xlabels = ("Analyzed variable")
|
||||||
|
, xlabelpos = CENTER
|
||||||
|
, xlabelattrs = &labelStyle.
|
||||||
|
, xaxisvalueattrs = &valuesStyle.
|
||||||
|
, xaxistickstyle = ACROSS
|
||||||
|
, xbothaxis = 0
|
||||||
|
, xaxisValues=(-8 to 8 by 2)
|
||||||
|
, xaxisValuesFormat=F5.2
|
||||||
|
, xaxisOther=GRID MINOR MINORGRID MINORGRIDATTRS=(color=CXeFeFeF pattern=dot) GRIDATTRS=(thickness=0)
|
||||||
|
, catlabels = ("Grouping variable (formatted)")
|
||||||
|
, catlabelpos = CENTER
|
||||||
|
, catlabelattrs = &labelStyle.
|
||||||
|
, cataxisvalueattrs = &valuesStyle.
|
||||||
|
, formated = 1
|
||||||
|
, y2axis = 1
|
||||||
|
, y2axislevels = 5
|
||||||
|
, y2axisvalueattrs = &valuesStyle.
|
||||||
|
, y2axisformat = myPercent.
|
||||||
|
, y2axislines = 1
|
||||||
|
, widthpx = 1200
|
||||||
|
, heightpx = 300
|
||||||
|
, minrange = .
|
||||||
|
, maxrange = .
|
||||||
|
, odsgraphicsoptions = noborder
|
||||||
|
, sgplotoptions = noautolegend noborder nowall pad=0
|
||||||
|
, sganno = work.in_progress
|
||||||
|
, meanShiftLine=1
|
||||||
|
, meanShiftStep=0.05
|
||||||
|
|
||||||
|
, VERTICAL = 1
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
%helpPackage(basePlus, RainCloudPlot)
|
||||||
|
*/
|
||||||
|
|
||||||
BIN
extras/Paper_164-WUSS2024_extended.pdf
Normal file
299
extras/Paper_164-WUSS2024_slides.sas
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
/* WUSS 2024 Paper 164 */
|
||||||
|
/* "Here Comes the Rain (Cloud Plot) Again" */
|
||||||
|
/* by Bartosz Jablonski */
|
||||||
|
|
||||||
|
/* Rain Cloud Plots - PART 2 - Presentation Plots */
|
||||||
|
|
||||||
|
/*
|
||||||
|
See:
|
||||||
|
|
||||||
|
Rain Cloud Plots - PART 1 - Article Plots (file: Paper_164-WUSS2024.sas)
|
||||||
|
|
||||||
|
for details about the setup.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data have;
|
||||||
|
call streaminit(64);
|
||||||
|
vertical = 42;
|
||||||
|
do j = 1 to 42;
|
||||||
|
horizontal = rand("uniform", 24, 42);
|
||||||
|
output;
|
||||||
|
end;
|
||||||
|
drop i j;
|
||||||
|
run;
|
||||||
|
data have;
|
||||||
|
set have;
|
||||||
|
horizontal = horizontal - 13;
|
||||||
|
run;
|
||||||
|
proc print;
|
||||||
|
run;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 101 */
|
||||||
|
%beforePlot(101)
|
||||||
|
%rainCloudPlot(
|
||||||
|
have
|
||||||
|
, vertical
|
||||||
|
, horizontal
|
||||||
|
, TITLE = %str(
|
||||||
|
title1 H=2 J=C "Here Come The Rain Again";
|
||||||
|
title2 H=1 J=C "Bartosz Jablonski";
|
||||||
|
)
|
||||||
|
, FOOTNOTE =
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 42
|
||||||
|
, y2axislevels = 1
|
||||||
|
, BOXPLOT=1
|
||||||
|
, BOXPLOTFILL = 0.5
|
||||||
|
, RAINDROPSIZE = 8px
|
||||||
|
, COLORSLIST=CX222222
|
||||||
|
, BOXPLOTLINESIZE = 2pt
|
||||||
|
, MINRANGE = 0
|
||||||
|
, MAXRANGE = 42
|
||||||
|
, xaxistickstyle = ACROSS
|
||||||
|
, xbothaxis = 0
|
||||||
|
, xaxisValues=(0 to 42 by 42)
|
||||||
|
, xaxisValuesFormat=F3.0
|
||||||
|
, xaxisOther=MINOR
|
||||||
|
, widthpx = 1200
|
||||||
|
, heightpx = 800
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
%beforePlot(102)
|
||||||
|
%rainCloudPlot(sashelp.cars, origin, invoice)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
%beforePlot(103)
|
||||||
|
%rainCloudPlot(sashelp.class, sex, height)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%beforePlot(104)
|
||||||
|
%rainCloudPlot(sashelp.cars(where=(origin in: ("E" "U"))), origin, invoice
|
||||||
|
, TITLE = %nrstr(title1 J=C HEIGHT=2 "Distribution of cars prices";
|
||||||
|
title2 J=C HEIGHT=1 COLOR=DarkGrey "Europe vs. US";
|
||||||
|
)
|
||||||
|
, FOOTNOTE = %str(footnote1 J=l H=1 C=Gray "1%) Data from SASHELP.CARS";) /*"*/
|
||||||
|
)
|
||||||
|
%afterPlot() /*"*/
|
||||||
|
|
||||||
|
|
||||||
|
%beforePlot(105)
|
||||||
|
%rainCloudPlot(sashelp.cars(where=(origin in: ("E" "U"))), origin, invoice
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "Distribution of cars prices";
|
||||||
|
title2 J=C HEIGHT=1 COLOR=DarkGrey "Europe vs. US";
|
||||||
|
)
|
||||||
|
, footnote = %str(footnote1 J=l H=1 C=Gray "1%) Data from SASHELP.CARS";) /*"*/
|
||||||
|
|
||||||
|
, COLORSLIST = OrangeRed OliveDrab
|
||||||
|
, BOXPLOTFILL = 0.5
|
||||||
|
, BOXPLOTLINESIZE = 2px
|
||||||
|
, BOXPLOTSYMBOLSIZE = 12px 8px
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%beforePlot(106)
|
||||||
|
%rainCloudPlot(sashelp.cars(where=(origin in: ("E" "U"))), origin, invoice
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "Distribution of cars prices";
|
||||||
|
title2 J=C HEIGHT=1 COLOR=DarkGrey "Europe vs. US";
|
||||||
|
)
|
||||||
|
, footnote = %str(footnote1 J=l H=1 C=Gray "1%) Data from SASHELP.CARS";) /*"*/
|
||||||
|
, colorslist = OrangeRed OliveDrab
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, RAINDROPSIZE = 3px
|
||||||
|
, KERNEL_K = triangular
|
||||||
|
, KERNEL_C = 0.99
|
||||||
|
, VSCALE = Percent
|
||||||
|
, VSCALEmax = 75
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
%beforePlot(107)
|
||||||
|
%let labelStyle = size=10 family="Courier New" color=MidnightBlue weight=bold;
|
||||||
|
%let valuesStyle = size=8 family="Courier New" style=italic;
|
||||||
|
%rainCloudPlot(sashelp.cars(where=(origin in: ("E" "U"))), origin, invoice
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "Distribution of cars prices";
|
||||||
|
title2 J=C HEIGHT=1 COLOR=DarkGrey "Europe vs. US";
|
||||||
|
)
|
||||||
|
, footnote = %str(footnote1 J=l H=1 C=Gray "1%) Data from SASHELP.CARS";) /*"*/
|
||||||
|
, colorslist = OrangeRed OliveDrab
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, raindropsize = 3px
|
||||||
|
, kernel_k = triangular
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 75
|
||||||
|
|
||||||
|
, XLABELS = ("Analyzed variable")
|
||||||
|
, XLABELPOS = CENTER
|
||||||
|
, XLABELATTRS = &labelStyle.
|
||||||
|
, XAXISVALUEATTRS = &valuesStyle.
|
||||||
|
, XAXISTICKSTYLE = ACROSS
|
||||||
|
, XBOTHAXIS = 0
|
||||||
|
|
||||||
|
, XAXISVALUES=(1e4 to 18e4 by 1e4)
|
||||||
|
, XAXISVALUESFORMAT=dollar12.2
|
||||||
|
, XAXISOTHER=grid gridattrs=(thickness=0)
|
||||||
|
minor minorgrid minorgridattrs=(color=cxefefef pattern=dot)
|
||||||
|
|
||||||
|
, CATLABELS = ("Grouping variable")
|
||||||
|
, CATLABELPOS = TOP
|
||||||
|
, CATLABELATTRS = &labelStyle.
|
||||||
|
, CATAXISVALUEATTRS = &valuesStyle.
|
||||||
|
, FORMATED = 1
|
||||||
|
|
||||||
|
, Y2AXIS = 1
|
||||||
|
, Y2AXISLEVELS = 5
|
||||||
|
, Y2AXISVALUEATTRS = &valuesStyle.
|
||||||
|
, Y2AXISFORMAT = F5.2
|
||||||
|
, Y2AXISLINES = 1
|
||||||
|
|
||||||
|
, WIDTHPX = 1200
|
||||||
|
, HEIGHTPX = 350
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data WORK.AT_WUSS;
|
||||||
|
function="TEXT"; transparency=0.3;
|
||||||
|
textcolor="CornflowerBlue"; textweight="BOLD";
|
||||||
|
widthunit="PERCENT"; drawspace="GRAPHPERCENT";
|
||||||
|
width=500;
|
||||||
|
|
||||||
|
label="WUSS(*ESC*){sup '*'}";
|
||||||
|
textsize=96; anchor="CENTER";
|
||||||
|
textfont="Courier New";
|
||||||
|
x1=75; y1=20; rotate=0;
|
||||||
|
output;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%beforePlot(108)
|
||||||
|
%let labelStyle = size=10 family="Courier New" color=MidnightBlue weight=bold;
|
||||||
|
%let valuesStyle = size=8 family="Courier New" style=italic;
|
||||||
|
%rainCloudPlot(sashelp.cars(where=(origin in: ("E" "U"))), origin, invoice
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "Distribution of cars prices";
|
||||||
|
title2 J=C HEIGHT=1 COLOR=DarkGrey "Europe vs. US";
|
||||||
|
)
|
||||||
|
, footnote = %str(footnote1 J=l H=1 C=Gray "1%) Data from SASHELP.CARS";) /*"*/
|
||||||
|
, colorslist = OrangeRed OliveDrab
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, raindropsize = 3px
|
||||||
|
, kernel_k = triangular
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 75
|
||||||
|
, xlabels = ("Analyzed variable")
|
||||||
|
, xlabelpos = center
|
||||||
|
, xlabelattrs = &labelstyle.
|
||||||
|
, xaxisvalueattrs = &valuesstyle.
|
||||||
|
, xaxistickstyle = across
|
||||||
|
, xbothaxis = 0
|
||||||
|
, xaxisvalues=(1e4 to 18e4 by 1e4)
|
||||||
|
, xaxisvaluesformat=dollar12.2
|
||||||
|
, xaxisother=grid gridattrs=(thickness=0)
|
||||||
|
minor minorgrid minorgridattrs=(color=cxefefef pattern=dot)
|
||||||
|
, catlabels = ("Grouping variable")
|
||||||
|
, catlabelpos = top
|
||||||
|
, catlabelattrs = &labelstyle.
|
||||||
|
, cataxisvalueattrs = &valuesstyle.
|
||||||
|
, formated = 1
|
||||||
|
, y2axis = 1
|
||||||
|
, y2axislevels = 5
|
||||||
|
, y2axisvalueattrs = &valuesstyle.
|
||||||
|
, y2axisformat = f5.2
|
||||||
|
, y2axislines = 1
|
||||||
|
, widthpx = 1200
|
||||||
|
, heightpx = 350
|
||||||
|
|
||||||
|
, SGANNO = WORK.AT_WUSS
|
||||||
|
, MEANSHIFTLINE=1
|
||||||
|
, MEANSHIFTSTEP=0.01
|
||||||
|
, MEANSHIFTCOLORS=gold blue
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data WORK.AT_WUSS2;
|
||||||
|
function="TEXT"; transparency=0.3;
|
||||||
|
textcolor="CornflowerBlue"; textweight="BOLD";
|
||||||
|
widthunit="PERCENT"; drawspace="GRAPHPERCENT";
|
||||||
|
width=500;
|
||||||
|
|
||||||
|
label="WUSS(*ESC*){sup '2'}";
|
||||||
|
textsize=96; anchor="CENTER";
|
||||||
|
textfont="Courier New";
|
||||||
|
x1=60; y1=70; rotate=0;
|
||||||
|
output;
|
||||||
|
run;
|
||||||
|
|
||||||
|
%beforePlot(109,orientation=PORTRAIT)
|
||||||
|
%let labelStyle = size=10 family="Courier New" color=MidnightBlue weight=bold;
|
||||||
|
%let valuesStyle = size=8 family="Courier New" style=italic;
|
||||||
|
%rainCloudPlot(sashelp.cars(where=(origin in: ("E" "U"))), origin, invoice
|
||||||
|
, title = %nrstr(title1 J=C HEIGHT=2 "Distribution of cars prices";
|
||||||
|
title2 J=C HEIGHT=1 COLOR=DarkGrey "Europe vs. US";
|
||||||
|
)
|
||||||
|
, footnote = %str(footnote1 J=l H=1 C=Gray "1%) Data from SASHELP.CARS";) /*"*/
|
||||||
|
, colorslist = OrangeRed OliveDrab
|
||||||
|
, boxplotfill = 0.5
|
||||||
|
, boxplotlinesize = 2px
|
||||||
|
, boxplotsymbolsize = 12px 8px
|
||||||
|
, raindropsize = 3px
|
||||||
|
, kernel_k = triangular
|
||||||
|
, kernel_c = 0.99
|
||||||
|
, vscale = percent
|
||||||
|
, vscalemax = 75
|
||||||
|
, xlabels = ("Analyzed variable")
|
||||||
|
, xlabelpos = top
|
||||||
|
, xlabelattrs = &labelstyle.
|
||||||
|
, xaxisvalueattrs = &valuesstyle.
|
||||||
|
, xaxistickstyle = across
|
||||||
|
, xbothaxis = 0
|
||||||
|
, xaxisvalues=(1e4 to 18e4 by 1e4)
|
||||||
|
, xaxisvaluesformat=dollar12.2
|
||||||
|
, xaxisother=grid gridattrs=(thickness=0)
|
||||||
|
minor minorgrid minorgridattrs=(color=cxefefef pattern=dot)
|
||||||
|
, catlabels = ("Grouping variable")
|
||||||
|
, catlabelpos = center
|
||||||
|
, catlabelattrs = &labelstyle.
|
||||||
|
, cataxisvalueattrs = &valuesstyle.
|
||||||
|
, formated = 1
|
||||||
|
, y2axis = 1
|
||||||
|
, y2axislevels = 5
|
||||||
|
, y2axisvalueattrs = &valuesstyle.
|
||||||
|
, y2axisformat = f5.2
|
||||||
|
, y2axislines = 1
|
||||||
|
, widthpx = 1200
|
||||||
|
, heightpx = 400
|
||||||
|
, sganno = WORK.AT_WUSS2
|
||||||
|
, meanshiftline=1
|
||||||
|
, meanshiftstep=0.01
|
||||||
|
, meanshiftcolors=gold blue
|
||||||
|
|
||||||
|
, VERTICAL = 1
|
||||||
|
, ODSGRAPHICSOPTIONS = NOBORDER
|
||||||
|
, SGPLOTOPTIONS = NOAUTOLEGEND NOBORDER NOWALL PAD=0
|
||||||
|
)
|
||||||
|
%afterPlot()
|
||||||
BIN
extras/WUSS2024_slides_164_BartJ.pdf
Normal file
7609
hist/2.0.0/baseplus.md
Normal file
BIN
hist/2.0.0/baseplus.zip
Normal file
BIN
hist/2.0.0/baseplus_RainCloudPlot_Ex0.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
hist/2.0.0/baseplus_RainCloudPlot_Ex1x.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
hist/2.0.0/baseplus_RainCloudPlot_Ex1y.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
hist/2.0.0/baseplus_RainCloudPlot_Ex2a.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
hist/2.0.0/baseplus_RainCloudPlot_Ex2b.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
hist/2.0.0/baseplus_RainCloudPlot_Ex3.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
hist/2.0.0/baseplus_RainCloudPlot_Ex4.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
7609
hist/2.0.1/baseplus.md
Normal file
BIN
hist/2.0.1/baseplus.zip
Normal file
BIN
hist/2.0.1/baseplus_RainCloudPlot_Ex0.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
hist/2.0.1/baseplus_RainCloudPlot_Ex1x.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
hist/2.0.1/baseplus_RainCloudPlot_Ex1y.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
hist/2.0.1/baseplus_RainCloudPlot_Ex2a.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
hist/2.0.1/baseplus_RainCloudPlot_Ex2b.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
hist/2.0.1/baseplus_RainCloudPlot_Ex3.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
hist/2.0.1/baseplus_RainCloudPlot_Ex4.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
7622
hist/2.1.0/baseplus.md
Normal file
BIN
hist/2.1.0/baseplus.zip
Normal file
BIN
hist/2.1.0/baseplus_RainCloudPlot_Ex0.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
hist/2.1.0/baseplus_RainCloudPlot_Ex1x.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
hist/2.1.0/baseplus_RainCloudPlot_Ex1y.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
hist/2.1.0/baseplus_RainCloudPlot_Ex2a.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
hist/2.1.0/baseplus_RainCloudPlot_Ex2b.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
hist/2.1.0/baseplus_RainCloudPlot_Ex3.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
hist/2.1.0/baseplus_RainCloudPlot_Ex4.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
7680
hist/2.3.0/baseplus.md
Normal file
BIN
hist/2.3.0/baseplus.zip
Normal file
BIN
hist/2.3.0/baseplus_RainCloudPlot_Ex0.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
hist/2.3.0/baseplus_RainCloudPlot_Ex1x.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
hist/2.3.0/baseplus_RainCloudPlot_Ex1y.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
hist/2.3.0/baseplus_RainCloudPlot_Ex2a.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
hist/2.3.0/baseplus_RainCloudPlot_Ex2b.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
hist/2.3.0/baseplus_RainCloudPlot_Ex3.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
hist/2.3.0/baseplus_RainCloudPlot_Ex4.png
Normal file
|
After Width: | Height: | Size: 54 KiB |