Skip to content

Commit b74dcfb

Browse files
4.2-11
1 parent 7fd7423 commit b74dcfb

30 files changed

+104
-83
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: TAM
22
Type: Package
33
Title: Test Analysis Modules
4-
Version: 4.2-1
5-
Date: 2022-08-29 11:02:47
4+
Version: 4.2-11
5+
Date: 2023-08-28 17:23:17.934842
66
Author:
77
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>),
88
Thomas Kiefer [aut],

R/RcppExports.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## File Name: RcppExports.R
2-
## File Version: 4.002001
2+
## File Version: 4.002011
33
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
44
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
55

R/tam.fa.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## File Name: tam.fa.R
2-
## File Version: 9.258
2+
## File Version: 9.261
33

44

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

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

R/tam.latreg.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## File Name: tam.latreg.R
2-
## File Version: 9.341
2+
## File Version: 9.343
33

44
###################################################################
55
# latent regression
@@ -244,6 +244,8 @@ tam.latreg <- function( like, theta=NULL, Y=NULL, group=NULL,
244244
hwtE=hwt, hwt=hwt, ndim=ndim, theta=theta )
245245
person <- res$person
246246
EAP.rel <- res$EAP.rel
247+
M_post <- res$M_post
248+
SD_post <- res$SD_post
247249

248250
#cat("person parameters") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
249251
############################################################
@@ -288,7 +290,7 @@ tam.latreg <- function( like, theta=NULL, Y=NULL, group=NULL,
288290
deviance.history <- deviance.history[ 1:iter, ]
289291
res <- list( "beta"=beta, "variance"=variance,
290292
"person"=person, pid=pid, "EAP.rel"=EAP.rel,
291-
"post"=hwt, "theta"=theta,
293+
"post"=hwt, M_post=M_post, SD_post=SD_post, "theta"=theta,
292294
"Y"=Y, "group"=group,
293295
"G"=if ( is.null(group)){1} else { length(unique( group ) )},
294296
"groups"=if ( is.null(group)){1} else { groups },
@@ -303,7 +305,7 @@ tam.latreg <- function( like, theta=NULL, Y=NULL, group=NULL,
303305
"nnodes"=nnodes, "deviance"=deviance,
304306
"ic"=ic, thetasamp.density=thetasamp.density,
305307
"deviance.history"=deviance.history,
306-
"control"=con1a, "iter"=iter,
308+
"control"=con1a, "iter"=iter,
307309
"YSD"=YSD, CALL=CALL, latreg_stand=latreg_stand )
308310
class(res) <- "tam.latreg"
309311
return(res)

R/tam.mml.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## File Name: tam.mml.R
2-
## File Version: 9.804
2+
## File Version: 9.863
33

44
tam.mml <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
55
formulaY=NULL, dataY=NULL,
@@ -81,9 +81,6 @@ tam.mml <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
8181
}
8282

8383
nitems <- ncol(resp) # number of items
84-
if (is.null(colnames(resp))){
85-
colnames(resp) <- paste0( "I", 100+1:nitems )
86-
}
8784
nstud <- nrow(resp) # number of students
8885
#*****
8986
nstud1 <- sum(1*( rowSums( 1 - is.na(resp) ) > 0 ))
@@ -532,7 +529,7 @@ tam.mml <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
532529
"iter"=iter,
533530
"printxsi"=printxsi,
534531
"YSD"=YSD, CALL=CALL, latreg_stand=latreg_stand,
535-
prior_list_xsi=prior_list_xsi, penalty_xsi=penalty_xsi )
532+
prior_list_xsi=prior_list_xsi, penalty_xsi=penalty_xsi)
536533
class(res) <- "tam.mml"
537534
return(res)
538535
}

R/tam_calc_posterior.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
## File Name: tam_calc_posterior.R
2-
## File Version: 9.20
2+
## File Version: 9.218
33

44

5-
6-
###########################################################
75
tam_calc_posterior <- function(rprobs, gwt, resp, nitems,
86
resp.ind.list, normalization=TRUE,
97
thetasamp.density=NULL, snodes=0, resp.ind=NULL,
108
avoid.zerosum=FALSE, logprobs=FALSE )
119
{
10+
a0 <- Sys.time()
1211
fx <- gwt
1312
tsd <- NULL
1413
# calculate individual 'sampling weight'
@@ -23,9 +22,8 @@ tam_calc_posterior <- function(rprobs, gwt, resp, nitems,
2322
nstud <- nrow(fx)
2423
storage.mode(resp) <- "integer"
2524
fx0 <- fx
25+
#cat("start calcfx") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
2626
fx <- .Call('_TAM_calcfx', PACKAGE='TAM', fx, rprobs, resp.ind.list, resp)
27-
# cat("nach calcfx") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
28-
2927
if (avoid.zerosum ){
3028
fxs <- rowSums( fx )
3129
m1 <- max( min( fxs[ fxs > 0 ], na.rm=TRUE), 1E-200 ) / 1E3 / ncol(fx)
@@ -42,17 +40,18 @@ tam_calc_posterior <- function(rprobs, gwt, resp, nitems,
4240
} else {
4341
hwt <- fx
4442
}
45-
res <- list("hwt"=hwt, "rfx"=rfx )
43+
# cat("nach normalization") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
44+
res <- list(hwt=hwt, rfx=rfx )
4645
res$fx1 <- fx / gwt
4746
if ( snodes > 0 ){
4847
res[["swt" ]] <- fx
4948
res$gwt <- gwt
5049
}
5150
res$tsd <- tsd
51+
# cat("before output") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1
5252
#--- output
5353
return(res)
5454
}
55-
#####################################################################
5655

5756
calc_posterior.v2 <- tam_calc_posterior
5857

R/tam_mml_person_posterior.R

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## File Name: tam_mml_person_posterior.R
2-
## File Version: 0.12
2+
## File Version: 0.15
33

44
tam_mml_person_posterior <- function(pid, nstud, pweights,
55
resp, resp.ind, snodes, hwtE, hwt, ndim, theta )
@@ -32,7 +32,20 @@ tam_mml_person_posterior <- function(pid, nstud, pweights,
3232
colnames(person)[ which( cnp=="SD.EAP" ) ] <- paste("SD.EAP.Dim", dd, sep="")
3333
}
3434
}
35+
36+
#*** means and standard deviations of posterior distributions
37+
SD <- M <- rep(NA, ndim)
38+
post <- hwtE
39+
n <- nrow(post)
40+
for (dd in 1L:ndim){
41+
theta_dim <- theta[,dd]
42+
mt <- matrix( theta_dim, nrow=n, ncol=length(theta_dim), byrow=TRUE)
43+
M[dd] <- sum( mt*post*pweights ) / sum(pweights)
44+
M2 <- sum( mt^2*post*pweights ) / sum(pweights)
45+
SD[dd] <- sqrt( M2 - M[dd]^2 )
46+
}
47+
3548
#----- OUTPUT
36-
res <- list( person=person, EAP.rel=EAP.rel )
49+
res <- list( person=person, EAP.rel=EAP.rel, M_post=M, SD_post=SD )
3750
return(res)
3851
}

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
If you use `TAM` and have suggestions for improvement or have found bugs, please email me at robitzsch@leibniz-ipn.de.
55
Please always provide a minimal dataset, necessary to demonstrate the problem,
66
a minimal runnable code necessary to reproduce the issue, which can be run on the given dataset, and
7-
all necessary information on the used librarys, the R version, and the OS it is run on, perhaps a sessionInfo().
7+
all necessary information on the used librarys, the R version, and the OS it is run on, perhaps a ``sessionInfo()``.
88

9-
#### Manual
10-
11-
The manual may be found here [https://alexanderrobitzsch.github.io/TAM/](https://alexanderrobitzsch.github.io/TAM/)
129

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

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

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

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

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

3431
```r
3532
devtools::install_github("alexanderrobitzsch/TAM")
3633
```
34+
or alternatively use
35+
36+
```r
37+
utils::install.packages('TAM', repos = c('https://alexanderrobitzsch.r-universe.dev', 'https://cloud.r-project.org'))
38+
```

docs/404.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/authors.html

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)