'Subset data for binary logistic regression for accuracy in word/nonword categorisation
I need to subset my data into 1/0 for correct responses to perform a binary logistic regression (to measure accuracy in a word/nonword categorisation task). The original data is 1 for word and 2 for non-word. How I can change this to (yes = 1 and no = 2) and then change this to 1 and 0? here is the information from the data enter image description here
Solution 1:[1]
Do you need it done in two steps? It would be easier to answer if we had an example of your data. Something like below might help:
data$yes_no <- ifelse(data$word == 1, "yes", "no")
data$response <- ifelse(data$word == 1, 1, 0)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
