first commit

This commit is contained in:
2025-04-29 17:59:26 +02:00
commit 30dc985ae3
15 changed files with 1718 additions and 0 deletions

36
man/bpcm.Rd Normal file
View File

@ -0,0 +1,36 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bpcm.R
\name{bpcm}
\alias{bpcm}
\title{Compute Bayesian Partial Credit Model (BPCM) for polytomous and dichotomous items}
\usage{
bpcm(
df = NULL,
grp = NULL,
is.dif = NULL,
is.unif = NULL,
priors = NULL,
param = list(),
verbose = T,
diag.plots = F
)
}
\arguments{
\item{df}{data.frame containing the response data}
\item{grp}{vector containing the column where an optional group membership variable is stored in df}
\item{is.dif}{indicator vector containing 1 at the inded of each DIF item in df and 0 otherwise}
\item{is.unif}{indicator vector containing 1 at the inded of each uniform DIF item in df and 0 otherwise}
\item{diag.plots}{boolean indicating whether the JAGS diagnosis plots should be displayed}
\item{prior}{prior function to be used}
}
\value{
A data.frame containing various model outputs
}
\description{
This function computes a bayesian PCM, potentially accounting for DIF on specified items
}

33
man/pcm.Rd Normal file
View File

@ -0,0 +1,33 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pcm.R
\name{pcm}
\alias{pcm}
\title{Compute Partial Credit Model (PCM) for polytomous and dichotomous items}
\usage{
pcm(
df = NULL,
items = NULL,
grp = NULL,
dif.items = NULL,
type.dif = NULL,
verbose = T,
fit = "ucminf"
)
}
\arguments{
\item{df}{data.frame containing the data}
\item{items}{vector containing the names of columns where item responses are stored in df}
\item{grp}{string containing the name of the column where an optional group membership variable is stored in df}
\item{dif.items}{vector containing the list of indexes in "items" corresponding to dif items}
\item{type.dif}{vector containing DIF form for each item specified in dif.items. 1 is homogeneous DIF, 0 is heterogeneous DIF}
}
\value{
A data.frame containing various model outputs
}
\description{
This function computes a frequentist PCM, potentially accounting for DIF on specified items
}

24
man/res_ij.Rd Normal file
View File

@ -0,0 +1,24 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/res_ij.R
\name{res_ij}
\alias{res_ij}
\title{Compute rasch person-item residuals}
\usage{
res_ij(thetahat_i, delta_hat_j, res, beta = 0)
}
\arguments{
\item{thetahat_i}{Person parameter estimate for person i}
\item{delta_hat_j}{Item threshold parameter estimates for item j}
\item{res}{Response of person i to item j}
\item{beta}{Estimated latent mean difference between groups, can be ignored}
}
\value{
A single scalar equal to the residual for person i on item j
}
\description{
This function computes person-item residuals for rasch family adjacent-categories models
like the Rasch model or the PCM
}

21
man/residif.Rd Normal file
View File

@ -0,0 +1,21 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/residif.R
\name{residif}
\alias{residif}
\title{RESIDIF procedure for DIF detection as per Andrich and Hagquist (2015)}
\usage{
residif(df = NULL, items = NULL, grp = NULL, verbose = T)
}
\arguments{
\item{df}{data.frame containing the data}
\item{items}{vector containing the names of columns where item responses are stored in df}
\item{grp}{vector containing the name of the column where an optional group membership variable is stored in df}
}
\value{
A data.frame containing a column listing the detected DIF item and another listing detected DIF forms
}
\description{
This function detects DIF on PCM items using ANOVA of person-item residuals
}