You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: checkdim.ado
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ opt[sort sort the results in descending order.]
12
12
opt[keep keep the generated variables]
13
13
opt[keepname() the stub for the generated variables. The default stub is "mis".]
14
14
opt[replace replace existing variables which contain the results.]
15
-
opt2[drop drop if the drop condition is met. The default drop condition is to drop variables which having missing values for all levels of a dimension when only the drop option is set.]
15
+
opt[drop drop if the drop condition is met. The default drop condition is to drop variables which having missing values for all levels of a dimension when only the drop option is set.]
Copy file name to clipboardexpand all lines: fdrisk.ado
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
*!Based on the R-code for fdisk.R
3
3
*!Version 0.9 : Initial Github release
4
4
*!Version 0.91 : Removed the dependency on the user-provided integrate-command -> Removed nomata option
5
-
*!Version 0.95 : Updated documentation, last Github release before submission to SSC
5
+
*!Version 0.95 : Updated documentation, added more possibilities to abbreviate options ,last Github release before submission to SSC
6
6
*!To-Do: Rewrite to use Mata whenever possible instead of workarounds in Stata -> Shorten the code
7
7
*! Evaluate input of options directly with the expression parser `= XXX' to allow more flexible input -> somewhat done, but not available for all options
Copy file name to clipboardexpand all lines: plotsgpv.ado
+5-5
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ opt[noshow do not show the outcome of the SGPV calculations. Useful for larger c
21
21
opt[xshow() number representing the maximum ranking on the x-axis that is displayed. Default is to display all intervals.]
22
22
opt[nullcol() coloring of the null interval (indifference zone). Default is the R-colour Hawkes Blue]
23
23
opt[intcol() coloring of the intervals according to SGPV ranking. Default are the R-colours ("cornflowerblue","firebrick3","darkslateblue")} for SGPVs of {it:0}, in {it:(0,1)}, and {it:1} respectively.]
24
-
opt[noplotx_axis deactive showing the x-axis.]
25
-
opt[noploty_axis deactive showing the y-axis.]
24
+
opt[noplotx:_axis deactive showing the x-axis.]
25
+
opt[noploty:_axis deactive showing the y-axis.]
26
26
opt[nooutlinezone deactivate drawing a slim white outline around the null zone. Helpful visual aid when plotting many intervals. Default is on.]
XTitle(string) YTitle(string) noLEGend nomata noshow replace TWOway_opt(string asis) ]
70
70
71
71
72
72
***Some default values : Color settings -> translated R-colors into RGB for Stata -> Not sure how to install the colours in Stata for easier referencing.
Copy file name to clipboardexpand all lines: plotsgpv.sthlp
+19-19
Original file line number
Diff line number
Diff line change
@@ -33,36 +33,36 @@
33
33
{p_end}
34
34
{synopt:{opt nulllo(string)}} lower bound of null interval.
35
35
{p_end}
36
-
{synopt:{opt setorder(string)}} a variable giving the desired order along the x-axis.
36
+
{synopt:{opt seto:rder(string)}} a variable giving the desired order along the x-axis.
37
37
{p_end}
38
38
{synopt:{opt xshow(string)}} number representing the maximum ranking on the x-axis that is displayed. Default is to display all intervals.
39
39
{p_end}
40
40
{synopt:{opt nullcol(string)}} coloring of the null interval (indifference zone). Default is the R-colour Hawkes Blue.
41
41
{p_end}
42
-
{synopt:{opt intcol(string)}} coloring of the intervals according to SGPV ranking.
42
+
{synopt:{opt intc:ol(string)}} coloring of the intervals according to SGPV ranking.
43
43
{p_end}
44
-
{synopt:{opt noploty_axis}} deactive showing the y-axis.
44
+
{synopt:{opt noploty:_axis}} deactive showing the y-axis.
45
45
{p_end}
46
-
{synopt:{opt noplotx_axis}} deactive showing the x-axis.
46
+
{synopt:{opt noplotx:_axis}} deactive showing the x-axis.
47
47
{p_end}
48
48
{synopt:{opt nullpt(#)}} a scalar representing a point null hypothesis. {p_end}
49
49
{synopt:{opt nooutlinezone}} deactivate drawing a slim white outline around the null zone. Helpful visual aid when plotting many intervals. Default is on.
50
50
{p_end}
51
-
{synopt:{opt title(string)}} title of the plot.
51
+
{synopt:{opt t:itle(string)}} title of the plot.
52
52
{p_end}
53
-
{synopt:{opt xtitle(string)}} label of the x-axis label.
53
+
{synopt:{opt xt:itle(string)}} label of the x-axis label.
54
54
{p_end}
55
-
{synopt:{opt ytitle(string)}} label of the y-axis.
55
+
{synopt:{opt yt:itle(string)}} label of the y-axis.
56
56
{p_end}
57
-
{synopt:{opt nolegend}} deactivate plotting the legend.
57
+
{synopt:{opt noleg:end}} deactivate plotting the legend.
58
58
{p_end}
59
59
{synopt:{opt nomata}} do not use Mata for calculating the SGPVs if esthi() and estlo() are variables as inputs or if {cmd:c(matsize)} is smaller than the size of these options.
60
60
{p_end}
61
61
{synopt:{opt noshow}} do not show the outcome of the SGPV calculations. Useful for larger calculations.
62
62
{p_end}
63
63
{synopt:{opt replace}} replace existing variables in case the nomata-option was used.
64
64
{p_end}
65
-
{synopt:{opt twoway_opt(string)}} any additional options for the plotting go here.
65
+
{synopt:{opt two:way_opt(string asis)}} any additional options for the plotting go here.
66
66
{p_end}
67
67
{synoptline}
68
68
{p2colreset}{...}
@@ -99,7 +99,7 @@ To specify that the upper limit is +infinity just specify the missing value . in
99
99
{pstd}
100
100
{p_end}
101
101
{phang}
102
-
{opt setorder(string)} a variable giving the desired order along the x-axis. If {bf:setorder} is set to {bf:"sgpv"}, the second-generation {it:p}-value ranking is used. If {bf:setorder} is empty, the original input ordering is used.
102
+
{opt seto:rder(string)} a variable giving the desired order along the x-axis. If {bf:setorder} is set to {bf:"sgpv"}, the second-generation {it:p}-value ranking is used. If {bf:setorder} is empty, the original input ordering is used.
103
103
104
104
{pstd}
105
105
{p_end}
@@ -115,7 +115,7 @@ To specify that the upper limit is +infinity just specify the missing value . in
115
115
{pstd}
116
116
{p_end}
117
117
{phang}
118
-
{opt intcol(string)} coloring of the intervals according to SGPV ranking. Default are the R-colours ("cornflowerblue","firebrick3","darkslateblue")} for SGPVs of {it:0}, in {it:(0,1)}, and {it:1} respectively.
118
+
{opt intc:ol(string)} coloring of the intervals according to SGPV ranking. Default are the R-colours ("cornflowerblue","firebrick3","darkslateblue")} for SGPVs of {it:0}, in {it:(0,1)}, and {it:1} respectively.
119
119
You can see the colour before plotting via:
120
120
121
121
{stata palette color 100 149 237 } // cornflowerblue
@@ -125,12 +125,12 @@ You can see the colour before plotting via:
125
125
{pstd}
126
126
{p_end}
127
127
{phang}
128
-
{opt noploty_axis} deactive showing the y-axis.
128
+
{opt noploty:_axis} deactive showing the y-axis.
129
129
130
130
{pstd}
131
131
{p_end}
132
132
{phang}
133
-
{opt noplotx_axis} deactive showing the x-axis.
133
+
{opt noplotx:_axis} deactive showing the x-axis.
134
134
135
135
{pstd}
136
136
{p_end}
@@ -145,22 +145,22 @@ You can see the colour before plotting via:
145
145
{pstd}
146
146
{p_end}
147
147
{phang}
148
-
{opt title(string)} title of the plot.
148
+
{opt t:itle(string)} title of the plot.
149
149
150
150
{pstd}
151
151
{p_end}
152
152
{phang}
153
-
{opt xtitle(string)} label of the x-axis.
153
+
{opt xt:itle(string)} label of the x-axis.
154
154
155
155
{pstd}
156
156
{p_end}
157
157
{phang}
158
-
{opt ytitle(string)} label of the y-axis.
158
+
{opt yt:itle(string)} label of the y-axis.
159
159
160
160
{pstd}
161
161
{p_end}
162
162
{phang}
163
-
{opt nolegend} deactivate plotting the legend.
163
+
{opt noleg:end} deactivate plotting the legend.
164
164
165
165
{pstd}
166
166
{p_end}
@@ -180,7 +180,7 @@ You can see the colour before plotting via:
180
180
{pstd}
181
181
{p_end}
182
182
{phang}
183
-
{opt twoway_opt(string)} any additional options for the plotting go here. See {help twoway} for more information about the possible options. Options set here {bf:do not} override the values set in other options before.
183
+
{opt two:way_opt(string asis)} any additional options for the plotting go here. See {help twoway} for more information about the possible options. Options set here {bf:do not} override the values set in other options before.
184
184
{p_end}
185
185
186
186
@@ -189,7 +189,7 @@ You can see the colour before plotting via:
189
189
{pstd}
190
190
{stata sysuse leukstats} // Load the example dataset provided with this command
191
191
192
-
plotsgpv, esthi(ci_hi) estlo(ci_lo) nulllo(-0.3) nullhi(0.3) nomata replace noshow setorder(p_value) title("Leukemia Example") xtitle("Classical p-value ranking") ytitle("Fold Change (base 10)") ylabel(`=log10(1/1000)' "1/1000" `=log10(1/100)' "1/100" `=log10(1/10)' "1/10" `=log10(1/2)' "1/2" `=log10(2)' "2" `=log10(10)' "10" `=log10(100)' "100" `=log10(1000)' "1000") //Replicate the example plot from the R-code
192
+
plotsgpv, esthi(ci_hi) estlo(ci_lo) nulllo(-0.3) nullhi(0.3) nomata replace noshow setorder(p_value) title("Leukemia Example") xtitle("Classical p-value ranking") ytitle("Fold Change (base 10)") twoway_opt(ylabel(`=log10(1/1000)' "1/1000" `=log10(1/100)' "1/100" `=log10(1/10)' "1/10" `=log10(1/2)' "1/2" `=log10(2)' "2" `=log10(10)' "10" `=log10(100)' "100" `=log10(1000)' "1000")) //Replicate the example plot from the R-code
Copy file name to clipboardexpand all lines: sgpv.ado
+15-5
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,21 @@
1
1
*! A wrapper program for calculating the Second-Generation P-Values and their associated diagnosis
2
2
*!Version 0.9: Initial Github release
3
-
*!Version 0.95: Fixed minor mistakes in the documentation, minor bugfixes. changed the way the results are presented
3
+
*!Version 0.95: Fixed minor mistakes in the documentation, added more information about SGPVs and more example use cases; minor bugfixes; changed the way the results are presented
4
+
*!Version 0.96: Added an example how to calculate all statistics for the leukemia dataset; minor fixes in the documentation of all commands and better handling of the matrix option.
4
5
5
6
/*
7
+
Bugfixes to implement for next release:
8
+
- avoid conflicts between different options and prefix, replay modes
9
+
-> what does take precedence? replaying results or matrix or estimate based calculations
10
+
- true replay function -> if previous results exist -> redisplay existing matrix
11
+
6
12
To-Do(Things that I wish to implement at some point or that I think that might be interesting to have:
7
13
- support for more commands which do not report their results in a matrix named "r(table)".
8
14
- Make results exportable or change the command to an e-class command to allow processing in commands like esttab or estpost from Ben Jann
9
15
- Make matrix parsing more flexible and rely on the names of the rows for identifiying the necessary numbers; allow calculations for more than one stored estimate
10
16
- Return more infos
11
17
- Allow plotting of the resulting SGPVs against the normal p-values directly after the calculations
12
18
- Calculate automatically a null interval based on the statistical properties of the dependent variable of an estimation to encourage the usage of interval null-hypotheses.
13
-
- Add a way to calculate the statistics for the whole leukemia dataset. Only parts of the code written yet -> might require some further rewrite of sgpvalue and fdrisk.
14
19
- change the help file generation from makehlp to markdoc for more control over the layout of the help files -> currently requires a lot of manual tuning to get desired results.
15
20
*/
16
21
/* START HELP FILE
@@ -112,9 +117,14 @@ version 12.0
112
117
*Parse the initial input -> Not captured yet the case that sgpv is called only with options or further situations > Should implement a replay function to avoid repeated calculations when only a selection on the matrix is required.
113
118
capture _on_colon_parse `0'
114
119
115
-
116
-
if _rc &"`e(cmd)'"==""&!ustrregexm(`"`0'"',"matrix\(\w+\)") { // If the command was not prefixed and no previous estimation exists. -> needs changes to work with matrix option better
117
-
disp as error "No last estimates for calculating SGPV found."
120
+
/*How avoid conflicts between different option and prefix, replay modes?*/
121
+
/*if _rc & (!ustrregexm(`"`0'"',"matrix\(\w+\)") | !ustrregexm(`"`0'"',"m\(\w+\)") ) { // If the command was not prefixed and no previous estimation exists. -> needs changes to work with matrix option better -> does not work yet with allowed abbreviation of matrix option
122
+
disp as error "No matrix for calculating SGPV found. Make sure that the matrix option is correctly specified as 'matrix(matrixname)' or 'm(matrixname)' . "
123
+
exit 198
124
+
}
125
+
*/
126
+
if _rc &"`e(cmd)'"==""& (!ustrregexm(`"`0'"',"matrix\(\w+\)") &!ustrregexm(`"`0'"',"m\(\w+\)") ) { // If the command was not prefixed and no previous estimation exists. -> needs changes to work with matrix option better -> does not work yet with allowed abbreviation of matrix option
127
+
disp as error "No last estimate or matrix for calculating SGPV found. Make sure that the matrix option is correctly specified as 'matrix(matrixname)' or 'm(matrixname)' . "
0 commit comments