From d145ddcdd6b9e634d2df135a404b485a4607dd86 Mon Sep 17 00:00:00 2001 From: arobitzsch Date: Wed, 13 Apr 2022 12:03:45 +0200 Subject: [PATCH] 1.3-2 --- DESCRIPTION | 4 +-- R/RcppExports.R | 2 +- R/immer_FACETS.R | 12 +++---- R/immer_install.R | 38 ++++++++++---------- R/immer_jml.R | 29 +++++++++------ R/immer_jml_update_item_R.R | 6 ++-- R/immer_jml_update_item_Rcpp.R | 10 ++++-- R/immer_latent_regression.R | 4 +-- R/immer_proc_data.R | 5 +-- README.md | 6 ++-- docs/404.html | 2 +- docs/authors.html | 10 +++--- docs/index.html | 4 +-- docs/pkgdown.yml | 2 +- docs/reference/data.immer.html | 2 +- docs/reference/data.ptam.html | 2 +- docs/reference/immer-package.html | 12 +++---- docs/reference/immer_FACETS.html | 6 ++-- docs/reference/immer_agree2.html | 2 +- docs/reference/immer_ccml.html | 2 +- docs/reference/immer_cml.html | 21 +++++------ docs/reference/immer_hrm.html | 6 ++-- docs/reference/immer_hrm_simulate.html | 6 ++-- docs/reference/immer_install.html | 4 +-- docs/reference/immer_jml.html | 10 ++++-- docs/reference/immer_latent_regression.html | 4 +-- docs/reference/immer_opcat.html | 4 +-- docs/reference/immer_proc_data.html | 2 +- docs/reference/immer_reshape_wideformat.html | 2 +- docs/reference/immer_unique_patterns.html | 2 +- docs/reference/index.html | 2 +- docs/reference/lc2_agreement.html | 2 +- docs/reference/probs2logits.html | 2 +- inst/NEWS | 20 +++++++++-- man/immer_cml.Rd | 13 +++---- man/immer_jml.Rd | 7 ++-- src/RcppExports.cpp | 7 +++- src/immer_rcpp_ccml.cpp | 4 +-- src/immer_rcpp_cmml.cpp | 6 ++-- 39 files changed, 162 insertions(+), 122 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index edf92bf..7860221 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: immer Type: Package Title: Item Response Models for Multiple Ratings -Version: 1.2-10 -Date: 2020-08-16 17:17:13 +Version: 1.3-2 +Date: 2022-04-13 10:22:26 Author: Alexander Robitzsch [aut, cre], Jan Steinfeld [aut] Maintainer: Alexander Robitzsch diff --git a/R/RcppExports.R b/R/RcppExports.R index e413fb3..be0c532 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -1,5 +1,5 @@ ## File Name: RcppExports.R -## File Version: 1.002010 +## File Version: 1.003002 # Generated by using Rcpp::compileAttributes() -> do not edit by hand # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 diff --git a/R/immer_FACETS.R b/R/immer_FACETS.R index 9426679..a09f777 100644 --- a/R/immer_FACETS.R +++ b/R/immer_FACETS.R @@ -1,5 +1,5 @@ ## File Name: immer_FACETS.R -## File Version: 0.43 +## File Version: 0.46 #--- Wrapper to FACDOS (Linacre, 1999) immer_FACETS <- function( @@ -122,7 +122,7 @@ immer_FACETS <- function( } else { filenames <- c(filenames,"Outputfile"=Out) } - + woScor <- grep("Scorefile",inputfile,ignore.case=TRUE) Scor <- inputfile[woScor] ; Scor <- grepInput(Scor) @@ -132,7 +132,7 @@ immer_FACETS <- function( } else { filenames <- c(filenames,"Scorefile"=Scor) } - + woResid <- grep("Residualfile",inputfile,ignore.case=TRUE) Resid <- inputfile[woResid] ; Resid <- grepInput(Resid) @@ -142,7 +142,7 @@ immer_FACETS <- function( } else { filenames <- c(filenames,"Residualfile"=Resid) } - + # woCate <- grep("ISFILE",inputfile,ignore.case=TRUE) # Cate <- inputfile[woCate] ; Resid <- grepInput(Cate) # if(!is.null(path.dosbox)){ @@ -230,7 +230,7 @@ immer_FACETS <- function( ) writeLines( start.facets, file.path(path.facets,"mymodel.bat") ) - shell(file.path(path.facets,"startDOS.bat"), intern = TRUE, wait = TRUE) + shell(file.path(path.facets,"startDOS.bat"), intern=TRUE, wait=TRUE) while (file.exists(file.path(path.facets,"startDOS.bat"))) { Sys.sleep(1) @@ -288,7 +288,7 @@ immer_FACETS <- function( filenames <- sapply(filenames,function(x) substr(x,1,nchar(x)-4)) fileListe <- sapply(filenames,function(x) grep(x,files,value=TRUE)) - + # lapply(fileListe,FUN=function(x) sapply(x,function(x)readLines(x,skipNul=TRUE,))) # namScorefile <- c("T.Score","T.Count","Obs.Avge","Fair.Avge","Measure","S.E.","InfitMS","InfitZ","OutfitMS","OutfitZ","PtMea","PtMeExp","Discrim","Displace","Status","Group","Weight","Lable","Teams","F-Number","F-Label" ) score <- try( diff --git a/R/immer_install.R b/R/immer_install.R index a3b4f0f..de9dffc 100644 --- a/R/immer_install.R +++ b/R/immer_install.R @@ -1,12 +1,12 @@ ## File Name: immer_install.R -## File Version: 0.14 +## File Version: 0.17 ## File Name: immer_install.R ## File Version: 0.12 ##################################################### # installation of the free FACETS DOS_Version # for this the DOSBOX is needed -immer_install <- function(DosBox_path = NULL, Facets_path = NULL){ +immer_install <- function(DosBox_path=NULL, Facets_path=NULL){ os_system <- Sys.info()["sysname"] user <- Sys.info()['user'] # Ausgabe fuer den User @@ -19,10 +19,10 @@ Darwin= {cat("I'm a Mac. Install Facets and Dosbox for Mac \n")} ) -if(os_system == "Windows"){ +if(os_system=="Windows"){ # Link for dos-version of FACETS link_Facets <- "http://www.winsteps.com/a/facdos.zip" - + # Facets_path <- # file.path("C:","Users",user,"Downloads") # win DOSbox @@ -34,10 +34,10 @@ if(os_system == "Windows"){ destination_dosBox <- paste0("C:\\Users\\",user,"\\Downloads\\") } else { - destination_dosBox <- + destination_dosBox <- DosBox_path } - if (!dir.exists(file.path(destination_dosBox))) { + if (!dir.exists(file.path(destination_dosBox))) { dir.create(file.path(destination_dosBox)) } @@ -45,30 +45,30 @@ if(os_system == "Windows"){ destination_facets <- paste0("C:\\Users\\",user,"\\Documents\\facets") } else { - destination_facets <- + destination_facets <- Facets_path } - if (!dir.exists(file.path(destination_facets))) { + if (!dir.exists(file.path(destination_facets))) { dir.create(file.path(destination_facets)) } - + # ----------------------------------------- # download files error_facets <- tryCatch( download.file( - url = link_Facets, - destfile = file.path(destination_facets,"facdos.zip"), - method = "internal" + url=link_Facets, + destfile=file.path(destination_facets,"facdos.zip"), + method="internal" ) ) # JS Verison 0.09: changed method to 'auto' error_DosBox <- tryCatch( download.file( - url = link_DosBox, - destfile = file.path(destination_dosBox,"DOSBoxPortable.exe"), - method = "auto", - mode = "wb" + url=link_DosBox, + destfile=file.path(destination_dosBox,"DOSBoxPortable.exe"), + method="auto", + mode="wb" ) ) cat( "install the DOSbox: \n") @@ -79,7 +79,7 @@ if(os_system == "Windows"){ # Den Admin des Computers herausfinden: und Installation von DosBox # ----------------------------------------- - if(error_DosBox != 0){ + if(error_DosBox !=0){ cat("Attention, there was an error while downloading the DosBox, please try again or install die DosBox manually \n") cat(paste0("for the manual installation pleas go to: \n",link_DosBox,"\n", @@ -87,7 +87,7 @@ if(os_system == "Windows"){ the DosBox into \n--> \\Users\\yourUser\\Documents <--")) } - if(error_DosBox == 0){ + if(error_DosBox==0){ # JS Verison 0.09: changed installation process, no admin privilegs needed writeLines(c("...starting installation process of DosBox", @@ -97,7 +97,7 @@ if(os_system == "Windows"){ # findeAdmin <- paste0("net localgroup ",gsub("\\*","",admin[grep("adm|Adm",admin)])) # test <- system(findeAdmin,intern=TRUE) # administrator <- test[grep("--",test)+1] - system("cmd.exe", input = paste0("start ",destination_dosBox)) + system("cmd.exe", input=paste0("start ",destination_dosBox)) # ----------------------------------------- # Edit the configFile to speed up the process [if the installation is successful] diff --git a/R/immer_jml.R b/R/immer_jml.R index 9603255..a58690f 100644 --- a/R/immer_jml.R +++ b/R/immer_jml.R @@ -1,8 +1,9 @@ ## File Name: immer_jml.R -## File Version: 0.9674 +## File Version: 1.011 -immer_jml <- function(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, irtmodel="PCM", +immer_jml <- function(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, + weights=NULL, irtmodel="PCM", pid=NULL, rater=NULL, eps=.3, est_method="eps_adj", maxiter=1000, conv=1E-5, max_incr=3, incr_fac=1.1, maxiter_update=10, maxiter_line_search=6, conv_update=1E-5, verbose=TRUE, use_Rcpp=TRUE, shortcut=TRUE ) @@ -11,15 +12,21 @@ immer_jml <- function(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, i CALL <- match.call() #-- process rating data - res <- immer_proc_data( dat=dat, pid=pid, rater=rater, weights=NULL, maxK=maxK) + res <- immer_proc_data( dat=dat, pid=pid, rater=rater, weights=weights, maxK=maxK) dat <- res$dat2.NA pid <- res$pid maxK <- res$maxK K <- res$K pseudoitems_design <- res$pseudoitems_design + use_weights <- FALSE + if (! is.null(weights)){ + use_Rcpp <- TRUE + use_weights <- TRUE + } + #-- shortcut for analyzing the dataset - res <- immer_jml_proc_shortcut( dat=dat, pid=pid, shortcut=shortcut, weights=NULL) + res <- immer_jml_proc_shortcut( dat=dat, pid=pid, shortcut=shortcut, weights=weights) dat <- res$dat pid <- res$pid shortcut <- res$shortcut @@ -70,7 +77,6 @@ immer_jml <- function(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, i max_pers=person$max_pers, eps=eps) } - dat_score <- array( dat_resp * person$eps_i, dim=c(N,I,K+1) ) dat_score2 <- dat_score for (ii in 1:I){ @@ -144,9 +150,11 @@ immer_jml <- function(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, i theta0 <- theta deviance0 <- deviance #** update item parameters - args_item <- list( score_items=score_items, I=I, K=K, b=b, A=A, xsi=xsi, theta=theta, N=N, dat_resp=dat_resp, - max_incr=max_incr, maxiter_update=maxiter_update, conv_update=conv_update, - b_fixed=b_fixed, ItemScore=ItemScore, shortcut_index=shortcut_index, weights=weights ) + args_item <- list( score_items=score_items, I=I, K=K, b=b, A=A, xsi=xsi, + theta=theta, N=N, dat_resp=dat_resp, max_incr=max_incr, + maxiter_update=maxiter_update, conv_update=conv_update, + b_fixed=b_fixed, ItemScore=ItemScore, shortcut_index=shortcut_index, + weights=weights, use_weights=use_weights ) res <- do.call( what=fct_item, args=args_item) b <- res$b xsi <- res$xsi @@ -161,7 +169,7 @@ immer_jml <- function(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, i theta <- res$theta theta_der2 <- res$theta_der2 probs <- res$probs - + #* trim theta increment incr <- theta - theta0 max_incr <- max_incr/incr_fac @@ -180,7 +188,6 @@ immer_jml <- function(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, i # immer_jml_print_progress_line_search( verbose=verbose, deviance=deviance, digits_deviance=6) lambda <- 1 lambda_fac <- 2 - # lambda_fac <- 1.5 xsi_old <- xsi0 b_old <- b probs_old <- probs @@ -210,7 +217,7 @@ immer_jml <- function(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, i iter_in <- iter_in + 1 # immer_jml_print_progress_line_search( verbose=verbose, deviance=deviance, digits_deviance=6) } - if (iter_in >= maxiter_ls){ + if (iter_in >=maxiter_ls){ xsi <- .5*(xsi_old + xsi) theta <- .5*(theta_old + theta) b <- immer_jml_calc_item_intercepts(A=A, xsi=xsi) diff --git a/R/immer_jml_update_item_R.R b/R/immer_jml_update_item_R.R index de8f6c0..8a1b95d 100644 --- a/R/immer_jml_update_item_R.R +++ b/R/immer_jml_update_item_R.R @@ -1,10 +1,10 @@ ## File Name: immer_jml_update_item_R.R -## File Version: 0.79 +## File Version: 0.801 immer_jml_update_item_R <- function( score_items, ItemScore, I, K, b, A, xsi, theta, - N, dat_resp, max_incr, maxiter_update, conv_update, b_fixed, shortcut_index, - weights ) + N, dat_resp, max_incr, maxiter_update, conv_update, b_fixed, shortcut_index, + weights, use_weights=TRUE ) { iterate <- TRUE iter <- 0 diff --git a/R/immer_jml_update_item_Rcpp.R b/R/immer_jml_update_item_Rcpp.R index 7c2943c..9796938 100644 --- a/R/immer_jml_update_item_Rcpp.R +++ b/R/immer_jml_update_item_Rcpp.R @@ -1,9 +1,10 @@ ## File Name: immer_jml_update_item_Rcpp.R -## File Version: 0.41 +## File Version: 0.463 immer_jml_update_item_Rcpp <- function( score_items, ItemScore, I, K, b, A, xsi, theta, - N, dat_resp, max_incr, maxiter_update, conv_update, b_fixed, shortcut_index, weights ) + N, dat_resp, max_incr, maxiter_update, conv_update, b_fixed, shortcut_index, weights, + use_weights=FALSE) { iterate <- TRUE iter <- 0 @@ -15,6 +16,11 @@ immer_jml_update_item_Rcpp <- function( score_items, ItemScore, I, K, b, A, xsi, update <- as.vector(shortcut_index$update) update_weights <- as.vector(shortcut_index$update_weights) + if (TRUE){ + update <- rep(1,length(update)) + update_weights <- weights + } + while(iterate){ b0 <- b xsi0 <- xsi diff --git a/R/immer_latent_regression.R b/R/immer_latent_regression.R index a250a39..f013071 100644 --- a/R/immer_latent_regression.R +++ b/R/immer_latent_regression.R @@ -1,5 +1,5 @@ ## File Name: immer_latent_regression.R -## File Version: 0.39 +## File Version: 0.41 immer_latent_regression <- function( like, theta=NULL, Y=NULL, group=NULL, weights=NULL, conv=1E-5, maxit=200, verbose=TRUE) @@ -49,7 +49,7 @@ immer_latent_regression <- function( like, theta=NULL, Y=NULL, group=NULL, } Xw <- X * weights - XtX <- immer_ginv( x = t(X) %*% Xw ) + XtX <- immer_ginv( x=t(X) %*% Xw ) thetaM <- matrix( theta, nrow=N, ncol=TP, byrow=TRUE) mu <- as.vector( X %*% beta ) sigma <- gamma[ group ] diff --git a/R/immer_proc_data.R b/R/immer_proc_data.R index 8502dfc..fb032be 100644 --- a/R/immer_proc_data.R +++ b/R/immer_proc_data.R @@ -1,5 +1,5 @@ ## File Name: immer_proc_data.R -## File Version: 0.16 +## File Version: 0.17 immer_proc_data <- function( dat, pid=NULL, rater=NULL, weights=NULL, maxK=NULL) { @@ -15,7 +15,8 @@ immer_proc_data <- function( dat, pid=NULL, rater=NULL, weights=NULL, maxK=NULL) rater <- rep(0,N1) } #-- apply sirt::rm_proc_data() function for processing rating data - res <- sirt::rm_proc_data( dat=dat, pid=pid, rater=rater, rater_item_int=FALSE, reference_rater=NULL ) + res <- sirt::rm_proc_data( dat=dat, pid=pid, rater=rater, rater_item_int=FALSE, + reference_rater=NULL ) N <- res$N res$pid <- res$person.index$pid #-- maxK and K diff --git a/README.md b/README.md index 2c34f49..b8c43f5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you use `immer` and have suggestions for improvement or have found bugs, plea The manual may be found here [https://alexanderrobitzsch.github.io/immer/](https://alexanderrobitzsch.github.io/immer/) -#### CRAN version `immer` 1.1-35 (2018-12-11) +#### CRAN version `immer` 1.2-19 (2022-04-11) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version-last-release/immer)](https://cran.r-project.org/package=immer) @@ -22,9 +22,9 @@ The CRAN version can be installed from within R using: utils::install.packages("immer") ``` -#### GitHub version `immer` 1.2-10 (2020-08-16) +#### GitHub version `immer` 1.3-2 (2022-04-13) -[![](https://img.shields.io/badge/github%20version-1.2--10-orange.svg)](https://github.com/alexanderrobitzsch/immer)   +[![](https://img.shields.io/badge/github%20version-1.3--2-orange.svg)](https://github.com/alexanderrobitzsch/immer)   The version hosted [here](https://github.com/alexanderrobitzsch/immer) is the development version of `immer`. The GitHub version can be installed using `devtools` as: diff --git a/docs/404.html b/docs/404.html index afdd6b2..95eb42c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -71,7 +71,7 @@ immer - 1.2-10 + 1.3-2 diff --git a/docs/authors.html b/docs/authors.html index cbfcf0f..93a143d 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -71,7 +71,7 @@ immer - 1.2-10 + 1.3-2 @@ -123,13 +123,13 @@

Citation

number = {1}, pages = {101--139}, } -

Robitzsch, A., & Steinfeld, J. (2020). - immer: Item response models for multiple ratings. R package version 1.2-10. https://CRAN.R-project.org/package=immer

+

Robitzsch, A., & Steinfeld, J. (2022). + immer: Item response models for multiple ratings. R package version 1.3-2. https://CRAN.R-project.org/package=immer

@Manual{,
   title = {immer: Item response models for multiple ratings},
   author = {Alexander Robitzsch and Jan Steinfeld},
-  year = {2020},
-  note = {R package version 1.2-10},
+  year = {2022},
+  note = {R package version 1.3-2},
   url = {https://CRAN.R-project.org/package=immer},
 }
diff --git a/docs/index.html b/docs/index.html index cb400d6..6efc152 100644 --- a/docs/index.html +++ b/docs/index.html @@ -40,7 +40,7 @@ immer - 1.2-10 + 1.3-2 @@ -108,7 +108,7 @@

GitHub version

The version hosted here is the development version of immer. The GitHub version can be installed using devtools as:

-
devtools::install_github("alexanderrobitzsch/immer")
+
devtools::install_github("alexanderrobitzsch/immer")
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 3ed6c6e..c1de046 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: 2020-08-16T15:26Z +last_built: 2022-04-13T08:31Z diff --git a/docs/reference/data.immer.html b/docs/reference/data.immer.html index fc80ce0..93d7557 100644 --- a/docs/reference/data.immer.html +++ b/docs/reference/data.immer.html @@ -72,7 +72,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/docs/reference/data.ptam.html b/docs/reference/data.ptam.html index e2a097d..b11f0ac 100644 --- a/docs/reference/data.ptam.html +++ b/docs/reference/data.ptam.html @@ -72,7 +72,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/docs/reference/immer-package.html b/docs/reference/immer-package.html index e8dd524..393dfd2 100644 --- a/docs/reference/immer-package.html +++ b/docs/reference/immer-package.html @@ -80,7 +80,7 @@ immer - 1.2-vv + 1.3-vv @@ -143,21 +143,21 @@

Details

The immer package has following features:

  • Estimation of the hierarchical rater model (Patz et al., 2002) with -immer_hrm and simulation of it with immer_hrm_simulate.

    +immer_hrm and simulation of it with immer_hrm_simulate.

  • The linear logistic partial credit model as an extension to the linear logistic test model (LLTM) for dichotomous data can be estimated with -conditional maximum likelihood (Andersen, 1995) using immer_cml.

    +conditional maximum likelihood (Andersen, 1995) using immer_cml.

  • The linear logistic partial credit model can be estimated with composite conditional maximum likelihood (Varin, Reid & Firth, 2011) using the -immer_ccml function.

    +immer_ccml function.

  • The linear logistic partial credit model can be estimated with a bias-corrected joint maximum likelihood method (Bertoli-Barsotti, Lando & Punzo, 2014) -using the immer_jml function.

    +using the immer_jml function.

  • -
  • Wrapper function immer_FACETS to the commercial +

  • Wrapper function immer_FACETS to the commercial program FACETS (Linacre, 1999) for analyzing multi-faceted Rasch models.

  • ...

diff --git a/docs/reference/immer_FACETS.html b/docs/reference/immer_FACETS.html index 1c40eff..5ae23c1 100644 --- a/docs/reference/immer_FACETS.html +++ b/docs/reference/immer_FACETS.html @@ -72,7 +72,7 @@ immer - 1.2-vv + 1.3-vv @@ -226,7 +226,7 @@

R

Linacre, J. M. (1999). FACETS (Version 3.17)[Computer software]. Chicago: MESA.

See also

-

Install FACDOS and DOSBox immer_install.

+

Install FACDOS and DOSBox immer_install.

Examples

if (FALSE) {
@@ -252,7 +252,7 @@ 

Examp # rater variability parameters psi <- matrix( c(.1, .4, .8), nrow=I, ncol=R, byrow=TRUE ) # simulate HRM data -data <- immer::immer_hrm_simulate( theta, a, b, phi=phi, psi=psi ) +data <- immer::immer_hrm_simulate( theta, a, b, phi=phi, psi=psi ) # prepare data for FACETS data2FACETS <- function(data){ diff --git a/docs/reference/immer_agree2.html b/docs/reference/immer_agree2.html index e43ae86..dd08247 100644 --- a/docs/reference/immer_agree2.html +++ b/docs/reference/immer_agree2.html @@ -74,7 +74,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/docs/reference/immer_ccml.html b/docs/reference/immer_ccml.html index d4f72ed..0f470c2 100644 --- a/docs/reference/immer_ccml.html +++ b/docs/reference/immer_ccml.html @@ -82,7 +82,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/docs/reference/immer_cml.html b/docs/reference/immer_cml.html index 6bd2279..375489f 100644 --- a/docs/reference/immer_cml.html +++ b/docs/reference/immer_cml.html @@ -78,7 +78,7 @@ immer - 1.2-vv + 1.3-vv @@ -291,15 +291,14 @@

See a RM.weights package.

Examples

-
library(sirt)
+    
#############################################################################
+# EXAMPLE 1: Dichotomous data data.read
+#############################################################################
+
+library(sirt)
 library(psychotools)
 library(TAM)
 library(CDM)
-library(eRm)
-
-#############################################################################
-# EXAMPLE 1: Dichotomous data data.read
-#############################################################################
 
 data(data.read, package="sirt")
 dat <- data.read
@@ -313,6 +312,8 @@ 

Examp coef(mod1a) # extract coefficients if (FALSE) { +library(eRm) + # estimate model in psychotools package mod1b <- psychotools::raschmodel(dat) summary(mod1b) @@ -359,7 +360,7 @@

Examp summary(mod4a) a <- mod4a$item$a # extract (non-integer) item discriminations # estimate integer item discriminations ranging from 1 to 3 -a_integer <- immer::immer_opcat( a, hmean=2, min=1, max=3 ) +a_integer <- immer::immer_opcat( a, hmean=2, min=1, max=3 ) # estimate one-parameter model with fixed integer item discriminations mod4 <- immer::immer_cml( dat=dat, a=a_integer ) summary(mod4) @@ -459,7 +460,7 @@

Examp dat <- data.immer07 #*** reshape dataset for one variable -dfr1 <- immer::immer_reshape_wideformat( dat$I1, rater=dat$rater, pid=dat$pid ) +dfr1 <- immer::immer_reshape_wideformat( dat$I1, rater=dat$rater, pid=dat$pid ) #-- extract structure of design matrix res <- immer:::lpcm_data_prep( dat=dfr1[,-1], weights=NULL, a=NULL) @@ -491,7 +492,7 @@

Examp dat <- data.immer07 #*** reshape dataset -dfr1 <- immer::immer_reshape_wideformat( dat[, paste0("I",1:4) ], rater=dat$rater, +dfr1 <- immer::immer_reshape_wideformat( dat[, paste0("I",1:4) ], rater=dat$rater, pid=dat$pid ) #-- structure of design matrix diff --git a/docs/reference/immer_hrm.html b/docs/reference/immer_hrm.html index af11dfc..ca30f60 100644 --- a/docs/reference/immer_hrm.html +++ b/docs/reference/immer_hrm.html @@ -73,7 +73,7 @@ immer - 1.2-vv + 1.3-vv @@ -285,7 +285,7 @@

R Journal of Educational and Behavioral Statistics, 27(4), 341-384.

See also

-

Simulate the HRM with immer_hrm_simulate.

+

Simulate the HRM with immer_hrm_simulate.

Examples

if (FALSE) {
@@ -315,7 +315,7 @@ 

Examp # rater variability parameters psi <- matrix( c(.1, .4, .8), nrow=I, ncol=R, byrow=TRUE ) # simulate HRM data -data <- immer::immer_hrm_simulate( theta, a, b, phi=phi, psi=psi ) +data <- immer::immer_hrm_simulate( theta, a, b, phi=phi, psi=psi ) pid <- data$pid rater <- data$rater dat <- data[, - c(1:2) ] diff --git a/docs/reference/immer_hrm_simulate.html b/docs/reference/immer_hrm_simulate.html index bd8159b..976b14d 100644 --- a/docs/reference/immer_hrm_simulate.html +++ b/docs/reference/immer_hrm_simulate.html @@ -72,7 +72,7 @@ immer - 1.2-vv + 1.3-vv @@ -146,7 +146,7 @@

Arg

Details

-

See immer_hrm for more details of the hierarchical rater model.

+

See immer_hrm for more details of the hierarchical rater model.

Value

Dataset with simulated item responses as well as vectors of person @@ -159,7 +159,7 @@

R Journal of Educational and Behavioral Statistics, 27(4), 341-384.

See also

-

See Example 1 in immer_hrm for applying the +

See Example 1 in immer_hrm for applying the immer_hrm_simulate function.

diff --git a/docs/reference/immer_install.html b/docs/reference/immer_install.html index 421308f..ae03bf0 100644 --- a/docs/reference/immer_install.html +++ b/docs/reference/immer_install.html @@ -73,7 +73,7 @@ immer - 1.2-vv + 1.3-vv @@ -146,7 +146,7 @@

R [Computer Software]. Arizona: Scottsdale.

See also

-

Install FACDOS and DOSBox immer_FACETS.

+

Install FACDOS and DOSBox immer_FACETS.

Examples

if (FALSE) {
diff --git a/docs/reference/immer_jml.html b/docs/reference/immer_jml.html
index 50e208b..fd9ec18 100644
--- a/docs/reference/immer_jml.html
+++ b/docs/reference/immer_jml.html
@@ -79,7 +79,7 @@
       
       
         immer
-        1.2-vv
+        1.3-vv
       
     
 
@@ -129,8 +129,8 @@ 

Joint Maximum Likelihood Estimation for the Partial Credit Model JML estimation method (Bertoli-Barsotti, Lando & Punzo, 2014).

-
immer_jml(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, irtmodel="PCM",
-     pid=NULL, rater=NULL, eps=0.3, est_method="eps_adj", maxiter=1000,
+    
immer_jml(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, weights=NULL,
+     irtmodel="PCM", pid=NULL, rater=NULL, eps=0.3, est_method="eps_adj", maxiter=1000,
      conv=1e-05, max_incr=3, incr_fac=1.1, maxiter_update=10, maxiter_line_search=6,
      conv_update=1e-05, verbose=TRUE, use_Rcpp=TRUE, shortcut=TRUE)
 
@@ -172,6 +172,10 @@ 

Arg

Specified item response model. Can be one of the two partial credit model parametrizations PCM and PCM2.

+ + weights +

Optional vector of sampling weights

+ pid

Person identifier

diff --git a/docs/reference/immer_latent_regression.html b/docs/reference/immer_latent_regression.html index 94a3ddf..01f6d2f 100644 --- a/docs/reference/immer_latent_regression.html +++ b/docs/reference/immer_latent_regression.html @@ -74,7 +74,7 @@ immer - 1.2-vv + 1.3-vv @@ -244,7 +244,7 @@

Examp dat <- sirt::sim.raschtype( stats::rnorm( N*G, mean=mu[group], sd=sigma[group] ), b) #-- estimate Rasch model with JML -mod1 <- immer::immer_jml( dat ) +mod1 <- immer::immer_jml( dat ) summary(mod1) #-- compute individual likelihood diff --git a/docs/reference/immer_opcat.html b/docs/reference/immer_opcat.html index 1820018..d2719e4 100644 --- a/docs/reference/immer_opcat.html +++ b/docs/reference/immer_opcat.html @@ -75,7 +75,7 @@ immer - 1.2-vv + 1.3-vv @@ -164,7 +164,7 @@

R CITO Measurement and Research Department Reports, 91-10.

See also

-

See immer_cml for using immer_opcat to estimate +

See immer_cml for using immer_opcat to estimate the one-parameter logistic model.

Examples

diff --git a/docs/reference/immer_proc_data.html b/docs/reference/immer_proc_data.html index 4cf1742..e547c43 100644 --- a/docs/reference/immer_proc_data.html +++ b/docs/reference/immer_proc_data.html @@ -75,7 +75,7 @@ immer - 1.2-vv + 1.3-vv
diff --git a/docs/reference/immer_reshape_wideformat.html b/docs/reference/immer_reshape_wideformat.html index d767ccc..88b5b9e 100644 --- a/docs/reference/immer_reshape_wideformat.html +++ b/docs/reference/immer_reshape_wideformat.html @@ -72,7 +72,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/docs/reference/immer_unique_patterns.html b/docs/reference/immer_unique_patterns.html index 3e4059d..4926caa 100644 --- a/docs/reference/immer_unique_patterns.html +++ b/docs/reference/immer_unique_patterns.html @@ -72,7 +72,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/docs/reference/index.html b/docs/reference/index.html index 521fba5..825878e 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -71,7 +71,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/docs/reference/lc2_agreement.html b/docs/reference/lc2_agreement.html index 921b172..9e62395 100644 --- a/docs/reference/lc2_agreement.html +++ b/docs/reference/lc2_agreement.html @@ -74,7 +74,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/docs/reference/probs2logits.html b/docs/reference/probs2logits.html index d162fc4..c1668e2 100644 --- a/docs/reference/probs2logits.html +++ b/docs/reference/probs2logits.html @@ -72,7 +72,7 @@ immer - 1.2-vv + 1.3-vv diff --git a/inst/NEWS b/inst/NEWS index 432ffae..1b57a04 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -56,8 +56,22 @@ https://sites.google.com/site/alexanderrobitzsch/software + +------------------------------------------------------------ +VERSIONS immer 1.3 | 2022-04-13 | Last: immer 1.3-2 +------------------------------------------------------------ + +ADDED * --- + + +DATA * included/modified datasets: --- +EXAMP * included/modified examples: --- + + + + ------------------------------------------------------------ -VERSIONS immer 1.2 | 2020-08-16 | Last: immer 1.2-10 +VERSIONS immer 1.2 | 2022-04-11 | Last: immer 1.2-19 ------------------------------------------------------------ FIXED * fixed a bug in immer_jml() when a design matrix is @@ -73,12 +87,12 @@ FIXED * fixed a bug in immer_FACETS(), the first line was deleted during data preparation. (thanks to Gareth McCray) NOTE * link for Dosbox has been updated in immer_install() - +NOTE * included argument 'weights' in immer_jml() for + handling sampling weights DATA * included/modified datasets: --- EXAMP * included/modified examples: immer_jml (3) - ------------------------------------------------------------ VERSIONS immer 1.1 | 2018-12-11 | Last: immer 1.1-35 ------------------------------------------------------------ diff --git a/man/immer_cml.Rd b/man/immer_cml.Rd index 584a475..c40a010 100644 --- a/man/immer_cml.Rd +++ b/man/immer_cml.Rd @@ -1,5 +1,5 @@ %% File Name: immer_cml.Rd -%% File Version: 0.43 +%% File Version: 0.441 \name{immer_cml} \alias{immer_cml} @@ -179,15 +179,14 @@ For CML estimation with sample weights see also the \examples{ +############################################################################# +# EXAMPLE 1: Dichotomous data data.read +############################################################################# + library(sirt) library(psychotools) library(TAM) library(CDM) -library(eRm) - -############################################################################# -# EXAMPLE 1: Dichotomous data data.read -############################################################################# data(data.read, package="sirt") dat <- data.read @@ -201,6 +200,8 @@ logLik(mod1a) # extract log likelihood coef(mod1a) # extract coefficients \dontrun{ +library(eRm) + # estimate model in psychotools package mod1b <- psychotools::raschmodel(dat) summary(mod1b) diff --git a/man/immer_jml.Rd b/man/immer_jml.Rd index 7130e68..cb07fbf 100644 --- a/man/immer_jml.Rd +++ b/man/immer_jml.Rd @@ -1,5 +1,5 @@ %% File Name: immer_jml.Rd -%% File Version: 0.504 +%% File Version: 0.507 \name{immer_jml} \alias{immer_jml} @@ -23,8 +23,8 @@ JML estimation method (Bertoli-Barsotti, Lando & Punzo, 2014). } \usage{ -immer_jml(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, irtmodel="PCM", - pid=NULL, rater=NULL, eps=0.3, est_method="eps_adj", maxiter=1000, +immer_jml(dat, A=NULL, maxK=NULL, center_theta=TRUE, b_fixed=NULL, weights=NULL, + irtmodel="PCM", pid=NULL, rater=NULL, eps=0.3, est_method="eps_adj", maxiter=1000, conv=1e-05, max_incr=3, incr_fac=1.1, maxiter_update=10, maxiter_line_search=6, conv_update=1e-05, verbose=TRUE, use_Rcpp=TRUE, shortcut=TRUE) @@ -53,6 +53,7 @@ Matrix with fixed \eqn{b} parameters \item{irtmodel}{Specified item response model. Can be one of the two partial credit model parametrizations \code{PCM} and \code{PCM2}. } +\item{weights}{Optional vector of sampling weights} \item{pid}{Person identifier} \item{rater}{Optional rater identifier} \item{eps}{ diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index e2c59db..430b15b 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -1,5 +1,5 @@ //// File Name: RcppExports.cpp -//// File Version: 1.002010 +//// File Version: 1.003002 // Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 @@ -7,6 +7,11 @@ using namespace Rcpp; using namespace arma; +#ifdef RCPP_USE_GLOBAL_ROSTREAM +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); +#endif + // immer_ccml_proc_freq_item_pair Rcpp::NumericMatrix immer_ccml_proc_freq_item_pair(Rcpp::IntegerMatrix dat, Rcpp::IntegerMatrix dat_resp, int K, Rcpp::NumericVector weights, int ii, int jj); RcppExport SEXP _immer_immer_ccml_proc_freq_item_pair(SEXP datSEXP, SEXP dat_respSEXP, SEXP KSEXP, SEXP weightsSEXP, SEXP iiSEXP, SEXP jjSEXP) { diff --git a/src/immer_rcpp_ccml.cpp b/src/immer_rcpp_ccml.cpp index 9c6b704..1ae84d9 100644 --- a/src/immer_rcpp_ccml.cpp +++ b/src/immer_rcpp_ccml.cpp @@ -1,5 +1,5 @@ //// File Name: immer_rcpp_ccml.cpp -//// File Version: 0.720 +//// File Version: 0.721 // [[Rcpp::depends(RcppArmadillo)]] @@ -25,7 +25,7 @@ Rcpp::NumericMatrix immer_ccml_proc_freq_item_pair( Rcpp::IntegerMatrix dat, int ii1 = ii - 1; int jj1 = jj - 1; for (int nn=0; nn