Christian Schulz
2004-Feb-28 13:07 UTC
[R] cluster-gruop-match with other attributes after na.omit
Hi, i want a cluster-analysis with clara, but getting an error because in cldat are NA's. Error in clara(cldat[, 1:3], 4) : Each of the random samples contains objects between which no distance can be computed. cldatx <- subset(cldat,select=c(A,B,C)) cldaty <- na.omit(cldatx) Now , clara works but cldat has ~193.000 obs and cldatx without NA's ~75.000 obs. How could i match back the clara result (cluster group) to check associations with other attributes in the 193.000 obs in the cldat.frame ? Many thanks Christian
Christian Schulz
2004-Feb-28 13:21 UTC
[R] Re: cluster-gruop-match with other attributes after na.omit
i get an idea: cldatx1 <- subset(cldat,select=c(ID,A,B,C)) cldatx2 <- subset(cldat,select=c(A,B,C)) The id didn't cause na.omit , so both have same obs. cl1 <- clara(cldatx2,4) cluster <- cl1$clustering match1 <- cbind(cldatx1,cluster) resultdata <- merge(cldat,macth1,by.x="ID",by.y="ID",all.x=T) Sure there is an easier way??? Thanks,Christian Am Samstag, 28. Februar 2004 14:07 schrieb Christian Schulz:> Hi, > > i want a cluster-analysis with clara, but getting an > error because in cldat are NA's. > > Error in clara(cldat[, 1:3], 4) : Each of the random samples contains > objects between which > no distance can be computed. > > cldatx <- subset(cldat,select=c(A,B,C)) > cldaty <- na.omit(cldatx) > > Now , clara works but cldat has ~193.000 obs > and cldatx without NA's ~75.000 obs. > > How could i match back the clara result (cluster group) > to check associations with other attributes in the 193.000 obs > in the cldat.frame ? > > > Many thanks > Christian
Seemingly Similar Threads
- EXCEL FILE
- ?to calculate sth for groups defined between points in one variable (string), / value separating/ spliting variable into groups by i.e. between start, NA, NA, stop1, start2, NA, stop2
- USING MULTILEVEL PACKAGE AND WABA FUNCTION
- use one way ANOVA to select genes
- Problem booting 2.6.30-rc5 kernel