Tracking down error [Power / Sample Size]
Hi Alyssa,
Let’s try to figure it out. Execute this code:
If it works now, fine. If you get the same error, try:
Expected:
If you get an error (or something else), let’s see what you have installed. Try this:
On my machine:
If you have <4.0.0, I suggest to update. Then copy the entire
Once done, it should look similar to mine. 1.4.9.9999 is the development version of
To get more information about you installation, execute:
On my machine:
Likely your list will be shorter; please post here what you got.
PS: When you post code/output, please embed it within the respective BBCode. With active JavaScript highlight the text in the message-area and click on the Button . THX.
❝ Then i continued with the following command but it appeared error: […]
Let’s try to figure it out. Execute this code:
library(PowerTOST)
CVwR <- 0.426
CV <- rep(CVwR, 2)
designs <- c("2x3x3", "2x2x3", "2x2x4")
target <- c(0.80, 0.85, 0.90)
res <- data.frame(design = rep(designs, each = length(target)),
target = target, n = NA, power = NA)
for (j in 1:nrow(res)) {
res[j, 3:4] <- sampleN.scABEL(CV = CV, design = res$design[j],
targetpower = res$target[j],
print = FALSE, details = FALSE)[8:9]
}
print(res, row.names = FALSE)
If it works now, fine. If you get the same error, try:
res[1, 3:4] <- sampleN.scABEL(CV = CV, design = "2x3x3",
targetpower = 0.8, print = FALSE,
details = FALSE)[8:9]
print(res[1, ], row.names = FALSE)
Expected:
design target n power
2x3x3 0.8 42 0.81976
If you get an error (or something else), let’s see what you have installed. Try this:
p <- c("PowerTOST", "mvtnorm", "stats", "utils",
"graphics", "grDevices", "cubature",
"TeachingDemos", "crossdes", "devtools")
i <- data.frame(name = c("R", p),
version = c(noquote(as.character(getRversion())),
rep(NA, length(p))),
status = c("-", rep("required", 8),
rep("suggested", 2)))
for (j in 2:nrow(i)) {
i[j, 2] <- noquote(as.character(packageVersion(i[j, 1])))
}
print(i, row.names = FALSE)
On my machine:
name version status
R 4.0.0 -
PowerTOST 1.4.9.9999 required
mvtnorm 1.1.0 required
stats 4.0.0 required
utils 4.0.0 required
graphics 4.0.0 required
grDevices 4.0.0 required
cubature 2.0.4 required
TeachingDemos 2.12 required
crossdes 1.1.1 suggested
devtools 2.3.0 suggested
If you have <4.0.0, I suggest to update. Then copy the entire
library
-folder of the old installation over the new installation. When asked whether newer files should be overwritten, answer . Open the console of the new and execute: update.packages(checkBuilt = TRUE, ask = FALSE)
Once done, it should look similar to mine. 1.4.9.9999 is the development version of
PowerTOST
; on your machine it should be 1.4.9. If one is missing (<NA>
in the column version
), download/install it.To get more information about you installation, execute:
devtools::session_info()
On my machine:
- Session info ---------------------------------------------------------------
setting value
version R version 4.0.0 (2020-04-24)
os Windows 7 x64 SP 1
system x86_64, mingw32
ui Rgui
language EN
collate German_Germany.1252
ctype German_Germany.1252
tz Europe/Vienna
date 2020-05-12
- Packages -------------------------------------------------------------------
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
backports 1.1.6 2020-04-05 [1] CRAN (R 4.0.0)
callr 3.4.3 2020-03-28 [1] CRAN (R 4.0.0)
cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0)
crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0)
cubature 2.0.4 2019-12-04 [1] CRAN (R 4.0.0)
desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.0)
devtools 2.3.0 2020-04-10 [1] CRAN (R 4.0.0)
digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.0)
ellipsis 0.3.0 2019-09-20 [1] CRAN (R 4.0.0)
fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
fs 1.4.1 2020-04-04 [1] CRAN (R 4.0.0)
glue 1.4.0 2020-04-03 [1] CRAN (R 4.0.0)
magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.0)
memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.0)
mvtnorm 1.1-0 2020-02-24 [1] CRAN (R 4.0.0)
pkgbuild 1.0.8 2020-05-07 [1] CRAN (R 4.0.0)
pkgload 1.0.2 2018-10-29 [1] CRAN (R 4.0.0)
PowerTOST * 1.4.9.9999 2020-05-11 [1] local
prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.0)
processx 3.4.2 2020-02-09 [1] CRAN (R 4.0.0)
ps 1.3.3 2020-05-08 [1] CRAN (R 4.0.0)
R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0)
Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0)
remotes 2.1.1 2020-02-15 [1] CRAN (R 4.0.0)
rlang 0.4.6 2020-05-02 [1] CRAN (R 4.0.0)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
TeachingDemos 2.12 2020-04-07 [1] CRAN (R 4.0.0)
testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.0)
usethis 1.6.1 2020-04-29 [1] CRAN (R 4.0.0)
withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.0)
[1] D:/Program Files/R/R-4.0.0/library
Likely your list will be shorter; please post here what you got.
PS: When you post code/output, please embed it within the respective BBCode. With active JavaScript highlight the text in the message-area and click on the Button . THX.
—
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 errorHelmut 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 errorHelmut 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