diff --git a/DESCRIPTION b/DESCRIPTION index 4c30fd8..dfb2a46 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: TAM Type: Package Title: Test Analysis Modules -Version: 3.6-28 -Date: 2021-01-19 15:04:01 +Version: 3.6-29 +Date: 2021-01-24 15:14:26 Author: Alexander Robitzsch [aut,cre] (), Thomas Kiefer [aut], diff --git a/R/RcppExports.R b/R/RcppExports.R index b1d59f4..b4c09af 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -1,5 +1,5 @@ ## File Name: RcppExports.R -## File Version: 3.006028 +## File Version: 3.006029 # Generated by using Rcpp::compileAttributes() -> do not edit by hand # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 diff --git a/R/designMatrices.R b/R/designMatrices.R index 3bd83d0..c7708a9 100644 --- a/R/designMatrices.R +++ b/R/designMatrices.R @@ -1,5 +1,5 @@ ## File Name: designMatrices.R -## File Version: 9.194 +## File Version: 9.195 designMatrices <- function( modeltype=c( "PCM", "RSM" ), maxKi=NULL, resp=resp, ndim=1, A=NULL, B=NULL, Q=NULL, R=NULL, @@ -122,8 +122,8 @@ designMatrices <- function( modeltype=c( "PCM", "RSM" ), #***************************** # constraint="items" unidim <- is.null(Q) - - if ( constraint=="items"){ + + if ( constraint=="items"){ if ( ! is.null(Q) ){ unidim <- ncol(Q)==1 } @@ -174,13 +174,13 @@ designMatrices <- function( modeltype=c( "PCM", "RSM" ), vars <- colnames(resp) vars <- c(vars, paste0( "Cat", 1:(maxK-1) ) ) dimnames(A)[[3]] <- vars - + if ( (constraint=="items") & unidim ){ v1 <- A[I,,I] A[I,,1:(I-1)] <- -v1 A <- A[,,-c(I)] } - + A.draft <- A } if ( ! is.null(A0)){ diff --git a/R/tam.jml.R b/R/tam.jml.R index 70d41e7..7756c81 100644 --- a/R/tam.jml.R +++ b/R/tam.jml.R @@ -1,5 +1,5 @@ ## File Name: tam.jml.R -## File Version: 9.361 +## File Version: 9.363 tam.jml <- function( resp, group=NULL, adj=.3, disattenuate=FALSE, @@ -42,7 +42,8 @@ tam.jml <- function( resp, group=NULL, adj=.3, disattenuate=FALSE, #- process item parameters res$AXsi <- tam_jml_compute_Axsi(A=res$A, xsi=res$xsi, resp=resp) #- item parameter table - res$item1 <- tam_jml_itempartable( resp=resp, maxK=res$maxK, AXsi=res$AXsi, + res$item1 <- res$item + res$item <- tam_jml_itempartable( resp=resp, maxK=res$maxK, AXsi=res$AXsi, B=res$B, resp.ind=res$resp.ind) #- theta summary res$theta_summary <- tam_jml_proc_abilities(theta=res$theta, diff --git a/R/tam.jml.fit.R b/R/tam.jml.fit.R index 704f4a0..4fce930 100644 --- a/R/tam.jml.fit.R +++ b/R/tam.jml.fit.R @@ -1,8 +1,8 @@ ## File Name: tam.jml.fit.R -## File Version: 9.201 +## File Version: 9.204 -tam.jml.fit <- function( tamobj ) +tam.jml.fit <- function( tamobj, trim_val=10 ) { s1 <- Sys.time() resp <- tamobj$resp @@ -28,7 +28,7 @@ tam.jml.fit <- function( tamobj ) B.0[ is.na(B.0) ] <- 0 B1 <- B.0[,,1] BB <- B1^2 - theta.unique <- unique( theta ) + theta.unique <- unique(theta) NU <- length(theta.unique) B_bari <- array(0,dim=c(NU, nitems)) BB_bari <- array(0, dim=c(NU, nitems)) @@ -43,15 +43,15 @@ tam.jml.fit <- function( tamobj ) BB_bari <- BB_bari + t( BB[,kk] * rprobs[, kk, ] ) } ind.theta <- match( theta, theta.unique) - rprobs <- rprobs[,, ind.theta ] + rprobs <- rprobs[,, ind.theta ] B_bari <- B_bari[ ind.theta, ] BB_bari <- BB_bari[ ind.theta, ] B_bari <- B_bari * resp.ind BB_bari <- BB_bari * resp.ind B_var <- BB_bari - (B_bari^2) z_sq <- (resp - B_bari)^2/B_var - zsd <- sd(as.matrix(z_sq),na.rm=TRUE) - z_sq[z_sq > 10*zsd] <- 10*zsd #Trim extreme values + zsd <- stats::sd(as.matrix(z_sq),na.rm=TRUE) + z_sq[z_sq > trim_val*zsd] <- trim_val*zsd #Trim extreme values B_bariM <- aperm(outer(B_bari,rep(1,maxK)),c(2,3,1)) B1M <- outer(B1,rep(1,nstud)) for (kk in 1:maxK){ @@ -82,11 +82,11 @@ tam.jml.fit <- function( tamobj ) fit.item <- data.frame(item=colnames(tamobj$resp), outfitItem=outfitItem, outfitItem_t=outfitItem_t, infitItem=infitItem, infitItem_t=infitItem_t) - fit.person <- data.frame(outfitPerson=outfitPerson, outfitPerson_t=outfitPerson_t, infitPerson=infitPerson, infitPerson_t=infitPerson_t) + #-- output s2 <- Sys.time() v1 <- c(s1, s2) res <- list(fit.item=fit.item, fit.person=fit.person, time=v1) diff --git a/R/tam_thurstonian_threshold.R b/R/tam.threshold.R similarity index 86% rename from R/tam_thurstonian_threshold.R rename to R/tam.threshold.R index cbbe78e..7896f77 100644 --- a/R/tam_thurstonian_threshold.R +++ b/R/tam.threshold.R @@ -1,16 +1,19 @@ -## File Name: tam_thurstonian_threshold.R -## File Version: 9.11 +## File Name: tam.threshold.R +## File Version: 9.15 + + +#**** Thurstonian thresholds (gammas) -#################################################################### -# Thurstonian thresholds (gammas) -#................................................................... tam.threshold <- function (tamobj, prob.lvl=0.5) { resp <- tamobj$resp nitems <- tamobj$nitems maxK <- tamobj$maxK AXsi <- tamobj$AXsi - xsi <- ( tamobj$xsi )[,1] + xsi <- tamobj$xsi + if (class(tamobj)!="tam.jml"){ + xsi <- xsi[,1] + } A <- tamobj$A B <- tamobj$B maxKi <- apply( resp, 2, max, na.rm=TRUE ) diff --git a/R/tam_jml_version2.R b/R/tam_jml_version2.R index a018329..0f5ecbd 100644 --- a/R/tam_jml_version2.R +++ b/R/tam_jml_version2.R @@ -1,5 +1,5 @@ ## File Name: tam_jml_version2.R -## File Version: 9.525 +## File Version: 9.526 tam_jml_version2 <- function( resp, group=NULL, adj=.3, disattenuate=FALSE, bias=TRUE, xsi.fixed=NULL, xsi.inits=NULL, A=NULL, B=NULL, Q=NULL, @@ -153,7 +153,7 @@ tam_jml_version2 <- function( resp, group=NULL, adj=.3, disattenuate=FALSE, # center theta? center_theta <- is.null(xsi.fixed) & (constraint=="cases") - + deviance <- 0 deviance.history <- matrix( 0, nrow=maxiter, ncol=2) colnames(deviance.history) <- c("iter", "deviance") diff --git a/README.md b/README.md index e8e68ce..bd7976c 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,9 @@ The CRAN version can be installed from within R using: utils::install.packages("TAM") ``` -#### GitHub version `TAM` 3.6-28 (2021-01-19) +#### GitHub version `TAM` 3.6-29 (2021-01-24) -[![](https://img.shields.io/badge/github%20version-3.6--28-orange.svg)](https://github.com/alexanderrobitzsch/TAM)   +[![](https://img.shields.io/badge/github%20version-3.6--29-orange.svg)](https://github.com/alexanderrobitzsch/TAM)   The version hosted [here](https://github.com/alexanderrobitzsch/TAM) is the development version of `TAM`. The GitHub version can be installed using `devtools` as: diff --git a/docs/404.html b/docs/404.html index b95b003..185fb1c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -71,7 +71,7 @@ TAM - 3.6-28 + 3.6-29 diff --git a/docs/authors.html b/docs/authors.html index 48b5a6e..d17584a 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -71,7 +71,7 @@ TAM - 3.6-28 + 3.6-29 @@ -111,12 +111,12 @@

Citation

Source: inst/CITATION -

Robitzsch, A., Kiefer, T., & Wu, M. (2021). TAM: Test Analysis Modules. R package version 3.6-28. https://CRAN.R-project.org/package=TAM

-
@Manual{TAM_3.6-28,
+    

Robitzsch, A., Kiefer, T., & Wu, M. (2021). TAM: Test Analysis Modules. R package version 3.6-29. https://CRAN.R-project.org/package=TAM

+
@Manual{TAM_3.6-29,
   title = {TAM: Test Analysis Modules},
   author = {Alexander Robitzsch and Thomas Kiefer and Margaret Wu},
   year = {2021},
-  note = {R package version 3.6-28},
+  note = {R package version 3.6-29},
   url = {https://CRAN.R-project.org/package=TAM},
 }
diff --git a/docs/index.html b/docs/index.html index 29b653c..08474d1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ TAM - 3.6-28 + 3.6-29 diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index ae8f962..c2bbe2b 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,5 +2,5 @@ pandoc: 1.13.1 pkgdown: 1.5.1 pkgdown_sha: ~ articles: [] -last_built: 2021-01-19T14:20Z +last_built: 2021-01-24T14:29Z diff --git a/docs/reference/tam.fit.html b/docs/reference/tam.fit.html index 2d2f92f..ee18309 100644 --- a/docs/reference/tam.fit.html +++ b/docs/reference/tam.fit.html @@ -126,7 +126,7 @@

Item Infit and Outfit Statistic

tam.mml.fit(tamobj, FitMatrix=NULL, Nsimul=NULL,progress=TRUE, useRcpp=TRUE, seed=NA, fit.facets=TRUE) -tam.jml.fit(tamobj) +tam.jml.fit(tamobj, trim_val=10) # S3 method for tam.fit summary(object, file=NULL, ...)
@@ -168,6 +168,11 @@

Arg fit.facets

An optional logical indicating whether fit for all facet parameters should be computed.

+ + + trim_val +

Optional trimming value. Squared standardized reaisuals +larger than trim_val are set to trim_val.

object diff --git a/docs/reference/tam.jml.html b/docs/reference/tam.jml.html index 45b254b..8f44c63 100644 --- a/docs/reference/tam.jml.html +++ b/docs/reference/tam.jml.html @@ -243,7 +243,7 @@

Arg

Value

A list with following entries

-
item

Data frame with item parameters

+
item1

Data frame with item parameters

xsi

Vector of item parameters \(\xi\)

errorP

Standard error of item parameters \(\xi\)

theta

MLE in final step

@@ -268,7 +268,7 @@

Value

resp.ind.list

Like resp.ind, only in the format of a list

xsi.fixed

Fixed \(\xi\) item parameters

control

Control list

-
item1

Extended data frame of item parameters

+
item

Extended data frame of item parameters

theta_summary

Summary of person parameters

...

diff --git a/inst/NEWS b/inst/NEWS index e7e6df5..e384515 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -42,7 +42,7 @@ http://www.edmeasurementsurveys.com/TAM/Tutorials/ ------------------------------------------------------------- -VERSIONS TAM 3.6 | 2021-01-19 | Last: TAM 3.6-28 +VERSIONS TAM 3.6 | 2021-01-24 | Last: TAM 3.6-29 ------------------------------------------------------------- FIXED * fixed an issue in tam.linking() if number of maximum @@ -60,6 +60,11 @@ FIXED * handling of person weights in multi faceted models NOTE * added constraints option in designMatrices() function for rating scale models (modeltype='RSM') (thanks to Stefanie Wind) +NOTE * switched labeling of output values 'item' and 'item1' + in models of class 'tam.jml' +NOTE * included argument 'trim_val' in tam.jml.fit() +FIXED * tam.threshold() now works for objects of class 'tam.jml' + (requested by Angel Zegarra) DATA * included/modified datasets: --- diff --git a/man/tam.fit.Rd b/man/tam.fit.Rd index 799962d..e9ca661 100644 --- a/man/tam.fit.Rd +++ b/man/tam.fit.Rd @@ -1,5 +1,5 @@ %% File Name: tam.fit.Rd -%% File Version: 2.561 +%% File Version: 2.562 \name{tam.fit} @@ -24,7 +24,7 @@ tam.fit(tamobj, ...) tam.mml.fit(tamobj, FitMatrix=NULL, Nsimul=NULL,progress=TRUE, useRcpp=TRUE, seed=NA, fit.facets=TRUE) -tam.jml.fit(tamobj) +tam.jml.fit(tamobj, trim_val=10) \method{summary}{tam.fit}(object, file=NULL, \dots) } @@ -54,6 +54,8 @@ The latter is consistent with \pkg{TAM} (<=1.1).} \item{seed}{Fixed simulation seed.} \item{fit.facets}{An optional logical indicating whether fit for all facet parameters should be computed.} +\item{trim_val}{Optional trimming value. Squared standardized reaisuals +larger than \code{trim_val} are set to \code{trim_val}.} \item{object}{Object of class \code{tam.fit}} \item{file}{Optional file name for summary output} \item{\dots}{Further arguments to be passed} diff --git a/man/tam.jml.Rd b/man/tam.jml.Rd index ee0b75a..d452bc7 100644 --- a/man/tam.jml.Rd +++ b/man/tam.jml.Rd @@ -1,5 +1,5 @@ %% File Name: tam.jml.Rd -%% File Version: 2.401 +%% File Version: 2.402 \name{tam.jml} @@ -125,7 +125,7 @@ A file name in which the summary output will be written \value{ A list with following entries -\item{item}{Data frame with item parameters} +\item{item1}{Data frame with item parameters} \item{xsi}{Vector of item parameters \eqn{\xi}} \item{errorP}{Standard error of item parameters \eqn{\xi}} \item{theta}{MLE in final step} @@ -150,7 +150,7 @@ A list with following entries \item{resp.ind.list}{Like \code{resp.ind}, only in the format of a list} \item{xsi.fixed}{Fixed \eqn{\xi} item parameters} \item{control}{Control list} -\item{item1}{Extended data frame of item parameters} +\item{item}{Extended data frame of item parameters} \item{theta_summary}{Summary of person parameters} \item{\dots}{} } diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 51b8c7e..7b30190 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -1,5 +1,5 @@ //// File Name: RcppExports.cpp -//// File Version: 3.006028 +//// File Version: 3.006029 // Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 diff --git a/src/init.c b/src/init.c index 393b9e1..d6b5173 100644 --- a/src/init.c +++ b/src/init.c @@ -1,5 +1,5 @@ //// File Name: init.c -//// File Version: 3.006028 +//// File Version: 3.006029 #include #include #include // for NULL