How to create table of results [Power / Sample Size]

posted by ElMaestro  – Denmark, 2017-07-20 16:32 (2803 d 01:14 ago) – Posting: # 17578
Views: 8,759

Hi BE-proff,

try this:

library(PowerTOST)

arrGMR=c(0.85, 0.9, 0.95, 1.0, 1.05, 1.10, 1.15, 1.20)
myCV=0.26
N=arrGMR

for (i in 1:length(arrGMR))
   N[i]=sampleN.TOST(theta0=arrGMR[i], CV=myCV, targetpower=0.8) [1,7] 

A=data.frame(arrGMR, N)

print(A)


you can easily put it inside a little function if the purpose is specifcally to "return" the data frame (as in, a table).

You can make the code totally fancier and totally unreadable by using sapply or some similar function - I am sure this is what the code police recommends.:-D

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
23,409 posts in 4,921 threads, 1,668 registered users;
14 visitors (0 registered, 14 guests [including 4 identified bots]).
Forum time: 16:47 CET (Europe/Vienna)

An expert is one who knows more and more
about less and less.    Nicholas Murray Butler

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