A little off topic: data.frame members [🇷 for BE/BA]

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2018-01-23 18:47 (2648 d 10:38 ago) – Posting: # 18279
Views: 5,456

Hi all,

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

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,668 registered users;
19 visitors (0 registered, 19 guests [including 4 identified bots]).
Forum time: 06:26 CEST (Europe/Vienna)

It is a well-known experience that the only truly enjoyable and
profitable way of studying mathematics is the method of
“filling in details” by one’s own efforts.    Cornelius Lanczos

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5