Learn R Programming

dexter (version 0.8.5)

ability: Estimate abilities

Description

Computes estimates of ability for persons or booklets

Usage

ability(dataSrc, parms, predicate = NULL, method = c("MLE", "EAP"),
  prior = c("normal", "Jeffreys"), use_draw = NULL, npv = 500,
  mu = 0, sigma = 4, standard_errors = FALSE)

ability_tables(parms, design = NULL, method = c("MLE", "EAP"), prior = c("normal", "Jeffreys"), use_draw = NULL, npv = 500, mu = 0, sigma = 4, standard_errors = TRUE)

Arguments

dataSrc

Data source: a dexter project db handle or a data.frame with columns: person_id, item_id, item_score

parms

An object returned by fit_enorm and containing parameter estimates

predicate

An optional expression to subset data, if NULL all data is used

method

Maximum Likelihood (MLE) or Expected A posteriori (EAP)

prior

If an EAP estimate is produced one can choose a normal prior or Jeffreys prior; i.e., a prior proportional to the square root of test information.

use_draw

When parms is Bayesian, use_draw is the index of the posterior sample of the item parameters that will be used for generating plausible values. If use_draw=NULL, a posterior mean is used. If outside range, the last iteration will be used.

npv

Number of plausible values sampled to calculate EAP with normal prior

mu

Mean of the normal prior

sigma

Standard deviation of the normal prior

standard_errors

If true standard-errors are produced.

design

A data.frame with columns item_id and optionally booklet_id. If design is NULL the score transformation table will be computed based on the test design that was used to calibrate the items. If the column booklet_id is not included, the score transformation table will be based on all items found in the design.

Value

ability

a data.frame with columns: booklet_id, person_id, sumScore, theta and optionally se (standard error)

ability_tables

a data.frame with columns: booklet_id, sumScore, theta and optionally se (standard error)

Details

MLE estimates of ability will produce an NA for the minimum (=0) or the maximum score on a booklet. If this is undesirable, we advise to use EAP with Jeffreys prior.

Examples

Run this code
# NOT RUN {
db = start_new_project(verbAggrRules, "verbAggression.db")
add_booklet(db, verbAggrData, "agg")
f = fit_enorm(db)
aa = ability_tables(f,method="MLE",standard_errors=FALSE)
bb = ability_tables(f,method="EAP",standard_errors=FALSE)
cc = ability_tables(f,method="EAP",prior="Jeffreys", standard_errors=FALSE)
plot(bb$sumScore, bb$theta, xlab="test-score", ylab="ability est.", pch=19, cex=0.7)
points(aa$sumScore, aa$theta, col="red", pch=19, cex=0.7)
points(aa$sumScore, cc$theta, col="green", pch=19, cex=0.7)
legend("topleft", legend = c("EAP normal prior", "EAP Jeffreys prior", "MLE"), bty = "n",
        lwd = 1, cex = 0.7, col = c("black", "green", "red"), lty=c(0,0,0), pch = c(19,19,19))

close_project(db)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab