gen_test_score_CTT {lazy.tools}R Documentation

Generating Test Score Distribution according to Classical Test Theory

Description

This function generates a frequency distribution table of n discrete test scores in [minscore,maxscore].

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

n

# of observations.

minscore

The minimum score.

maxscore

The maximum score.

meanX0

The mean of observed test score

varX0

The variance of observed test score

beta

Vector of alpha and beta parameters for beta distribution in [minscore,maxscore].

orth

= 1 to orthogonalize T and E. (not yet available.)

discrete

= 0 to use continuous random variables

seed

The random number seed or NULL

print

= 1 to print the result.

plot

= 1 to plot the result.

title

Title string to be used in plot.

rho

The reliability coefficient

Details

This function generates a set of
(observed score X, true score T, error score E)
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.

Value

A list of:
rho The actual reliability
meanX The actual mean of X
stdX The actual standard deviation of X
meanT The actual mean of T
stdT The actual standard deviation of T
meanE The actual mean of E
stdE The actual standard deviation of E
cor The correlation matrix of (X,T,E)
XTE A matrix consisting of X,T,E. (n times 3 matrix)
scoredist Score distribution of X

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)


[Package lazy.tools version 0.1.6 ]