The model is a synthesis of a mixture and a mixed effect model. The random effect distribution for the cluster term (often individuals) is a point mass for delta = 0 and a continuous distribution for delta > 0.
The function fits the model and computes d-prime for an average subject, 2) the variance among subjects, 3) the "posterior" probability of a subject being a discriminator (with delta > 0), 4) the "posterior" expectation on the random effect (ie. the subject-specific delta) and 5) the probability that a randomly chosen individual is a discriminator (ie. the probability mass at delta = 0 in the random effects distribution)
Warning: This function is preliminary; see the details for further information.
discrimR(formula, data, weights, cluster, start, subset, na.action,
contrasts = NULL, hess = FALSE, ranef = FALSE, zi = FALSE,
method = c("duotrio", "probit", "threeAFC", "triangle",
"twoAFC"), ...)
A formula where the lhs is the binomial response. An
indicator vector or a matrix with two column; successes and failures
like in a call to glm
with a binomial family. The rhs
should be 1
; no other predictors are currently allowed, but
extending this is ongoing work.
The data.frame
in which to look for variables.
Possible weights
The clustering variable; should be a factor.
Optional starting values; recommended in the current implementation
...
...
...
Should the hessian of the parameters be computed?
Should the random effect estimates be computed?
Should the posterior probabilities of a subject being a discriminator be computed?
Should correspond to the actual test applied.
Additional arguments to
optim
. control=list(trace=TRUE, REPORT=1)
is
recommended, so the reduction in deviance and convergence can be
followed.
A list with the following elements:
The fixed effect parameter, ie. delta (for an average individual)
A vector with two elements: The first element is the variance component (standard deviation) on the log-scale, where optimization is performed. The second element is the variance component (standard deviation) on the original scale.
Deviance for the model
standard errors for 1) the fixed effect parameter and 2) the variance component on the log-scale
Convergence message from optim
Log-likelihood contributions from each of the observations.
The random effect estimates for the levels of the clustering factor (often individual)
posterior probabilities of a subject being a discriminator
The probability that a randomly chosen individual is a discriminator (ie. the probability mass for delta > 0 in the random effects distribution)
Fitted values
The scaled response vector on which optimization is performed.
the matched call
This function is preliminary and improving it is ongoing work. The computational methods are expected to change completely. This will hopefully facilitate methods for more general rhs-formulae with additional predictors.
Currently no methods or extractor functions have been written, so the user will have to select the relevant elements from the fitted object (see below). Implementation of methods and extractor functions will occur in due course.
triangle
, twoAFC
,
threeAFC
, duotrio
,
discrimPwr
, discrimSim
,
discrimSS
, samediff
,
AnotA
, findcr
# NOT RUN {
freq <- c(10,8,10,9,8,9,9,1,10,10,8,2,6,7,6,7,6,4,5,5,3,3,9,9,5,5,8,8,9,9)
tmp <- data.frame(id = factor(1:30), n = rep(10, 30), freq = freq)
head(tmp)
str(tmp)
fm <- discrimR(cbind(freq, n - freq) ~ 1, tmp, cluster = id,
start = c(.5, .5), method = "twoAFC",
ranef = TRUE, zi = TRUE, hess = TRUE,
control=list(trace=TRUE, REPORT=1))
names(fm)
fm[1:4]
# }
Run the code above in your browser using DataLab