metaSDTreg: Meta-SDT regression

View source: R/metaSDTreg.r

metaSDTregR Documentation

Meta-SDT regression


Fit the meta SDT regression model.


  na.action =,
  control = metaSDTcontrol()



Formula specifying the regression model. Presently, the left-hand side should be the ordinal variable A, while the right-hand side must contain the signal variable from the metaSDTdata object. Note that the variable 'signal' has a special interpretation in the model, see 'Details' below.


Data frame to fit the model on. Should be declared as metaSDTdata using the metaSDTdata function.


Optional argument specifying a subset of the data to be used. A logical statement, which is evaluated in 'data'. Only rows with TRUE are used in the analysis.


Method for handling missing values, see na.action. Default is which stops the function with an error in the presence of missing values among variables entering 'formula'.


Optimisation control, see metaSDTcontrol.


The input data frame should be of class 'metaSDTdata' as constructed by the function metaSDTdata. This will contain a variable, 'signal' which presently must be included on the right-hand side of the formula. The left hand side must be the ordinal variable 'A' also contained in the metaSDTdata object. The 'signal' variable has a special interpretation as its coefficients are the signal sensitivities (type 1 d-prime and the two response specific type 2 sensitivities meta-d-prime). Presently all other variables, as determined by all.vars(update(formula, . ~ . - signal )), enter proportionally in the model, i.e. they share cofficients across response scale levels. See Kristensen & al. (2020) for details. This can be written formally as follows (in the notation of Kristensen & al. (2020)):

V_{\mathcal{N}} = V_{\mathcal{S}} = V ,

and \beta_{\mathcal{N}} , \beta_{\mathcal{S}} and \beta agree on all but the first entrance which is the signal sensitivities d_{mathcal{N}} , d_{mathcal{S}} and d , respectively. Note that 'formula' specifies the mean of the latent variables and not the threshold model. Accordingly, attemps to remove the intercept in 'formula' will be ignored with a warning. The function fails when the left-hand side of 'formula' is not the ordinal variable 'A' and when 'data' is not a 'metaSDTdata' object. Future versions may be less defensive and simply issue a warning in these cases. Note that constrained optimisation is used to maximise the likelihood under ordinality of the thresholds. The variance-covariance matrix is not adjusted following the constrained estimation, cf. documentation of maxLik. When interpreting results from summary.metaSDTreg() care should be taken regarding the z-testor and associated p-value for threshold parameters, as the distribution of the statistic depends on the null hypothesis which will only be reasonable under special circumstances as in other types of ordinal models.


An object of class 'metaSDTreg'. This is a list object containing,

  • logLik: The log likelihood after optimisation.

  • coefficients: Estimated coefficients.

  • vcov: Variance-covariance matrix of the maxLik object.

  • call: The call issued to metaSDTreg.

  • na.act: The NA action.


Kristensen, S. B., Sandberg, K., & Bibby, B. M. (2020). Regression methods for metacognitive sensitivity. Journal of Mathematical Psychology, 94. <doi:10.1016/>.


## Declare simulated data as metaSDTdata
metadata <- metaSDTdata(simMetaData, type1='resp', type2='conf', signal='S')

## Fit function to data of first 20 replications per subject
fit_sub <- metaSDTreg(A ~ signal,
                      subset = m <= 20)

## Fit model to estimate thresholds and sensitivities
fit <- metaSDTreg(A ~ signal,

## True values are
## c(tau.n.2=-0.5, tau.n.1=-0.2, theta=0,
##   tau.s.1=0.8, tau.s.2=1, d.n=0.5, d=1, d.s=0.75)

metaSDTreg documentation built on March 31, 2023, 10:09 p.m.