From 3da6ad689c02e0ac450a2989917b2aa3e096b08c Mon Sep 17 00:00:00 2001 From: corentinchoisy Date: Wed, 28 May 2025 16:01:58 +0200 Subject: [PATCH] renamed res_ij to resi --- NAMESPACE | 2 +- R/pcbm.R | 2 +- R/pcbsm.R | 2 +- R/pcm.R | 2 +- R/{res_ij.R => resi.R} | 4 ++-- man/{res_ij.Rd => resi.Rd} | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) rename R/{res_ij.R => resi.R} (92%) rename man/{res_ij.Rd => resi.Rd} (82%) diff --git a/NAMESPACE b/NAMESPACE index 4fae426..767f442 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,7 +5,7 @@ export(iptw) export(pcbm) export(pcbsm) export(pcm) -export(res_ij) +export(resi) export(residif) export(select_weight) import(PP) diff --git a/R/pcbm.R b/R/pcbm.R index c583350..e25a59e 100644 --- a/R/pcbm.R +++ b/R/pcbm.R @@ -238,7 +238,7 @@ pcbm <- function(df=NULL,items=NULL,grp=NULL,X=NULL,dif.items=NULL,type.dif=NULL } else if (method.theta=="mle") { theta <- PP::PP_gpcm(as.matrix(df[,items]),t(restab),rep(1,length(items)),type="mle")$resPP$resPP[,1] } - resid <- apply(matrix(1:nbitems,ncol=length(nbitems)),1, function(k) sapply(1:nrow(df), function(j) res_ij(theta[j],restab[k,],df[j,items[k]],beta=0))) + resid <- apply(matrix(1:nbitems,ncol=length(nbitems)),1, function(k) sapply(1:nrow(df), function(j) resi(theta[j],restab[k,],df[j,items[k]],beta=0))) colnames(resid) <- items_o ##### Output diff --git a/R/pcbsm.R b/R/pcbsm.R index 217cc35..e72fc56 100644 --- a/R/pcbsm.R +++ b/R/pcbsm.R @@ -250,7 +250,7 @@ pcbsm <- function(df=NULL,items=NULL,grp=NULL,u=NULL,X=NULL,dif.items=NULL,type. } else if (method.theta=="mle") { theta <- PP::PP_gpcm(as.matrix(df[,items]),t(restab),rep(1,length(items)),type="mle")$resPP$resPP[,1] } - resid <- apply(matrix(1:nbitems,ncol=length(nbitems)),1, function(k) sapply(1:nrow(df), function(j) res_ij(theta[j],restab[k,],df[j,items[k]],beta=0))) + resid <- apply(matrix(1:nbitems,ncol=length(nbitems)),1, function(k) sapply(1:nrow(df), function(j) resi(theta[j],restab[k,],df[j,items[k]],beta=0))) colnames(resid) <- items_o ##### Output diff --git a/R/pcm.R b/R/pcm.R index 07b286c..b6c7ea2 100644 --- a/R/pcm.R +++ b/R/pcm.R @@ -274,7 +274,7 @@ pcm <- function(df=NULL,items=NULL,grp=NULL,dif.items=NULL,type.dif=NULL,weights } else if (method.theta=="mle") { theta <- PP::PP_gpcm(as.matrix(df[,items]),t(restab),rep(1,length(items)),type="mle")$resPP$resPP[,1] } - resid <- apply(matrix(1:nbitems,ncol=length(nbitems)),1, function(k) sapply(1:nrow(df), function(j) res_ij(theta[j],restab[k,],df[j,items[k]],beta=0))) + resid <- apply(matrix(1:nbitems,ncol=length(nbitems)),1, function(k) sapply(1:nrow(df), function(j) resi(theta[j],restab[k,],df[j,items[k]],beta=0))) colnames(resid) <- items_o ##### Output diff --git a/R/res_ij.R b/R/resi.R similarity index 92% rename from R/res_ij.R rename to R/resi.R index 67e6a64..2b00323 100644 --- a/R/res_ij.R +++ b/R/resi.R @@ -1,4 +1,4 @@ -## File Name: res_ij.R +## File Name: resi.R ## File version: 1.0 #' Compute rasch person-item residuals @@ -14,7 +14,7 @@ #' @import vcrpart #' @export -res_ij <- function(thetahat_i,delta_hat_j,res,beta=0){ +resi <- function(thetahat_i,delta_hat_j,res,beta=0){ var=0 denomin=1 for (i in 1:length(delta_hat_j)) { diff --git a/man/res_ij.Rd b/man/resi.Rd similarity index 82% rename from man/res_ij.Rd rename to man/resi.Rd index 15f6f1a..4f506f2 100644 --- a/man/res_ij.Rd +++ b/man/resi.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/res_ij.R -\name{res_ij} -\alias{res_ij} +% Please edit documentation in R/resi.R +\name{resi} +\alias{resi} \title{Compute rasch person-item residuals} \usage{ -res_ij(thetahat_i, delta_hat_j, res, beta = 0) +resi(thetahat_i, delta_hat_j, res, beta = 0) } \arguments{ \item{thetahat_i}{Person parameter estimate for person i}