l_full: Log-likelihood of a combined assessment.

Description Usage Arguments Details Value

Description

This function computes the log-likelihood for 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
l_full(resp, u, parms, theta1, theta2)

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.

u

the logit of the weight parameter of the RSC model.

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.

theta1

the latent trait of member 1.

theta2

the latent trait of member 2.

Details

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").

Note that only the odd rows of resp[grep("COL", names(resp))] are used when computing the log-likelihood for the group component.

This description is much longer than the source code – type l_full for a shorter explanation.

Value

length(u)-vector of log-likelihoods.


peterhalpin/BearShare documentation built on May 25, 2019, 12:48 a.m.