diff --git a/DESCRIPTION b/DESCRIPTION index d99a81c..ad71d9c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,11 @@ Package: lsasim -Title: Simulate Large Scale Assessment Data -Version: 1.0.1.9000 +Title: Functions to Facilitate the Simulation of Large Scale Assessment Data +Version: 1.0.1 Authors@R: c( person("Tyler", "Matta", email = "tyler.matta@gmail.com", role = c("aut", "cre")), - person("Yuan-Ling Linda", "Liaw", email = "linda08@uw.edu", role = "ctb"), - person("Leslie", "Rutkowski", email = "leslie.rutkowski@cemo.uio.no", role = "ctb"), - person("David", "Rutkowski", email = "david.rutkowski@cemo.uio.no", role = "ctb"), + person("Leslie", "Rutkowski", email = "leslie.rutkowski@cemo.uio.no", role = "aut"), + person("David", "Rutkowski", email = "david.rutkowski@cemo.uio.no", role = "aut"), + person("Yuan-Ling Linda", "Liaw", email = "linda08@uw.edu", role = "aut"), person("Kondwani Kajera", "Mughogho", email = "k.k.mughogho@cemo.uio.no", role = "ctb") ) BugReports: https://github.com/tmatta/lsasim/issues @@ -17,4 +17,4 @@ Depends: License: GPL-3 Encoding: UTF-8 LazyData: true -RoxygenNote: 5.0.1 +RoxygenNote: 6.0.1 diff --git a/NEWS.md b/NEWS.md index ec0ac88..0a16835 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -lsasim 1.0.2.9000 +lsasim 1.0.1 ------------- ### API changes diff --git a/R/cor_gen.R b/R/cor_gen.R index 48521b1..4b8877b 100644 --- a/R/cor_gen.R +++ b/R/cor_gen.R @@ -3,6 +3,7 @@ #' Creates a random correlation matrix. #' #' @param n_var integer number of variables. +#' @param cov_bounds a vector containing the bounds of the covariance matrix. #' #' @section Details: #' The result from \code{cor_gen} can be used directly with the \code{cor_matrix} diff --git a/man/block_design.Rd b/man/block_design.Rd index 98ed857..55223a8 100644 --- a/man/block_design.Rd +++ b/man/block_design.Rd @@ -30,6 +30,7 @@ represent the total number of items. \code{item_block_matrix[1, 1] = 1} indicate that block 1 contains item 1 while \code{item_block_matrix[1, 2] = 0} indicates that block 2 does not contain item 1. } + \examples{ item_param <- data.frame(item = seq(1:25), b = runif(25, -2, 2)) ib_matrix <- matrix(nrow = 25, ncol = 5, byrow = FALSE, @@ -42,4 +43,3 @@ block_design(n_blocks = 5, item_parameters = item_param, item_block_matrix = ib_ block_design(n_blocks = 5, item_parameters = item_param) } - diff --git a/man/booklet_design.Rd b/man/booklet_design.Rd index dabc605..19716bf 100644 --- a/man/booklet_design.Rd +++ b/man/booklet_design.Rd @@ -32,6 +32,7 @@ The default \code{book_design} assigns two blocks to every booklet in a spiral d The number of default booklets is equal to the number of blocks and must be >= 3. If \code{ncol(item_block_assignment)} < 3, \code{book_design} must be specified. } + \examples{ i_blk_mat <- matrix(seq(1:40), ncol = 5) blk_book <- matrix(c(1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, @@ -41,4 +42,3 @@ booklet_design(item_block_assignment = i_blk_mat, book_design = blk_book) booklet_design(item_block_assignment = i_blk_mat) } - diff --git a/man/booklet_sample.Rd b/man/booklet_sample.Rd index 0ef7137..2e5ec37 100644 --- a/man/booklet_sample.Rd +++ b/man/booklet_sample.Rd @@ -32,10 +32,10 @@ the difference between the most sampled and least sampled booklets.} If using \code{booklet_sample} in tandem with \code{booklet_design}, \code{book_item_design} is the the first element of the returned list of \code{block_design}. } + \examples{ it_bk <- matrix(c(1, 2, 1, 4, 5, 4, 7, 8, 7, 10, 3, 10, 2, 6, 3, 5, 9, 6, 8, 0, 9), ncol = 3, byrow = TRUE) booklet_sample(n_subj = 10, book_item_design = it_bk, book_prob = c(.2, .5, .3)) } - diff --git a/man/cor_gen.Rd b/man/cor_gen.Rd index 47835aa..03d0127 100644 --- a/man/cor_gen.Rd +++ b/man/cor_gen.Rd @@ -4,10 +4,12 @@ \alias{cor_gen} \title{Generation of random correlation matrix} \usage{ -cor_gen(n_var) +cor_gen(n_var, cov_bounds = c(-1, 1)) } \arguments{ \item{n_var}{integer number of variables.} + +\item{cov_bounds}{a vector containing the bounds of the covariance matrix.} } \description{ Creates a random correlation matrix. @@ -17,8 +19,8 @@ Creates a random correlation matrix. The result from \code{cor_gen} can be used directly with the \code{cor_matrix} argument of \code{questionnaire_gen}. } + \examples{ cor_gen(n_var = 10) } - diff --git a/man/irt_gen.Rd b/man/irt_gen.Rd index 7e540a1..8fc5b35 100644 --- a/man/irt_gen.Rd +++ b/man/irt_gen.Rd @@ -26,4 +26,3 @@ irt_gen(theta = 0.2, a_par = 1.15, b_par = 0.6) irt_gen(theta = 0.2, a_par = 1.15, b_par = 0.6, c_par = 0.2) } - diff --git a/man/item_gen.Rd b/man/item_gen.Rd index 1b4e865..cc82a37 100644 --- a/man/item_gen.Rd +++ b/man/item_gen.Rd @@ -33,6 +33,7 @@ Creates a data frame of item parameters. The data frame includes two variables \code{p} and \code{k} which indicate the number of parameters and the number of thresholds, respectively } + \examples{ item_gen(b_bounds = c(-2, 2), a_bounds = c(.75, 1.25), thresholds = c(1, 2, 3), n_1pl = c(5, 5, 5), n_2pl = c(0, 0, 5)) @@ -40,4 +41,3 @@ item_gen(b_bounds = c(-2, 2), a_bounds = c(.75, 1.25), c_bounds = c(0, .25), n_2pl = 5, n_3pl = 5) } - diff --git a/man/pisa2012_math_block.Rd b/man/pisa2012_math_block.Rd index bcc1042..836c56f 100644 --- a/man/pisa2012_math_block.Rd +++ b/man/pisa2012_math_block.Rd @@ -33,4 +33,3 @@ A dataset containing indicators associating those PISA 2012 mathematics items to the PISA 2012 mathematics item blocks. } \keyword{datasets} - diff --git a/man/pisa2012_math_booklet.Rd b/man/pisa2012_math_booklet.Rd index 75b08d2..0a86988 100644 --- a/man/pisa2012_math_booklet.Rd +++ b/man/pisa2012_math_booklet.Rd @@ -31,4 +31,3 @@ A dataset containing indicators associating those PISA 2012 mathematics item blocks to the PISA 2012 mathematics standard test booklet set. } \keyword{datasets} - diff --git a/man/pisa2012_math_item.Rd b/man/pisa2012_math_item.Rd index 1508c7c..00e99af 100644 --- a/man/pisa2012_math_item.Rd +++ b/man/pisa2012_math_item.Rd @@ -26,4 +26,3 @@ A dataset containing the estimated item parameters for the PISA 2012 mathematics assessment. } \keyword{datasets} - diff --git a/man/pisa2012_q_cormat.Rd b/man/pisa2012_q_cormat.Rd index a01f57f..30e2a7e 100644 --- a/man/pisa2012_q_cormat.Rd +++ b/man/pisa2012_q_cormat.Rd @@ -52,5 +52,5 @@ ordinal variables. These data are for illustration purposes only. Handling of missing data may not be suitable for valid inferences. } -\keyword{datasets} +\keyword{datasets} diff --git a/man/pisa2012_q_marginal.Rd b/man/pisa2012_q_marginal.Rd index fe1a096..f9b0294 100644 --- a/man/pisa2012_q_marginal.Rd +++ b/man/pisa2012_q_marginal.Rd @@ -51,5 +51,5 @@ Element 19 is the marginal proportion for the selected mathematics plausible val These data are for illustration purposes only. Handling of missing data may not be suitable for valid inferences. } -\keyword{datasets} +\keyword{datasets} diff --git a/man/proportion_gen.Rd b/man/proportion_gen.Rd index 728e82f..2a405d1 100644 --- a/man/proportion_gen.Rd +++ b/man/proportion_gen.Rd @@ -24,9 +24,9 @@ proportions of a discrete variable. The result from \code{proportion_gen} can be used directly with the \code{cat_prop} argument of \code{questionnaire_gen}. } + \examples{ proportion_gen(cat_options = c(1, 2, 3), n_cat_options = c(2, 2, 2)) proportion_gen(cat_options = c(1, 3), n_cat_options = c(4, 5)) } - diff --git a/man/questionnaire_gen.Rd b/man/questionnaire_gen.Rd index efcab55..629d975 100644 --- a/man/questionnaire_gen.Rd +++ b/man/questionnaire_gen.Rd @@ -47,10 +47,10 @@ If \code{cat_prop} is a named list, those names will be used as variable names for the returned \code{data.frame}. Generic names will be provided to the variables if \code{cat_prop} is not named. } + \examples{ questionnaire_gen(n = 10, cat_prop = list(c(1), c(.25, .6, 1)), cor_matrix = matrix(c(1, .6, .6, 1), nrow = 2), c_mean = 2, c_sd = 1.5, theta = TRUE) } - diff --git a/man/response_gen.Rd b/man/response_gen.Rd index f5178d1..519b331 100644 --- a/man/response_gen.Rd +++ b/man/response_gen.Rd @@ -35,6 +35,7 @@ Creates a data frame of discrete item responses based on. Generalized partial credit models (\code{!is.null(d_par)}) uses threshold parameterization. } + \examples{ set.seed(1234) s_id <- c(1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, @@ -59,4 +60,3 @@ response_gen(subject = s_id, item = i_id, theta = rnorm(20, 0, 1), b_par = bb, a_par = aa, c_par = cc, d_par = dd) } -