% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fit.correct.R
\name{fit.correct}
\alias{fit.correct}
\title{Correct degree of freedom and fit indices in Thurstonian block models}
\usage{
fit.correct(n, blocks, chi2_mod, df_mod, chi2_base, df_base)
}
\arguments{
\item{n}{The number of respondents.}

\item{blocks}{A matrix defining the blocks of the model. The number of rows
must be the number of blocks, each row represents a block and contains the
item numbers. The number of columns present the number of items per block.}

\item{chi2_mod}{The \eqn{\chi^2}{chi^2} value of the estimated model.}

\item{df_mod}{The degrees of freedom of the estimated model.}

\item{chi2_base}{The \eqn{\chi^2}{chi^2} value of the baseline model.}

\item{df_base}{The degrees of freedom of the baseline model.}
}
\value{
Returns a vector containing corrected degrees of freedom, and the
corrected RMSEA and CFI values.
}
\description{
Correct fit indices (RMSEA and CFI) by correcting the degrees of freedom
after estimation a Thurstonian model.
}
\details{
If a ranking design is used (variances of binary indicators is zero)
there are redundancies among the thresholds and tetrachoric correlations to 
be estimated. This is the case, whenever the number of items per block is 
larger than two. In these cases the degrees of freedom must be corrected by
subtracting the redundancies. For more details see Jansen and Schulze (2023)
and Maydeu-Olivares (1999).
}
\examples{

# Define 30 items divided by ten triplets as blocks
blocks <- matrix(c(1:30), ncol = 3)

# Assume the model yield the following fit, with 426 respondents
# chi2_mod = 224.456, df_mod = 59, chi2_base = 1056.566, df_base = 90

fit.correct(426,blocks,224.456,59,1056.566,90)

# The corrected values are rmsea = 0.0917892; cfi =  0.8184749

}
\references{
Jansen, M. T., & Schulze, R. (in review). \emph{The Thurstonian linked block design: Improving Thurstonian modeling for paired comparison and ranking data}.

Maydeu-Olivares, A. (1999). Thurstonian modeling of ranking data via mean and covariance structure analysis. \emph{Psychometrika}, \emph{64}(3), 325-340. \doi{10.1007/BF02294299}
}
