John Randall wrote:

> ....  You can
> also get m more directly from the original data.
>
>

Here's what I meant.

data=:0 : 0
ID           Height        Weight        Age        Sex        Hair
John         5'10"         170#          34         M          Black
Joe          5'10"         190#          25         M          Black
Sally        5'3"          110#          23         F          Blonde
Sammy        6'1"          210#          37         M          Blonde
)
cut=:' '&$: :([: -.&a: <;._2@,~)
m=:(~. i. ])"1&.|: }."1 }. >cut &.> LF cut data
c=:[: (+/%#) =
C=:c"1/~

   ]m
0 0 0 0 0
0 1 1 0 0
1 2 2 1 1
2 3 3 0 1
   C m
  1 0.6   0 0.2
0.6   1   0 0.2
  0   0   1 0.2
0.2 0.2 0.2   1

Best wishes,

John


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to