Tutorial (from the start) [Power / Sample Size]
Hi Alyssa,
Welcome.
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:
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:
PS: R-terminology.
❝ 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 submenu it should rather state instead of because:
- A library is a locally installed package.
Therefore, the command to attach it islibrary()
.
- For beginners I recommend
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) . Say, you want to work with “foo”. If “foo” is not installed yet, it will be missing in the list. If you try
—
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- Sample size calculation (Pilot study result vs literature) Alyssa 2020-05-04 04:35 [Power / Sample Size]
- Sample size calculation (Pilot study result vs literature) Dr_Dan 2020-05-04 08:46
- Sample size calculation (Pilot study result vs literature) Alyssa 2020-05-04 09:26
- Estimation of CVw and/or CVwR Helmut 2020-05-04 12:07
- Estimation of CVw and/or CVwR ElMaestro 2020-05-04 12:14
- Mea culpa! Helmut 2020-05-04 12:40
- It must be Myco ElMaestro 2020-05-04 13:46
- It is, it is! Helmut 2020-05-04 14:07
- It is.... Alyssa 2020-05-05 05:00
- Tutorial Helmut 2020-05-05 12:45
- Tutorial Alyssa 2020-05-08 06:48
- library d_labes 2020-05-08 11:16
- Tutorial (from the start)Helmut 2020-05-08 13:08
- Tutorial (from the start) Alyssa 2020-05-12 04:05
- Tracking down error Helmut 2020-05-12 11:49
- Tracking down error: stringsAsFactors d_labes 2020-05-13 11:34
- R <4.0.0 Helmut 2020-05-13 12:07
- R <4.0.0 ElMaestro 2020-05-13 14:18
- R <4.0.0? Helmut 2020-05-13 14:21
- PowerTOST’s functions with as.character(design) d_labes 2020-05-13 18:50
- PowerTOST’s functions with as.character(design) Helmut 2020-05-13 18:55
- R <4.0.0 ElMaestro 2020-05-13 14:18
- R <4.0.0 Helmut 2020-05-13 12:07
- Tracking down error Alyssa 2020-05-15 05:08
- All’s well that ends well. Helmut 2020-05-15 10:52
- Tracking down error: stringsAsFactors d_labes 2020-05-13 11:34
- Tracking down error Helmut 2020-05-12 11:49
- Tutorial (from the start) Alyssa 2020-05-12 04:05
- Tutorial Alyssa 2020-05-08 06:48
- Tutorial Helmut 2020-05-05 12:45
- It is.... Alyssa 2020-05-05 05:00
- It is, it is! Helmut 2020-05-04 14:07
- It must be Myco ElMaestro 2020-05-04 13:46
- Mea culpa! Helmut 2020-05-04 12:40
- Estimation of CVw and/or CVwR ElMaestro 2020-05-04 12:14
- Sample size calculation (Pilot study result vs literature) Dr_Dan 2020-05-04 08:46