Skip to content

Commit

Permalink
4.2-11
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderrobitzsch committed Aug 28, 2023
1 parent 7fd7423 commit b74dcfb
Show file tree
Hide file tree
Showing 30 changed files with 104 additions and 83 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: TAM
Type: Package
Title: Test Analysis Modules
Version: 4.2-1
Date: 2022-08-29 11:02:47
Version: 4.2-11
Date: 2023-08-28 17:23:17.934842
Author:
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>),
Thomas Kiefer [aut],
Expand Down
2 changes: 1 addition & 1 deletion R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: RcppExports.R
## File Version: 4.002001
## File Version: 4.002011
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

Expand Down
6 changes: 3 additions & 3 deletions R/tam.fa.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: tam.fa.R
## File Version: 9.258
## File Version: 9.261


#---- Exploratory Factor Analysis and Bifactor Models
Expand Down Expand Up @@ -116,7 +116,7 @@ tam.fa <- function( resp, irtmodel, dims=NULL, nfactors=NULL,

# oblimin rotation in exploratory factor analysis
if (irtmodel=="efa"){
res$efa.oblimin <- GPArotation::oblimin(L=B.stand)
res$efa.oblimin <- GPArotation::oblimin(A=B.stand)
# Schmid Leiman transformation
corrmatr <- tcrossprod( B.stand )
diag(corrmatr) <- 1
Expand All @@ -132,4 +132,4 @@ tam.fa <- function( resp, irtmodel, dims=NULL, nfactors=NULL,
#--- output
return(res)
}
#####################################################################

8 changes: 5 additions & 3 deletions R/tam.latreg.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: tam.latreg.R
## File Version: 9.341
## File Version: 9.343

###################################################################
# latent regression
Expand Down Expand Up @@ -244,6 +244,8 @@ tam.latreg <- function( like, theta=NULL, Y=NULL, group=NULL,
hwtE=hwt, hwt=hwt, ndim=ndim, theta=theta )
person <- res$person
EAP.rel <- res$EAP.rel
M_post <- res$M_post
SD_post <- res$SD_post

#cat("person parameters") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
############################################################
Expand Down Expand Up @@ -288,7 +290,7 @@ tam.latreg <- function( like, theta=NULL, Y=NULL, group=NULL,
deviance.history <- deviance.history[ 1:iter, ]
res <- list( "beta"=beta, "variance"=variance,
"person"=person, pid=pid, "EAP.rel"=EAP.rel,
"post"=hwt, "theta"=theta,
"post"=hwt, M_post=M_post, SD_post=SD_post, "theta"=theta,
"Y"=Y, "group"=group,
"G"=if ( is.null(group)){1} else { length(unique( group ) )},
"groups"=if ( is.null(group)){1} else { groups },
Expand All @@ -303,7 +305,7 @@ tam.latreg <- function( like, theta=NULL, Y=NULL, group=NULL,
"nnodes"=nnodes, "deviance"=deviance,
"ic"=ic, thetasamp.density=thetasamp.density,
"deviance.history"=deviance.history,
"control"=con1a, "iter"=iter,
"control"=con1a, "iter"=iter,
"YSD"=YSD, CALL=CALL, latreg_stand=latreg_stand )
class(res) <- "tam.latreg"
return(res)
Expand Down
7 changes: 2 additions & 5 deletions R/tam.mml.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: tam.mml.R
## File Version: 9.804
## File Version: 9.863

tam.mml <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
formulaY=NULL, dataY=NULL,
Expand Down Expand Up @@ -81,9 +81,6 @@ tam.mml <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
}

nitems <- ncol(resp) # number of items
if (is.null(colnames(resp))){
colnames(resp) <- paste0( "I", 100+1:nitems )
}
nstud <- nrow(resp) # number of students
#*****
nstud1 <- sum(1*( rowSums( 1 - is.na(resp) ) > 0 ))
Expand Down Expand Up @@ -532,7 +529,7 @@ tam.mml <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
"iter"=iter,
"printxsi"=printxsi,
"YSD"=YSD, CALL=CALL, latreg_stand=latreg_stand,
prior_list_xsi=prior_list_xsi, penalty_xsi=penalty_xsi )
prior_list_xsi=prior_list_xsi, penalty_xsi=penalty_xsi)
class(res) <- "tam.mml"
return(res)
}
Expand Down
13 changes: 6 additions & 7 deletions R/tam_calc_posterior.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
## File Name: tam_calc_posterior.R
## File Version: 9.20
## File Version: 9.218



###########################################################
tam_calc_posterior <- function(rprobs, gwt, resp, nitems,
resp.ind.list, normalization=TRUE,
thetasamp.density=NULL, snodes=0, resp.ind=NULL,
avoid.zerosum=FALSE, logprobs=FALSE )
{
a0 <- Sys.time()
fx <- gwt
tsd <- NULL
# calculate individual 'sampling weight'
Expand All @@ -23,9 +22,8 @@ tam_calc_posterior <- function(rprobs, gwt, resp, nitems,
nstud <- nrow(fx)
storage.mode(resp) <- "integer"
fx0 <- fx
#cat("start calcfx") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
fx <- .Call('_TAM_calcfx', PACKAGE='TAM', fx, rprobs, resp.ind.list, resp)
# cat("nach calcfx") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1

if (avoid.zerosum ){
fxs <- rowSums( fx )
m1 <- max( min( fxs[ fxs > 0 ], na.rm=TRUE), 1E-200 ) / 1E3 / ncol(fx)
Expand All @@ -42,17 +40,18 @@ tam_calc_posterior <- function(rprobs, gwt, resp, nitems,
} else {
hwt <- fx
}
res <- list("hwt"=hwt, "rfx"=rfx )
# cat("nach normalization") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
res <- list(hwt=hwt, rfx=rfx )
res$fx1 <- fx / gwt
if ( snodes > 0 ){
res[["swt" ]] <- fx
res$gwt <- gwt
}
res$tsd <- tsd
# cat("before output") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
#--- output
return(res)
}
#####################################################################

calc_posterior.v2 <- tam_calc_posterior

Expand Down
17 changes: 15 additions & 2 deletions R/tam_mml_person_posterior.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: tam_mml_person_posterior.R
## File Version: 0.12
## File Version: 0.15

tam_mml_person_posterior <- function(pid, nstud, pweights,
resp, resp.ind, snodes, hwtE, hwt, ndim, theta )
Expand Down Expand Up @@ -32,7 +32,20 @@ tam_mml_person_posterior <- function(pid, nstud, pweights,
colnames(person)[ which( cnp=="SD.EAP" ) ] <- paste("SD.EAP.Dim", dd, sep="")
}
}

#*** means and standard deviations of posterior distributions
SD <- M <- rep(NA, ndim)
post <- hwtE
n <- nrow(post)
for (dd in 1L:ndim){
theta_dim <- theta[,dd]
mt <- matrix( theta_dim, nrow=n, ncol=length(theta_dim), byrow=TRUE)
M[dd] <- sum( mt*post*pweights ) / sum(pweights)
M2 <- sum( mt^2*post*pweights ) / sum(pweights)
SD[dd] <- sqrt( M2 - M[dd]^2 )
}

#----- OUTPUT
res <- list( person=person, EAP.rel=EAP.rel )
res <- list( person=person, EAP.rel=EAP.rel, M_post=M, SD_post=SD )
return(res)
}
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
If you use `TAM` and have suggestions for improvement or have found bugs, please email me at [email protected].
Please always provide a minimal dataset, necessary to demonstrate the problem,
a minimal runnable code necessary to reproduce the issue, which can be run on the given dataset, and
all necessary information on the used librarys, the R version, and the OS it is run on, perhaps a sessionInfo().
all necessary information on the used librarys, the R version, and the OS it is run on, perhaps a ``sessionInfo()``.

#### Manual

The manual may be found here [https://alexanderrobitzsch.github.io/TAM/](https://alexanderrobitzsch.github.io/TAM/)

#### CRAN version `TAM` 4.1-4 (2022-08-28)

Expand All @@ -24,13 +21,18 @@ The CRAN version can be installed from within R using:
utils::install.packages("TAM")
```

#### GitHub version `TAM` 4.2-1 (2022-08-29)
#### GitHub version `TAM` 4.2-11 (2023-08-28)

[![](https://img.shields.io/badge/github%20version-4.2--1-orange.svg)](https://github.com/alexanderrobitzsch/TAM)&#160;&#160;
[![](https://img.shields.io/badge/github%20version-4.2--11-orange.svg)](https://github.com/alexanderrobitzsch/TAM)&#160;&#160;

The version hosted [here](https://github.com/alexanderrobitzsch/TAM) is the development version of `TAM`.
The GitHub version can be installed using `devtools` as:
The GitHub version can be installed using `devtools` as

```r
devtools::install_github("alexanderrobitzsch/TAM")
```
or alternatively use

```r
utils::install.packages('TAM', repos = c('https://alexanderrobitzsch.r-universe.dev', 'https://cloud.r-project.org'))
```
2 changes: 1 addition & 1 deletion docs/404.html

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

10 changes: 5 additions & 5 deletions docs/authors.html

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

2 changes: 1 addition & 1 deletion docs/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pandoc: 1.13.1
pkgdown: 1.5.1
pkgdown_sha: ~
articles: []
last_built: 2022-08-29T09:18Z
last_built: 2023-01-25T12:12Z

2 changes: 1 addition & 1 deletion docs/reference/IRT.drawPV.html

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

2 changes: 1 addition & 1 deletion docs/reference/IRT.itemfit.html

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

2 changes: 1 addition & 1 deletion docs/reference/IRT.truescore.html

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

Loading

0 comments on commit b74dcfb

Please sign in to comment.