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

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2018-01-23 18:47 (2138 d 21:25 ago) – Posting: # 18279
Views: 4,457

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.1:- 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
22,811 posts in 4,783 threads, 1,634 registered users;
33 visitors (0 registered, 33 guests [including 9 identified bots]).
Forum time: 16:13 CET (Europe/Vienna)

Inspiration is constantly in the air.
It’s up to us to develop the sensitivity
to pick up on it.    Herbie Hancock

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