R-Inferno [🇷 for BE/BA]
Hi ElMaestro,
that’s strange. Let’s try to access all values by their (original) names.
We get some NULLs also from
In the functions of
I don’t get it.
I suggest to use
that’s strange. Let’s try to access all values by their (original) names.
library(PowerTOST)
sampleN.RSABE(CV=0.3, theta0=0.95)$design
NULL
sampleN.RSABE(CV=0.3, theta0=0.95)$alpha
[1] 0.05
sampleN.RSABE(CV=0.3, theta0=0.95)$CVwT
[1] 0.3
sampleN.RSABE(CV=0.3, theta0=0.95)$CVwR
[1] 0.3
sampleN.RSABE(CV=0.3, theta0=0.95)$theta0
[1] 0.95
sampleN.RSABE(CV=0.3, theta0=0.95)$theta1
[1] 0.8
sampleN.RSABE(CV=0.3, theta0=0.95)$theta2
[1] 1.25
sampleN.RSABE(CV=0.3, theta0=0.95)$n
[1] 27
sampleN.RSABE(CV=0.3, theta0=0.95)$power
NULL
sampleN.RSABE(CV=0.3, theta0=0.95)$targetpower
NULL
sampleN.RSABE(CV=0.3, theta0=0.95)$nlast
[1] 27
sampleN.TOST(CV=0.3, theta0=0.95)$design
NULL
sampleN.TOST(CV=0.3, theta0=0.95)$alpha
[1] 0.05
sampleN.TOST(CV=0.3, theta0=0.95)$CV
[1] 0.3
sampleN.TOST(CV=0.3, theta0=0.95)$theta0
[1] 0.95
sampleN.TOST(CV=0.3, theta0=0.95)$theta1
[1] 0.8
sampleN.TOST(CV=0.3, theta0=0.95)$theta2
[1] 1.25
sampleN.TOST(CV=0.3, theta0=0.95)$n
NULL
sampleN.TOST(CV=0.3, theta0=0.95)$power
NULL
sampleN.TOST(CV=0.3, theta0=0.95)$targetpower
NULL
We get some NULLs also from
sample.RSABE()
. Even more interesting calling a variable which does not exist (since R is case-sensitive). foo()$design
gave NULL, but:sampleN.RSABE(CV=0.3, theta0=0.95)$Design
[1] 2x3x3
Levels: 2x3x3
sampleN.TOST(CV=0.3, theta0=0.95)$Design
[1] 2x2
Levels: 2x2
In the functions of
PowerTOST
design
is character variable, but Design
is a 1-level factor:is.factor(sampleN.TOST(CV=0.3, theta0=0.95)$Design)
[1] TRUE
I don’t get it.
❝ […] if I want the sample sizes I can also easily get them via [1,7] or [1,8] from the sample size object returned …
I suggest to use
Sample.Nfoo()[["Sample size"]]
instead. You can use it in all functions and the current indices are not carved in stone. If we introduce another variable before #7 or reorder variables in a future version of PowerTOST
your code will not work any more.—
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- A little off topic: data.frame members ElMaestro 2018-01-22 23:49 [🇷 for BE/BA]
- R-InfernoHelmut 2018-01-23 13:37
- R-Inferno d_labes 2018-01-23 15:03
- Thanks :-D ElMaestro 2018-01-23 15:26
- Safe side syntax d_labes 2018-01-23 15:39
- Thanks :-D ElMaestro 2018-01-23 15:26
- R-Inferno d_labes 2018-01-23 15:03
- A little off topic: data.frame members yjlee168 2018-01-23 17:47
- R-InfernoHelmut 2018-01-23 13:37