-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
136 lines (92 loc) · 3.11 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
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%"
)
```
# pattern.checks
<!-- badges: start -->
<!-- badges: end -->
The goal of `pattern.checks` is to identify entries with patterned responses for psychometric scales. The patterns included in the package are:
- **Identical responses**: e.g., `a, a, a`
- **Ascending responses**: e.g., `a, b, c`
- **Descending responses**: e.g., `c, b, a`
- **Alternative patterns**: e.g., `a, b, a, b` (ABAB)
- **Repeating sequences**: e.g., `a, b, c, a, b, c` (ABCABC)
## Installation
You can install the development version of `pattern.checks` like so:
```r
# Install devtools if not already installed
install.packages("devtools")
# Use devtools to install the development version
devtools::install_github("JZL-CK/pattern.checks")
library(pattern.checks)
```
You can install the released version of `pattern.checks` from
[CRAN](https://CRAN.R-project.org) with:
```r
install.packages("pattern.checks")
```
## Example
Here is a basic example demonstrating how to identify participants with a specific pattern in their responses:
### Identical Responses
```{r example-identical}
library(pattern.checks)
# Example dataset
data <- data.frame(
V1 = c(1, 2, 3, 1, 1),
V2 = c(1, 3, 2, 1, 1),
V3 = c(1, 4, 1, 1, 1)
)
# Identify participants with identical responses across columns 1 to 3
result <- pattern.id(data, 1:3)
print(result)
```
### Ascending Responses
```{r example-ascending}
# Identify participants with responses in ascending order
result <- pattern.as(data, 1:3)
print(result)
```
### Descending Responses
```{r example-descending}
# Identify participants with responses in descending order
result <- pattern.ds(data, 1:3)
print(result)
```
### ABAB Pattern
```{r example-abab}
# Identify participants with ABAB pattern responses
result <- pattern.abab(data, 1:3)
print(result)
```
### ABCABC Pattern
```{r example-abcabc}
# Identify participants with ABCABC pattern responses
result <- pattern.abcabc(data, 1:3)
print(result)
```
### Note
Each function returns a list with two elements:
- **`participants`**: A vector of row indices for participants with the specified pattern.
- **`responses`**: A data frame containing their responses for the specified columns.
For example, the output for `pattern.id` might look like this:
```r
$participants
[1] 1 4
$responses
V1 V2 V3
1 1 1 1
4 1 1 1
```
You can use these functions to systematically identify patterned responses in psychometric data and address potential response biases.
### Reference
If you use the `pattern.checks` package in your research, please cite it as:
> C K, J. (2025). pattern.checks: A package to identify patterned responses in psychometric scales. R package version 1.0. Available at: [GitHub Repository Link].
For any queries and suggestions, contact me via <[email protected]>