I want to convert some variable types in R
from factors to binary asymmetric variable types.
I successfully converted some of my data from factors to ordered factors using this syntax: mydata[,200] <-as.ordered(mydata[,200])
, but when I tried something similar to convert them to binary asymmetric variables, I was unsuccessful, and have had trouble finding any information about how to do this online or in the book I have. I need them to be specified as asymmetric because I'm going to be using the daisy function to look at dissimilarities. If anyone could tell me how to convert from factors to binary asymmetric I would be incredibly grateful.
Edit: To answer the question about the asymmetric vs. symmetric variables: the main difference between a binary symmetric and binary asymmetric is in symmetric variables, both carry the same weight (is that person male or female) while in asymmetric variables one is more important than the other. It doesn't matter if people don't share a characteristic, it only matters if they do. So for example, people who are color-blind have something in common, but people who are not color-blind do not.
So, what I'm looking to do is set it up to where essentially 0=unimportant, 1=important. From what I've read (Kaufmann & Rousseeuw 1990) it is important to make the distinction that these are asymmetric when doing dissimilarities.
structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, NA, 1L, NA,
1L, 1L, 1L, NA, NA, 1L, 1L, 1L, NA, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L), .Label = c("0", "1"), class = "factor")
Further edits: I don't believe I need a dummy variable, as it is already technically a binary (everything is either 1, 0, or NA) - I just don't know how to make R change the variable into an asymmetric binary variable rather than a factor.