diff --git a/DESCRIPTION b/DESCRIPTION index f2f5ac7..af56299 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,7 +24,7 @@ Authors@R: c( ) Author: Cesar Merino-Soto [aut, ctb, rev] (ORCID: ), Jose Livia Segovia [aut, ctb] (ORCID: ), Diego Livia Ortiz [aut, cre, ctb, rev] (ORCID: ) Maintainer: Diego Livia Ortiz -Description: Provides tools for content validity studies, including functions to calculate content validity coefficients from ratings by expert or experiential judges. It implements CVC(), CVI(), CVIR(), CVR(), and Vaiken() together with asymmetric confidence intervals for bounded coefficients and methods for comparing independent coefficients. The methods are based on Aiken (1980, 1985) , Wilson (1927) , and Merino-Soto (2018) . +Description: Content validity studies, including functions to calculate content validity coefficients from ratings by expert or experiential judges. It implements CVC(), CVI(), CVIR(), CVR(), and Vaiken() together with asymmetric confidence intervals for bounded coefficients and methods for comparing independent coefficients. The methods are based on Aiken (1980, 1985) , Wilson (1927) , and Merino-Soto (2018) . License: GPL (>= 3) URL: https://github.com/Diegolivia/ValCont BugReports: https://github.com/Diegolivia/ValCont/issues diff --git a/R/CIR.R b/R/CIR.R index a4f64b7..ea4d732 100644 --- a/R/CIR.R +++ b/R/CIR.R @@ -65,7 +65,7 @@ #' Reference Online}. doi:10.1002/9781118445112.stat08085 #' #' @examples -#' \dontrun{ +#' \donttest{ #' # Suppose 'group1' and 'group2' contain columns 'est', 'low', and 'high' #' res <- CIR(group1, group2, coef.col = "est", lwr.col = "low", upr.col = "high") #' print(res) diff --git a/R/HAiken.R b/R/HAiken.R index de76cd4..dcb9474 100644 --- a/R/HAiken.R +++ b/R/HAiken.R @@ -51,11 +51,19 @@ #' \emph{Educational and Psychological Measurement, 45}, 131-142. #' #' @examples -#' \dontrun{ -#' # Sample data: 8 items, 18 judges, ratings 1-4 -#' datos <- data.frame(t(file1[, c("claA6", "claA18", "claA2", "claA16", -#' "claA4", "claA12", "claA9", "claA21")])) -#' Haiken(datos, ncat = 4, conf.level = .90, overall = TRUE, B = 1000, ci.type = "logit") +#' \donttest{ +#' set.seed(123) +#' datos <- data.frame( +#' item1 = sample(1:4, 8, replace = TRUE), +#' item2 = sample(1:4, 8, replace = TRUE), +#' item3 = sample(1:4, 8, replace = TRUE), +#' item4 = sample(1:4, 8, replace = TRUE), +#' item5 = sample(1:4, 8, replace = TRUE), +#' item6 = sample(1:4, 8, replace = TRUE), +#' item7 = sample(1:4, 8, replace = TRUE), +#' item8 = sample(1:4, 8, replace = TRUE) +#' ) +#' Haiken(datos, ncat = 4, conf.level = .90, overall = TRUE, B = 200, ci.type = "logit") #' } #' #' @export diff --git a/R/HT.R b/R/HT.R index 177a5db..f9a61b5 100644 --- a/R/HT.R +++ b/R/HT.R @@ -141,10 +141,10 @@ #' ratings. \emph{Applied Measurement in Education, 17}(4), 359-370. #' #' @examples -#' \dontrun{ +#' \donttest{ #' ## Example structure (toy data) #' set.seed(123) -#' HTmult.data <- data.frame( +#' dat <- data.frame( #' item1.c1 = sample(1:5, 50, replace = TRUE), #' item1.c2 = sample(1:5, 50, replace = TRUE), #' item1.c3 = sample(1:5, 50, replace = TRUE), @@ -153,14 +153,15 @@ #' item2.c3 = sample(1:5, 50, replace = TRUE) #' ) #' -#'HTmult( +#' HTmult( #' data = dat, #' items = c("item1", "item2"), #' constructs = c("c1", "c2", "c3"), #' key = c(item1 = "c2", item2 = "c3"), #' anchors = 5, #' ci = TRUE, -#' conf.level = 0.95) +#' conf.level = 0.95 +#' ) #' } #' #' @export diff --git a/R/MDScontent.R b/R/MDScontent.R index 1dd560f..e2f88bf 100644 --- a/R/MDScontent.R +++ b/R/MDScontent.R @@ -95,39 +95,19 @@ #' #' @importFrom rlang .data #' @examples -#' # This simulated data has the following structure: 12 judges evaluated the fit -#' # of 6 items on 4 traits. The data therefore contain 12 rows and 24 columns, -#' # with four columns for each item, one column per trait. -#' -#' # In the validity survey, the items were presented in 12 rows, and each item -#' # was evaluated for its correspondence to the four traits. The columns follow -#' # this pattern: -#' -#' # item item1.trait1 item1.trait2 item1.trait3 item1.trait4 item2.trait1 ... -#' -#' # The theoretical correspondence used below is: -#' -#' # Item 1 -> Trait 1 -#' # Item 2 -> Trait 1 -#' # Item 3 -> Trait 2 -#' # Item 4 -> Trait 2 -#' # Item 5 -> Trait 3 -#' # Item 6 -> Trait 4 -#' -#' dat2 <- matrix(c( -#' 5,2,2,1, 5,1,2,1, 2,5,1,2, 1,5,2,1, 2,1,5,2, 1,2,2,5, -#' 5,1,2,2, 4,2,1,1, 1,5,2,1, 2,5,1,1, 1,2,5,2, 2,1,1,5, -#' 4,2,1,1, 5,1,2,1, 2,4,1,2, 1,5,2,2, 2,1,5,1, 1,2,2,5, -#' 5,1,2,1, 5,2,1,1, 1,5,2,1, 2,4,1,2, 1,2,5,2, 2,1,1,5, -#' 4,2,1,2, 5,1,2,1, 2,5,1,1, 1,5,2,1, 2,1,4,2, 1,2,2,4, -#' 5,1,2,1, 4,2,1,2, 1,5,2,1, 2,5,1,1, 1,2,5,1, 2,1,2,5, -#' 5,2,1,1, 5,1,2,1, 2,4,1,2, 1,5,2,1, 2,1,5,2, 1,2,1,5, -#' 4,1,2,1, 5,2,1,1, 1,5,2,2, 2,4,1,1, 1,2,5,1, 2,1,2,5, -#' 5,2,1,1, 4,1,2,2, 2,5,1,1, 1,5,2,1, 2,1,5,2, 1,2,1,5, -#' 5,1,2,2, 5,2,1,1, 1,5,2,1, 2,5,1,2, 1,2,5,1, 2,1,2,5, -#' 4,2,1,1, 5,1,2,1, 2,4,1,2, 1,5,2,1, 2,1,4,2, 1,2,1,5, -#' 5,1,2,1, 4,2,1,1, 1,5,2,1, 2,4,1,2, 1,2,5,1, 2,1,2,5), -#' nrow = 12, +#' \donttest{ +#' # A small toy example with 6 items judged on 4 traits. +#' set.seed(123) +#' dat2 <- matrix( +#' c( +#' 5, 2, 2, 1, 5, 1, 2, 1, 2, 5, 1, 2, 1, 5, 2, 1, +#' 2, 1, 5, 2, 1, 2, 2, 5, 5, 1, 2, 2, 4, 2, 1, 1, +#' 1, 5, 2, 1, 2, 5, 1, 1, 1, 2, 5, 2, 2, 1, 1, 5, +#' 5, 1, 2, 1, 5, 2, 1, 1, 1, 5, 2, 1, 2, 4, 1, 2, +#' 1, 2, 5, 2, 2, 1, 1, 5, 4, 2, 1, 2, 5, 1, 2, 1, +#' 2, 5, 1, 1, 1, 5, 2, 1, 2, 1, 4, 2, 1, 2, 2, 4 +#' ), +#' nrow = 6, #' byrow = TRUE #' ) #' key <- c(1, 1, 2, 2, 3, 4) @@ -141,6 +121,7 @@ #' mds = "nonmetric", #' display = "items" #' ) +#' } #' #' @export MDScontent <- function( @@ -413,6 +394,12 @@ MDScontent <- function( ifelse(mds == "nonmetric", paste0(" | STRESS: ", signif(stress, 3)), "")) ) + if ((display == "items" || display == "both") && isTRUE(label.items)) { + if (!requireNamespace("ggrepel", quietly = TRUE)) { + stop("Package 'ggrepel' is required for label.items = TRUE. Install it with install.packages('ggrepel').") + } + } + if (display == "items" || display == "both") { if (!is.null(hull_data)) { p <- p + ggplot2::geom_polygon(data = hull_data, diff --git a/R/SVALplot.R b/R/SVALplot.R index b70dcec..fa071dc 100644 --- a/R/SVALplot.R +++ b/R/SVALplot.R @@ -23,7 +23,7 @@ #'\code{\link[ValCont:SVALsingle]{ValCont::SVALsingle}} for single-item analysis. #' #' @examples -#' \dontrun{ +#' \donttest{ #' results <- SVALmult(data = data.gais, columns = c("gais2", "gais3")) #' SVALplot(results, item = "gais3", type = "svc", target = 4) #' SVALplot(results, item = "gais3", type = "psa", labels = c("Anger", "Fear", "Joy", "Sadness"))} diff --git a/man/CIR.Rd b/man/CIR.Rd index 7b54ecc..7184a52 100644 --- a/man/CIR.Rd +++ b/man/CIR.Rd @@ -69,7 +69,7 @@ adjustment carefully and, if necessary, resort to alternative methods (e.g., bootstrap) for items with boundary confidence limits. } \examples{ -\dontrun{ +\donttest{ # Suppose 'group1' and 'group2' contain columns 'est', 'low', and 'high' res <- CIR(group1, group2, coef.col = "est", lwr.col = "low", upr.col = "high") print(res) diff --git a/man/HTmult.Rd b/man/HTmult.Rd index 955703e..afa8363 100644 --- a/man/HTmult.Rd +++ b/man/HTmult.Rd @@ -153,10 +153,10 @@ coding scheme is used, users should recode the ratings before calling the function. } \examples{ -\dontrun{ +\donttest{ ## Example structure (toy data) set.seed(123) -HTmult.data <- data.frame( +dat <- data.frame( item1.c1 = sample(1:5, 50, replace = TRUE), item1.c2 = sample(1:5, 50, replace = TRUE), item1.c3 = sample(1:5, 50, replace = TRUE), @@ -172,7 +172,8 @@ HTmult( key = c(item1 = "c2", item2 = "c3"), anchors = 5, ci = TRUE, - conf.level = 0.95) + conf.level = 0.95 +) } } diff --git a/man/Haiken.Rd b/man/Haiken.Rd index 93428a5..e97d1df 100644 --- a/man/Haiken.Rd +++ b/man/Haiken.Rd @@ -66,11 +66,19 @@ The methods "perc" and "norm" use the bootstrap percentiles or normal approximat which may produce limits outside [0,1] in extreme cases; they are provided for comparison but are not recommended. } \examples{ -\dontrun{ -# Sample data: 8 items, 18 judges, ratings 1-4 -datos <- data.frame(t(file1[, c("claA6", "claA18", "claA2", "claA16", - "claA4", "claA12", "claA9", "claA21")])) -Haiken(datos, ncat = 4, conf.level = .90, overall = TRUE, B = 1000, ci.type = "logit") +\donttest{ +set.seed(123) +datos <- data.frame( + item1 = sample(1:4, 8, replace = TRUE), + item2 = sample(1:4, 8, replace = TRUE), + item3 = sample(1:4, 8, replace = TRUE), + item4 = sample(1:4, 8, replace = TRUE), + item5 = sample(1:4, 8, replace = TRUE), + item6 = sample(1:4, 8, replace = TRUE), + item7 = sample(1:4, 8, replace = TRUE), + item8 = sample(1:4, 8, replace = TRUE) +) +Haiken(datos, ncat = 4, conf.level = .90, overall = TRUE, B = 200, ci.type = "logit") } } diff --git a/man/MDScontent.Rd b/man/MDScontent.Rd index 01cbe22..ac42d0d 100644 --- a/man/MDScontent.Rd +++ b/man/MDScontent.Rd @@ -132,39 +132,19 @@ Therefore, `MDScontent()` should be interpreted as a structural visualization to that complements coefficient-based evidence. } \examples{ -# This simulated data has the following structure: 12 judges evaluated the fit -# of 6 items on 4 traits. The data therefore contain 12 rows and 24 columns, -# with four columns for each item, one column per trait. - -# In the validity survey, the items were presented in 12 rows, and each item -# was evaluated for its correspondence to the four traits. The columns follow -# this pattern: - -# item item1.trait1 item1.trait2 item1.trait3 item1.trait4 item2.trait1 ... - -# The theoretical correspondence used below is: - -# Item 1 -> Trait 1 -# Item 2 -> Trait 1 -# Item 3 -> Trait 2 -# Item 4 -> Trait 2 -# Item 5 -> Trait 3 -# Item 6 -> Trait 4 - -dat2 <- matrix(c( - 5,2,2,1, 5,1,2,1, 2,5,1,2, 1,5,2,1, 2,1,5,2, 1,2,2,5, - 5,1,2,2, 4,2,1,1, 1,5,2,1, 2,5,1,1, 1,2,5,2, 2,1,1,5, - 4,2,1,1, 5,1,2,1, 2,4,1,2, 1,5,2,2, 2,1,5,1, 1,2,2,5, - 5,1,2,1, 5,2,1,1, 1,5,2,1, 2,4,1,2, 1,2,5,2, 2,1,1,5, - 4,2,1,2, 5,1,2,1, 2,5,1,1, 1,5,2,1, 2,1,4,2, 1,2,2,4, - 5,1,2,1, 4,2,1,2, 1,5,2,1, 2,5,1,1, 1,2,5,1, 2,1,2,5, - 5,2,1,1, 5,1,2,1, 2,4,1,2, 1,5,2,1, 2,1,5,2, 1,2,1,5, - 4,1,2,1, 5,2,1,1, 1,5,2,2, 2,4,1,1, 1,2,5,1, 2,1,2,5, - 5,2,1,1, 4,1,2,2, 2,5,1,1, 1,5,2,1, 2,1,5,2, 1,2,1,5, - 5,1,2,2, 5,2,1,1, 1,5,2,1, 2,5,1,2, 1,2,5,1, 2,1,2,5, - 4,2,1,1, 5,1,2,1, 2,4,1,2, 1,5,2,1, 2,1,4,2, 1,2,1,5, - 5,1,2,1, 4,2,1,1, 1,5,2,1, 2,4,1,2, 1,2,5,1, 2,1,2,5), - nrow = 12, +\donttest{ +# A small toy example with 6 items judged on 4 traits. +set.seed(123) +dat2 <- matrix( + c( + 5, 2, 2, 1, 5, 1, 2, 1, 2, 5, 1, 2, 1, 5, 2, 1, + 2, 1, 5, 2, 1, 2, 2, 5, 5, 1, 2, 2, 4, 2, 1, 1, + 1, 5, 2, 1, 2, 5, 1, 1, 1, 2, 5, 2, 2, 1, 1, 5, + 5, 1, 2, 1, 5, 2, 1, 1, 1, 5, 2, 1, 2, 4, 1, 2, + 1, 2, 5, 2, 2, 1, 1, 5, 4, 2, 1, 2, 5, 1, 2, 1, + 2, 5, 1, 1, 1, 5, 2, 1, 2, 1, 4, 2, 1, 2, 2, 4 + ), + nrow = 6, byrow = TRUE ) key <- c(1, 1, 2, 2, 3, 4) @@ -178,5 +158,6 @@ MDScontent( mds = "nonmetric", display = "items" ) +} } diff --git a/man/SVALplot.Rd b/man/SVALplot.Rd index d25e71c..d79d86f 100644 --- a/man/SVALplot.Rd +++ b/man/SVALplot.Rd @@ -31,7 +31,7 @@ This function allows plotting substantive validity coefficients obtained from \c it will be highlighted. You can also provide a vector of labels to improve interpretability of the category axis. } \examples{ -\dontrun{ +\donttest{ results <- SVALmult(data = data.gais, columns = c("gais2", "gais3")) SVALplot(results, item = "gais3", type = "svc", target = 4) SVALplot(results, item = "gais3", type = "psa", labels = c("Anger", "Fear", "Joy", "Sadness"))} diff --git a/man/ValCont-package.Rd b/man/ValCont-package.Rd index 194ea50..d89d682 100644 --- a/man/ValCont-package.Rd +++ b/man/ValCont-package.Rd @@ -6,7 +6,7 @@ \alias{ValCont-package} \title{ValCont: Content Validation Using Vaiken and Other Functions} \description{ -Provides tools for content validity studies, including functions to calculate content validity coefficients from ratings by expert or experiential judges. It implements CVC(), CVI(), CVIR(), CVR(), and Vaiken() together with asymmetric confidence intervals for bounded coefficients and methods for comparing independent coefficients. The methods are based on Aiken (1980, 1985) \doi{10.1177/001316448004000419}, Wilson (1927) \doi{10.2307/2276774}, and Merino-Soto (2018) \doi{10.6018/analesps.34.3.283481}. +Content validity studies, including functions to calculate content validity coefficients from ratings by expert or experiential judges. It implements CVC(), CVI(), CVIR(), CVR(), and Vaiken() together with asymmetric confidence intervals for bounded coefficients and methods for comparing independent coefficients. The methods are based on Aiken (1980, 1985) \doi{10.1177/001316448004000419}, Wilson (1927) \doi{10.2307/2276774}, and Merino-Soto (2018) \doi{10.6018/analesps.34.3.283481}. } \seealso{ Useful links: