## Tutorial (from the start) [Power / Sample Size]

Hi Alyssa,

» Thanks for the detailed tutorial!

Welcome.

» I was trying to follow your command and out in the powerTOST, however, i cant get the sample size estimation. May i know what has gone wrong?

Your results show that you did not attach the library (see Detlew’s post). However, this part of the code alone will still not work because the CV is not specified. You would get:
Error in sampleN.scABEL(CV = CV, design = res$design[j], targetpower = res$target[j],  :   object 'CV' not found
I assumed that you will execute the entire code of the tutorial step by step. If you want only this part and/or the power analysis at the end, start with:

library(PowerTOST) CVwR <- 0.426 CV   <- rep(CVwR, 2)

PS: R-terminology.
• A package contains functions, man-pages, a DESCRIPTION-file (mandatory); data, vignettes, PDFs, … (optional).
Hence, you find in the menu-bar of the R-console. IMHO, in the sub­menu it should rather state instead of because:
• A library is a locally installed package.
Therefore, the command to attach it is library().
• For beginners I recommend . Say, you want to work with “foo”. If “foo” is not installed yet, it will be missing in the list. If you try library(foo) in the R-console and “foo” is not installed you will get:
  Error in library(foo) : there is no package called ‘foo’

The safe way to check whether a package “foo” is already installed (and if not, download it from a CRAN-mirror & install it) and attach the library is:
p <- "foo" i <- p %in% installed.packages() if (length(p[!i]) > 0) install.packages(p[!i]) library(p, character.only = TRUE)

Dif-tor heh smusma 🖖
Helmut Schütz

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes