Hello I am using the data dystrophy from package ipred. I've used a subset to separate from carriers and normal:
carrier = subset(dystrophy,dystrophy$Class == "carrier")
normal = subset(dystrophy,dystrophy$Class == "normal")
and I've reduce this data selecting only the patients with 1 visit at the hospital:
carrier = subset(carrier,carrier$OBS == "1")
normal = subset(normal,normal$OBS == "1")
So now I would like to practice calculating the means vector, covariance matrix and a correlation matrix of the proteins but by separated groups(Class factor).
I 've tried with cor and cov, but I think I am doing something wrong. Any help would be appreciated. thanks!!
cov
andcor
. If I recall correctly the inputs ofcov
andcor
have to be of the classnumeric
, sofactor
will not work. – FloSchmocor
andcov
. It will help us respond to your problem. – G5W