Skip to content

Commit

Permalink
3.7-5
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderrobitzsch committed May 16, 2021
1 parent 62cbee2 commit dd5d8bd
Show file tree
Hide file tree
Showing 22 changed files with 88 additions and 32 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: 3.7-3
Date: 2021-04-30 12:08:26
Version: 3.7-5
Date: 2021-05-16 13:48:06
Author:
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>),
Thomas Kiefer [aut],
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export(tam_matrix2)
export(tam_max_abs)
export(tam_max_abs_list)
export(tam_mml_se_quick)
export(tam_model_implied_means)
export(tam_NA_pattern)
export(tam_normalize_matrix_rows)
export(tam_normalize_vector)
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: 3.007003
## File Version: 3.007005
# 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.mml.2pl.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: tam.mml.2pl.R
## File Version: 9.586
## File Version: 9.588

tam.mml.2pl <- function( resp, Y=NULL, group=NULL, irtmodel="2PL",
formulaY=NULL, dataY=NULL,
Expand Down Expand Up @@ -338,7 +338,7 @@ tam.mml.2pl <- function( resp, Y=NULL, group=NULL, irtmodel="2PL",
# cat("m step regression") ; a1 <- Sys.time(); print(a1-a0) ; a0 <- a1

beta <- resr$beta
variance <- resr$variance
variance <- resr$variance
itemwt <- resr$itemwt
variance_acceleration <- resr$variance_acceleration
variance_change <- resr$variance_change
Expand Down Expand Up @@ -471,7 +471,7 @@ tam.mml.2pl <- function( resp, Y=NULL, group=NULL, irtmodel="2PL",

#*** collect item parameters
item1 <- tam_itempartable( resp=resp, maxK=maxK, AXsi=AXsi, B=B, ndim=ndim,
resp.ind=resp.ind, rprobs=rprobs, n.ik=n.ik, pi.k=pi.k )
resp.ind=resp.ind, rprobs=rprobs, n.ik=n.ik, pi.k=pi.k, pweights=pweights)

#*** IRT parameterization
item_irt <- tam_irt_parameterization(resp=resp, maxK=maxK, B=B, AXsi=AXsi,
Expand Down
5 changes: 3 additions & 2 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.803
## File Version: 9.804

tam.mml <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
formulaY=NULL, dataY=NULL,
Expand Down Expand Up @@ -425,7 +425,8 @@ tam.mml <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",

#*** collect item parameters
item1 <- tam_itempartable( resp=resp, maxK=maxK, AXsi=AXsi, B=B, ndim=ndim,
resp.ind=resp.ind, rprobs=rprobs, n.ik=n.ik, pi.k=pi.k )
resp.ind=resp.ind, rprobs=rprobs, n.ik=n.ik, pi.k=pi.k,
pweights=pweights)

#*** IRT parameterization
item_irt <- tam_irt_parameterization(resp=resp, maxK=maxK, B=B, AXsi=AXsi,
Expand Down
4 changes: 2 additions & 2 deletions R/tam.mml.mfr.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: tam.mml.mfr.R
## File Version: 9.943
## File Version: 9.944

tam.mml.mfr <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
formulaY=NULL, dataY=NULL, ndim=1, pid=NULL, xsi.fixed=NULL,
Expand Down Expand Up @@ -480,7 +480,7 @@ tam.mml.mfr <- function( resp, Y=NULL, group=NULL, irtmodel="1PL",
#--- collect item parameters
item1 <- tam_itempartable( resp=gresp.noStep, maxK=maxK, AXsi=AXsi, B=B,
ndim=ndim, resp.ind=gresp.noStep.ind,
rprobs=rprobs, n.ik=n.ik, pi.k=pi.k, order=TRUE )
rprobs=rprobs, n.ik=n.ik, pi.k=pi.k, order=TRUE, pweights=pweights )

#--- collect all person statistics
res <- tam_mml_person_posterior( pid=pid, nstud=nstud, pweights=pweights,
Expand Down
5 changes: 3 additions & 2 deletions R/tam.mml.wle.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: tam.mml.wle.R
## File Version: 0.26
## File Version: 0.271


tam.mml.wle <- function( tamobj, score.resp=NULL, WLE=TRUE, adj=.3, Msteps=20,
Expand All @@ -19,7 +19,8 @@ tam.mml.wle <- function( tamobj, score.resp=NULL, WLE=TRUE, adj=.3, Msteps=20,
maxK <- res$maxK
pweights <- res$pweights
pid <- res$pid

pweights <- tam_mml_wle_pweights(score.resp=score.resp, pweights=pweights)

#--- initial values and some design matrices
res <- tam_mml_wle_theta_inits( WLE=WLE, adj=adj, nitems=nitems, maxK=maxK,
resp=resp, resp.ind=resp.ind, B=B, ndim=ndim )
Expand Down
3 changes: 2 additions & 1 deletion R/tam.mml.wle2.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## File Name: tam.mml.wle2.R
## File Version: 0.851
## File Version: 0.853

################################################################
tam.mml.wle2 <- function( tamobj, score.resp=NULL, WLE=TRUE, adj=.3, Msteps=20,
Expand All @@ -24,6 +24,7 @@ tam.mml.wle2 <- function( tamobj, score.resp=NULL, WLE=TRUE, adj=.3, Msteps=20,
pid <- rep(NA, nrow(score.resp) )
}
}
pweights <- tam_mml_wle_pweights(score.resp=score.resp, pweights=pweights)

A <- res$A
xsi <- res$xsi
Expand Down
9 changes: 5 additions & 4 deletions R/tam_itempartable.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
## File Name: tam_itempartable.R
## File Version: 9.131
## File Version: 9.133



#--- create table of item parameters
tam_itempartable <- function( resp, maxK, AXsi, B, ndim,
resp.ind, rprobs=NULL, n.ik=NULL, pi.k=NULL, order=FALSE )
resp.ind, rprobs=NULL, n.ik=NULL, pi.k=NULL, order=FALSE,
pweights=rep(1,nrow(resp) ) )
{

if ( is.null(dimnames(B)[[1]] ) ){
dimnames(B)[[1]] <- colnames(resp)
}

item1 <- data.frame( "item"=dimnames(B)[[1]] )
item1$N <- colSums(resp.ind)
item1$M <- colSums(resp.ind * resp, na.rm=TRUE) / colSums( resp.ind )
item1$N <- colSums(resp.ind*pweights)
item1$M <- colSums(resp.ind * resp * pweights, na.rm=TRUE) / colSums( resp.ind*pweights )
maxKi <- rowSums( 1 - is.na(AXsi) ) - 1
I <- nrow(item1)
item1$xsi.item <- - AXsi[ cbind(1:I, maxKi+1) ] / maxKi
Expand Down
10 changes: 10 additions & 0 deletions R/tam_mml_wle_pweights.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## File Name: tam_mml_wle_pweights.R
## File Version: 0.01

tam_mml_wle_pweights <- function(score.resp, pweights)
{
if (!is.null(score.resp)){
pweights <- rep(1,nrow(score.resp))
}
return(pweights)
}
28 changes: 28 additions & 0 deletions R/tam_model_implied_means.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## File Name: tam_model_implied_means.R
## File Version: 0.01


tam_model_implied_means <- function(mod)
{
hwt <- mod$hwt
pweights <- mod$pweights
rprobs <- mod$rprobs
resp <- mod$resp
I <- dim(rprobs)[1]
K <- dim(rprobs)[2]
TP <- dim(rprobs)[3]
M_implied <- rep(0,I)
names(M_implied) <- colnames(resp)
N <- nrow(hwt)
W <- sum(pweights)

for (ii in 1:I){
for (uu in 2:K){
rpr <- matrix( rprobs[ii,uu,], nrow=N, ncol=TP, byrow=TRUE)
M_implied[ii] <- M_implied[ii] + sum( rpr*(uu-1)*pweights*hwt, na.rm=TRUE)
}
M_implied[ii] <- M_implied[ii] / W
}
return(M_implied)
}

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ The CRAN version can be installed from within R using:
utils::install.packages("TAM")
```

#### GitHub version `TAM` 3.7-3 (2021-04-30)
#### GitHub version `TAM` 3.7-5 (2021-05-16)

[![](https://img.shields.io/badge/github%20version-3.7--3-orange.svg)](https://github.com/alexanderrobitzsch/TAM)&#160;&#160;
[![](https://img.shields.io/badge/github%20version-3.7--5-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:
Expand Down
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.

8 changes: 4 additions & 4 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: 2021-04-30T10:24Z
last_built: 2021-05-16T12:09Z

6 changes: 6 additions & 0 deletions docs/reference/TAM-utilities.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/index.html

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

6 changes: 5 additions & 1 deletion inst/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ http://www.edmeasurementsurveys.com/TAM/Tutorials/


-------------------------------------------------------------
VERSIONS TAM 3.7 | 2021-04-30 | Last: TAM 3.7-3
VERSIONS TAM 3.7 | 2021-05-16 | Last: TAM 3.7-5
-------------------------------------------------------------

NOTE * changed computation of AXsi and xsi.item in outputs to
prevent numerical differences with xsi
(thanks to Rudolf Debelak)
NOTE * included utility function tam_model_implied_means() for
computation of model-implied means
FIXED * fixed a bug in tam.mml.wle() and tam.mml.wle2() if argument
'score.resp' is used (thanks to Fu Liu)


DATA * included/modified datasets: ---
Expand Down
7 changes: 5 additions & 2 deletions man/TAM-utilities.Rd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%% File Name: TAM-utilities.Rd
%% File Version: 0.663
%% File Version: 0.666

\name{TAM-utilities}
\alias{TAM-utilities}
Expand Down Expand Up @@ -35,7 +35,7 @@
\alias{tam_max_abs}
\alias{tam_max_abs_list}
\alias{IRT.RISE}

\alias{tam_model_implied_means}

\title{Utility Functions in \pkg{TAM}}

Expand All @@ -46,6 +46,8 @@ Utility functions in \pkg{TAM}.
\usage{
## RISE item fit statistic of two models
IRT.RISE( mod_p, mod_np, use_probs=TRUE )
## model-implied means
tam_model_implied_means(mod)

## information about used package version
tam_packageinfo(pack)
Expand Down Expand Up @@ -118,6 +120,7 @@ tam_assign_list_elements(x, envir)
\arguments{
\item{mod_p}{Fitted model}
\item{mod_np}{Fitted model}
\item{mod}{Fitted model}
\item{use_probs}{Logical}
\item{pack}{An \R package}
\item{CALL}{An \R call}
Expand Down
2 changes: 1 addition & 1 deletion src/RcppExports.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//// File Name: RcppExports.cpp
//// File Version: 3.007003
//// File Version: 3.007005
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

Expand Down
2 changes: 1 addition & 1 deletion src/init.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//// File Name: init.c
//// File Version: 3.007003
//// File Version: 3.007005
#include <R.h>
#include <Rinternals.h>
#include <stdlib.h> // for NULL
Expand Down

0 comments on commit dd5d8bd

Please sign in to comment.