-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
66 lines (46 loc) · 2.43 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# metaSDT
<!-- badges: start -->
[![R-CMD-check](https://github.com/craddm/metaSDT/workflows/R-CMD-check/badge.svg)](https://github.com/craddm/metaSDT/actions)
[![DOI](https://zenodo.org/badge/99712128.svg)](https://zenodo.org/badge/latestdoi/99712128)
[![R-CMD-check](https://github.com/craddm/metaSDT/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/craddm/metaSDT/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
This is an R implementation of Maniscalco and Lau's methods of calculating metacognitive SDT measures using maximum likelihood estimation and minimization of the sum of squared errors.
## Installation
You can install `metaSDT`'s development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("craddm/metaSDT")
```
For further details on metacognitive/Type 2 SDT, see their website at http://www.columbia.edu/~bsm2105/type2sdt/ and the following publications:
Maniscalco, B., & Lau, H. (2012). A signal detection theoretic approach for estimating metacognitive sensitivity from confidence ratings. Consciousness and Cognition, 21(1), 422–430. doi:10.1016/j.concog.2011.09.021
Maniscalco, B., & Lau, H. (2014). Signal detection theory analysis of type 1 and type 2 data: meta-d’, response-specific meta-d’, and the unequal variance SDT mode. In S. M. Fleming & C. D. Frith (Eds.), The Cognitive Neuroscience of Metacognition (pp.25-66). Springer.
If you use these functions, cite the above papers and scripts on which it is based.
The `fit_meta_d_SSE` and `fit_meta_d_MLE` commands require data in the same format outlined on M & L's webpage, as follows:
Suppose there are two stimuli, A, and B, and three confidence ratings - high (3), medium(2), and low(1). The possible responses are
A3, A2, A1, B1, B2, B3.
Input to the function should be counts for each of these responses separately for each stimulus type.
So for example:
```{r}
library(metaSDT)
nR_S1 <- c(100, 50, 30, 20, 10, 4)
nR_S2 <- c(4, 20, 21, 35, 60, 90)
fit_MLE <- fit_meta_d_MLE(nR_S1,
nR_S2)
fit_MLE
fit_SSE <- fit_meta_d_SSE(nR_S1,
nR_S2)
fit_SSE
```
Output is a data frame with m-ratio etc.