Skip to content

Commit

Permalink
version 0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
choi-phd authored and cran-robot committed Aug 28, 2019
1 parent ac9a957 commit 8783967
Show file tree
Hide file tree
Showing 12 changed files with 1,807 additions and 462 deletions.
12 changes: 7 additions & 5 deletions DESCRIPTION
Expand Up @@ -2,8 +2,8 @@ Package: TestDesign
Type: Package
Title: Optimal Test Design Approach to Fixed and Adaptive Test
Construction
Version: 0.2.2
Date: 2019-08-10
Version: 0.2.3
Date: 2019-08-28
Authors@R: c(
person("Seung W.", "Choi", email = "schoi@austin.utexas.edu", role = c("aut", "cre")),
person("Sangdon", "Lim", email = "sangdonlim@utexas.edu", role = "aut"))
Expand All @@ -13,12 +13,14 @@ Description: Use the optimal test design approach by Birnbaum (1968, ISBN:978159
mixed-integer programming (MIP) solver packages: 'Rsymphony', 'gurobi', 'lpSolve', and 'Rglpk'. The 'gurobi' package
is not available from CRAN; see <https://www.gurobi.com/downloads>. See vignette for installing 'Rsymphony' package
on Mac systems.
URL: https://github.com/choi-phd/TestDesign
BugReports: https://github.com/choi-phd/TestDesign/issues
License: GPL (>= 2)
Depends: R (>= 2.10)
Imports: Rcpp (>= 1.0.0), methods, Matrix, lpSolve, foreach, logitnorm,
Rdpack, crayon
Suggests: gurobi, Rsymphony, Rglpk, shiny, shinythemes, shinyWidgets,
shinyjs, DT, knitr, rmarkdown, testthat (>= 2.1.0)
shinyjs, DT, knitr, rmarkdown, kableExtra, testthat (>= 2.1.0)
LinkingTo: Rcpp
RoxygenNote: 6.1.1
Encoding: UTF-8
Expand All @@ -30,8 +32,8 @@ Collate: 'import.R' 'RcppExports.R' 'item_class.R' 'item_functions.R'
'solver_functions.R' 'shadow_class.R' 'shadow_functions.R'
'datasets.R' 'runshiny.R'
NeedsCompilation: yes
Packaged: 2019-08-19 00:17:52 UTC; chois1
Packaged: 2019-08-28 20:16:42 UTC; chois1
Author: Seung W. Choi [aut, cre],
Sangdon Lim [aut]
Repository: CRAN
Date/Publication: 2019-08-20 09:10:05 UTC
Date/Publication: 2019-08-28 23:30:08 UTC
21 changes: 11 additions & 10 deletions MD5
@@ -1,18 +1,19 @@
82b3440ccf727fbb18cfe97768bccc53 *DESCRIPTION
1a6e675fb8feaeea5eda954234a481f9 *DESCRIPTION
be4663df1de694744dc1a4a18ae636bc *NAMESPACE
32925863ed6adf305242b2b82df3cfa9 *NEWS.md
b75c62a396a55aea2c94a70036d9891d *R/ATA_class.R
5d8a19aeffa8cd1d7d7790218b24c8bd *R/ATA_functions.R
c1c2130aa7f7d11e55457b8b55c9ced4 *R/ATA_functions.R
d2ed4fb58f2984bd6281030cedcddf4b *R/RcppExports.R
8b6e7c02165d12746cbcf24329e93d9f *R/datasets.R
ca3b965f2ca8af060fab95ac8302b9a6 *R/import.R
32b9dac6b0dacf03bbdfd16b13471261 *R/item_class.R
ff4bceadc15b913382cc4c52e4741ad6 *R/item_functions.R
df3e05395b784e737b4797bf72f3e69f *R/loading_functions.R
3568daf22be3be9780aee7d66fb263ce *R/runshiny.R
7ec4e35e0faa4995e2777532bbf77a05 *R/shadow_class.R
c7434cf5e419d721d805ac4cf671c315 *R/shadow_functions.R
8a23c2cb643365adc0497452845ae232 *R/shadow_class.R
ec2b3ea0b015eac2ac6bd11e179bfaed *R/shadow_functions.R
fdaee39c8b9676cbad54bc75ec530b71 *R/solver_functions.R
250408c942be396216b007cc064cc8c1 *build/partial.rdb
e48f15cde6d4f1c0bc55964d2038521d *build/partial.rdb
adb3499d55858c01047faad971d3ac05 *build/vignette.rds
e341fdc84b17e2c142f5a44ec15e8984 *data/constraints_fatigue.rda
e8d178d7b0580327e95171fa845d7ca4 *data/constraints_fatigue_raw.rda
Expand All @@ -37,11 +38,11 @@ bfb6b5c05ad961d7cd7f57a1b23d5a71 *data/itempool_reading.rda
f61e5e7f6c1349d9992882fc976ca4e0 *data/stimattrib_reading.rda
e4871ef59b03b8ddf1c8c44b525a5cf8 *data/stimattrib_reading_raw.rda
8655d702d29bd5b5d8c34a81d23edadd *inst/REFERENCES.bib
2653ee41b5051ee5061fe4bd8f26a820 *inst/doc/constraints.R
ab8433c92c998e482bf2264f18626501 *inst/doc/constraints.Rmd
5526e873019eb543e0dbdb6ac7704ff9 *inst/doc/constraints.html
113bf24f1039e9d7272ed122233b5477 *inst/doc/constraints.R
03053108e33c42d02870a1c6900ee948 *inst/doc/constraints.Rmd
f2dc710b12db4b338eb7ecbdc43e0d38 *inst/doc/constraints.html
61ab163c34a51ecede5bef2ea30b009b *inst/doc/rsymphony.Rmd
2ed7a3b826a56056ed2481c73834afe3 *inst/doc/rsymphony.html
6f82ace5c138e8eeaea64860d1393675 *inst/doc/rsymphony.html
7f43cab46253080caf1f8d524f2d578f *inst/shiny/app.R
2459a00345514f9cbe8d385f59304583 *man/ATA-methods.Rd
c5e2e941554086bede40e3f219d520b9 *man/OAT.Rd
Expand Down Expand Up @@ -160,5 +161,5 @@ d8e88b8ccadf7d2536947251873acee6 *src/RcppExports.cpp
d8a07d8e807555cbc0b6cfa0bf752147 *tests/testthat/test-examples.R
93466df8817dd4daf4f4500ee0dbb972 *tests/testthat/test-exposure.R
781768831c28a132119244d35224ba94 *tests/testthat/test-items.R
ab8433c92c998e482bf2264f18626501 *vignettes/constraints.Rmd
03053108e33c42d02870a1c6900ee948 *vignettes/constraints.Rmd
61ab163c34a51ecede5bef2ea30b009b *vignettes/rsymphony.Rmd
15 changes: 15 additions & 0 deletions NEWS.md
@@ -0,0 +1,15 @@
# TestDesign 0.2.3

## Bug fixes

* Fix where `ATA()` and `Shadow()` returns incorrect solutions with stimulus-based item pools in some cases.
* Fix where `ATA()` and `Shadow()` returns fewer than specified number of items due to solution vectors being not strictly binary in some cases.
* Update formatting of `vignette('constraints')`.

## Others

* Add `URL` and `BugReports` fields to `DESCRIPTION` file.

# TestDesign 0.2.2

* Initial release.
28 changes: 17 additions & 11 deletions R/ATA_functions.R
Expand Up @@ -23,7 +23,7 @@ NULL
#' \item{\code{obj_value}} Objective value of the solution. Identical to the one above.
#' \item{\code{solve_time}} The elapsed time in running the solver.
#' }
#'
#'
#' @references
#' \insertRef{van_der_linden_linear_2005}{TestDesign}
#'
Expand Down Expand Up @@ -175,31 +175,37 @@ setMethod(

solve_time <- proc.time() - solve_time

if (!is.null(constraints$stimulus_order)) {
if (!is.null(constraints$stim_order)) {
constraints$item_attrib$tmpsort <- 1:constraints$ni
constraints$item_attrib <- merge(constraints$item_attrib,
constraints$st_attrib[c("STINDEX", "STID", constraints$stimulus_order_by)],
by = "STID", all.x = TRUE, sort = FALSE
)
constraints$st_attrib[c("STINDEX", "STID", constraints$stim_order_by)],
by = "STID", all.x = TRUE, sort = FALSE)
constraints$item_attrib <- constraints$item_attrib[order(constraints$item_attrib$tmpsort), ]
constraints$item_attrib <- constraints$item_attrib[, !(colnames(constraints$item_attrib) %in% 'tmpsort')]
} else if (!is.null(constraints$st_attrib)) {
constraints$item_attrib$tmpsort <- 1:constraints$ni
constraints$item_attrib <- merge(constraints$item_attrib,
constraints$st_attrib[c("STINDEX", "STID")],
by = "STID", all.x = TRUE, sort = FALSE
)
by = "STID", all.x = TRUE, sort = FALSE)
constraints$item_attrib <- constraints$item_attrib[order(constraints$item_attrib$tmpsort), ]
constraints$item_attrib <- constraints$item_attrib[, !(colnames(constraints$item_attrib) %in% 'tmpsort')]
}

MIP$solution[types == "B"] <- round(MIP$solution[types == "B"], 0)

selected <- constraints$item_attrib[which(MIP$solution[1:constraints$ni] == 1), ]
obj_value <- sum(obj[which(MIP$solution[1:constraints$ni] == 1)])

if (!is.null(constraints$item_order_by) && !is.null(constraints$stimulus_order_by)) {
selected <- selected[order(selected[[constraints$stimulus_order_by]], selected[["STID"]], selected[[constraints$item_order_by]]), ]
if (!is.null(constraints$item_order_by) && !is.null(constraints$stim_order_by)) {
selected <- selected[order(selected[[constraints$stim_order_by]], selected[["STID"]], selected[[constraints$item_order_by]]), ]
} else if (!is.null(constraints$item_order_by)) {
if (constraints$set_based) {
selected <- selected[order(selected[["STID"]], selected[[constraints$item_order_by]]), ]
} else {
selected <- selected[order(selected[[constraints$item_order_by]]), ]
}
} else if (!is.null(constraints$stimulus_order_by)) {
selected <- selected[order(selected[[constraints$stimulus_order_by]], selected[["STID"]]), ]
} else if (!is.null(constraints$stim_order_by)) {
selected <- selected[order(selected[[constraints$stim_order_by]], selected[["STID"]]), ]
}
row.names(selected) <- 1:nrow(selected)

Expand Down
13 changes: 7 additions & 6 deletions R/shadow_class.R
Expand Up @@ -232,20 +232,21 @@ setClass("config_Shadow",
}
}
if (!object@item_selection$method %in% c("MFI", "MPWI", "EB", "FB")) {
errors <- c(errors, "invalid option for selectionCriterion")
errors <- c(errors, "invalid option for item_selection$method: accepts MFI, MPWI, EB, or FB")
}

if (!object@content_balancing$method %in% c("NONE", "STA")) {
errors <- c(errors, "invalid option for content_balancing")
errors <- c(errors, "invalid option for content_balancing$method: accepts NONE or STA")
}
if (!object@refresh_policy$method %in%
c("ALWAYS", "POSITION", "INTERVAL", "THRESHOLD", "INTERVAL-THRESHOLD", "STIMULUS", "SET", "PASSAGE")) {
errors <- c(errors, "invalid option for refresh_policy.")
errors <- c(errors, "invalid option for refresh_policy$method")
}
if (!object@exposure_control$method %in% c("NONE", "ELIGIBILITY", "BIGM", "BIGM-BAYESIAN")) {
errors <- c(errors, "invalid option for exposure_control.")
errors <- c(errors, "invalid option for exposure_control$method")
}
if (object@exposure_control$n_segment != length(object@exposure_control$segment_cut) - 1) {
errors <- c(errors, "n_segment and segment_cut are incongruent.")
errors <- c(errors, "n_segment and segment_cut are inconsistent")
}
if (!object@stopping_criterion$method %in% c("FIXED")) {
errors <- c(errors, "invalid option for stopping_criterion.")
Expand All @@ -257,7 +258,7 @@ setClass("config_Shadow",
errors <- c(errors, "invalid option for final_theta.")
}
if (object@exposure_control$method %in% c("BIGM-BAYESIAN") && !object@interim_theta$method %in% c("EB", "FB")) {
errors <- c(errors, "for exposure_control BIGM-BAYESIAN you must use interim_theta of EB of FB.")
errors <- c(errors, "BIGM-BAYESIAN exposure control requires interim_theta of EB or FB.")
}
if (length(errors) == 0) {
return(TRUE)
Expand Down

0 comments on commit 8783967

Please sign in to comment.