Skip to content

Commit

Permalink
Aligning with CRAN suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzoltak committed Jul 21, 2021
1 parent 5dfb6d4 commit f54660a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 13 deletions.
15 changes: 10 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ Authors@R: c(person("Tomasz", "Zoltak",
Maintainer: Tomasz Zoltak <[email protected]>
Description: Package allows to generate simulated datasets using algorithms
that mimic different response styles to survey questions using: 1) IRTree
approach, 2) (G)PCM (and rating scale version of a partial credit model)
approach, 3) user provided function that (with some probability) chooses
response using information about previous responses. This allows to cover
wide range of potential response styles like: extreme and middle (ERS, MRS),
acquiesce (ARS) and also careless/inattentive responding (CR, IR).
approach (Bockenholt (2012) <doi:10.1037/a0028111>,
(2017) <doi:10.1037/met0000106>), 2) (G)PCM (and rating scale version of
a partial credit model) random-thresholds approach (Falk & Cai (2016)
<doi:10.1037/met0000059>; Henninger & Meiser (2020a)
<doi:10.1037/met0000249>, (2020b) <doi:10.1037/met0000268>; Plieninger
(2017) <doi:10.1177/0013164416636655>), 3) user provided function that (with
some probability) chooses response using information about previous
responses. This allows to cover wide range of potential response styles
like: extreme and middle (ERS, MRS), acquiesce (ARS) and also
careless/inattentive responding (CR, IR).
License: MIT + file LICENSE
Depends: R (>= 4.0.0)
Suggests:
Expand Down
4 changes: 4 additions & 0 deletions R/log_normal_pars.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#' @param sdlog standard deviation of the distribution on the log scale
#' @param m mean (expected value) of the distribution on the exponential scale
#' @param sd standard deviation of the distribution on the exponential scale
#' @return \code{lnorm_mean()} and \code{lnorm_sd()} return numeric vectors;
#' \code{find_pars_lnorm()} returns named numeric vector with elements named
#' \emph{meanlog} describing means and elements named \emph{sdlog} describing
#' standard deviations.
#' @examples
#' # actual expected value of the log-normal distribution with the log scale
#' # parameters of 3 and 1.5 respectively
Expand Down
14 changes: 13 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
There was 1 NOTE:
# Resubmission

This is a resubmission. In this version I have:

- Added references to the documents describing the methods that are used in the package in the DESCRIPTION file.

- Added missing \value to log-normal.Rd.

- Removed `rm(list = ls())` usage from tests.

# NOTES

There is 1 NOTE:

Possibly mis-spelled words in DESCRIPTION:
ARS (25:16)
Expand Down
6 changes: 6 additions & 0 deletions man/log-normal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/testthat/test_expand_responses.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ test_that("", {
paste0("e_", colnames(responses)))))
expect_identical(respExp, pattern)
})
rm(list = ls())
2 changes: 0 additions & 2 deletions tests/testthat/test_sequential_mae5.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ test_that("Item parameters of sequential M, A, E RS (with 5-point scale) recover
# dm = mean((intercepts[, 1] - estItemPars[, 4])^2),
# da = mean((intercepts[, 2] - estItemPars[, 5])^2),
# de = mean((intercepts[, 3] - estItemPars[, 6])^2)), 3)

rm(list = ls())
2 changes: 0 additions & 2 deletions tests/testthat/test_sequential_mae6.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,3 @@ test_that("Item parameters of sequential M, A, E RS (with 6-point scale) recover
# da1 = mean((intercepts[, 2] - estItemPars[, 6])^2),
# da2 = mean((intercepts[, 3] - estItemPars[, 7])^2),
# de = mean((intercepts[, 4] - estItemPars[, 8])^2)), 3)

rm(list = ls())
3 changes: 1 addition & 2 deletions tests/testthat/test_simultaneous_aem.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mSml <- suppressMessages(mirt(resp,
gpcm_mats = lapply(1:ncol(resp), function(x) sM),
method = "EM", TOL = 0.1, verbose = FALSE))
estItemPars <- coef(mSml, simplify = TRUE)$items
intercepts <- intercepts[, -1]
test_that("Item parameters of simultaneous A, E, M RS (with 5-point scale) recovers in estimation with reasonable MSEs.", {
expect_lt(mean((slopes[, 1] - estItemPars[, 1])^2), 0.2)
expect_lt(mean((slopes[, 2] - estItemPars[, 2])^2), 0.02)
Expand Down Expand Up @@ -62,5 +63,3 @@ test_that("Item parameters of simultaneous A, E, M RS (with 5-point scale) recov
# d2 = mean((intercepts[, 2] - estItemPars[, 27])^2),
# d3 = mean((intercepts[, 3] - estItemPars[, 28])^2),
# d4 = mean((intercepts[, 4] - estItemPars[, 29])^2)), 3)

rm(list = ls())

0 comments on commit f54660a

Please sign in to comment.