HI Craig,
Assuming that this is similar to what you tried:
dat <- read.table(text="member code
1 A
1 C
1 F
2 B
2 E
3 D
3 A
3 B
3 D
4 G
4 A",sep="",header=TRUE,stringsAsFactors=FALSE)
code.list <- LETTERS[1:5]
n.mbr <- 4
mbr.list <- 1:4
matrix.mat <-
matrix(0,ncol=length(code.list),nrow=length(u
I have a medical insurance claims datafile divided into blocks by member, with
multiple lines per member. I am processing these into a one line per member
binary model matrix. Member block sizes vary from 1 to 50+. I am matching
attributes in claims data to columns in the model matrix and have b
2 matches
Mail list logo