A little off topic: data.frame members [🇷 for BE/BA]
Hi all,
I think we can use str() to preview all factors' name in a data.frame.
There is no 'n' in df or sampleN.TOST(CV=0.3, theta0=0.95). So it returns NULL. If we do
then it works.
I think we can use str() to preview all factors' name in a data.frame.
df <- sampleN.TOST(CV=0.3, theta0=0.95)
df$n
NULL
str(df)
'data.frame': 1 obs. of 9 variables:
$ Design : Factor w/ 1 level "2x2": 1
$ alpha : num 0.05
$ CV : num 0.3
$ theta0 : num 0.95
$ theta1 : num 0.8
$ theta2 : num 1.25
$ Sample size : num 40
$ Achieved power: num 0.816
$ Target power : num 0.8
There is no 'n' in df or sampleN.TOST(CV=0.3, theta0=0.95). So it returns NULL. If we do
df['Sample size']
Sample size
1 40
df['Target power']
Target power
1 0.8
sampleN.TOST(CV=0.3, theta0=0.95)['Sample size']
+++++++++++ Equivalence test - TOST +++++++++++
Sample size estimation
-----------------------------------------------
Study design: 2x2 crossover
log-transformed data (multiplicative model)
alpha = 0.05, target power = 0.8
BE margins = 0.8 ... 1.25
True ratio = 0.95, CV = 0.3
Sample size (total)
n power
40 0.815845
Sample size
1 40
then it works.
❝ ...and therefore I can simply do this:
❝ sampleN.RSABE(CV=0.3, theta0=0.95)$n
❝ (the n column is baptised as "Sample size" but is still accessible via $n)
—
All the best,
-- Yung-jin Lee
bear v2.9.2:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here
All the best,
-- Yung-jin Lee
bear v2.9.2:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here
Complete thread:
- A little off topic: data.frame members ElMaestro 2018-01-22 23:49 [🇷 for BE/BA]
- R-Inferno Helmut 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 membersyjlee168 2018-01-23 17:47
- R-Inferno Helmut 2018-01-23 13:37