% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gen_test_score_CTT.R
\name{gen_test_score_CTT}
\alias{gen_test_score_CTT}
\title{Generating Test Score Distribution according to Classical Test Theory}
\usage{
gen_test_score_CTT(
  n,
  minscore = NULL,
  maxscore = NULL,
  rho0 = 0.9,
  meanX0 = NULL,
  varX0 = 15^2,
  beta = NULL,
  orth = 0,
  discrete = 1,
  seed = NULL,
  print = 0,
  plot = 0,
  title = NULL
)
}
\arguments{
\item{n}{# of observations.}

\item{minscore}{The minimum score.}

\item{maxscore}{The maximum score.}

\item{meanX0}{The mean of observed test score}

\item{varX0}{The variance of observed test score}

\item{beta}{Vector of alpha and beta parameters for beta distribution
in [minscore,maxscore].}

\item{orth}{= 1 to orthogonalize T and E. (not yet available.)}

\item{discrete}{= 0 to use continuous random variables}

\item{seed}{The random number seed or NULL}

\item{print}{= 1 to print the result.}

\item{plot}{= 1 to plot the result.}

\item{title}{Title string to be used in plot.}

\item{rho}{The reliability coefficient}
}
\value{
A list of: \cr
rho The actual reliability \cr
meanX The actual mean of X \cr
stdX The actual standard deviation of X \cr
meanT The actual mean of T \cr
stdT The actual standard deviation of T \cr
meanE The actual mean of E \cr
stdE The actual standard deviation of E \cr
cor The correlation matrix of (X,T,E) \cr
XTE A matrix consisting of \code{X,T,E}. (n times 3 matrix) \cr
scoredist Score distribution of X \cr
}
\description{
This function generates a frequency distribution table
 of n discrete test scores in [minscore,maxscore].
}
\details{
This function generates a set of \cr
 (observed score X, true score T, error score E) \cr
of size n in [minscore <= X <= maxscore] according to
the Classical Test Theory.

Continuous random numbers, either normal or generalized beta,
are first generated and then they are discretized by cut function.
Those values outside of [minscore,maxscore] will be set to minscore
or maxscore, resp.

beta parameter has priority over nomal parameter.
}
\examples{


res=gen_test_score_CTT(n=10000, varX0=17^2, rho=0.60, seed=1701
                  , plot=1, print=1, minscore=0, maxscore=100)
seed=1701; set.seed(seed)
res=gen_test_score_CTT(n=10000, varX0=17^2, rho=0.60
                  , plot=1, print=1, minscore=0, maxscore=100)

res=gen_test_score_CTT(n=10000, varX=18^2, rho=0.80, beta=c(5,2)
                  , plot=1, print=1, minscore=0, maxscore=100, seed=1701)
res=gen_test_score_CTT(n=10000, meanX0=60, varX=18^2, rho=0.80, beta=c(5,2)
                  , plot=1, print=1, minscore=0, maxscore=100, seed=1701)

}
