RSC: Estimation of latent traits and the one-parameter RSC model...

Description Usage Arguments Details Value

Description

This function calls optim to estimate the parameter vector c(u, theta1, theta2) from the repsonses to a combined assessment, in which the 2PL model is used for the individual component of the assessment and the one-parameter RSC model is used for the group component of the assessment.

Usage

1
2
rsc(resp, parms, starts = NULL, method = "MAP", obs = F, sigma = 3,
  parallel = F)

Arguments

resp

a data.frame containing the binary item responses of both the individual assessment and the (conjunctively scored) group assessment. See details for information on formatting.

parms

a data.frame with columns parms$alpha and parms$beta corresponding to the discrimination and difficulty parameters of the 2PL model, respectively. See details for information on formatting.

starts

starting values, ordered as triplets of c(w, theta1, theta2) for each row of resp (optional).

method

one of c("ML", "MAP"). The latter isrecommended.

obs

logical: should standard errors be computed using the observed (TRUE) or expected (FALSE) Hessian?

sigma

prior standard deviation for logit of weight.

parallel

logical: call parallel:mclapply instead of looping over nrow(resp)?

Details

Esimation is via either maximum likelihood (ML) or modal a'posteriori (MAP), with the latter being prefered. For MAP, a standard normal prior is used for individual ability. A standard normal prior is used for individual ability, and for the logit of the weight of the RSC model a normal prior is used with standard deviation sigma. Standard errors (or posterior standard deviations) are computed by numerically inverting the analytically computed Hessian of the objective function, at the parameter estimates. The value of the objective function at the estimate is is also provided. If parallel = T, the call to optim is parallelized via parallel::mclapply.

The response matrix resp must be formatted to contain one row of binary responses for each respondent (not each dyad). Members of the same dyad must be on adjancent rows, such that resp[odd,] gives the responses of one member of a dyad and resp[odd + 1, ] gives the responses of the other member of the dyad, where odd is any odd integer in c(1, nrow(resp)). The column names for items on the individual assessment must include "IND"; those on the (conjunctively-scored) group assessment just include "COL" – these text-keys are grepped from names(resp) to obtain the response patterns for the individual assessment and the group assessment.

The same text keys must be used when naming the rows of the data.frame parms containing the item parameters. Similarly to the procedure described for names(resp), row.names(parms) is grepped for each of c("IND", "COL") to obtain the item parameters of the individual assessment and the group assessment. The order of items (columns) of resp is assumed to correpond to that of items (rows) of parms, for each of c("IND", "COL").

Type l_full for an illustration of how the formatting calls are made.

Value

A named nrow(resp) by 7 data.frame containing the estimates, their standard errors, and the value of the objective function at the solution.


peterhalpin/cirt documentation built on May 25, 2019, 1:50 a.m.