Skip to main content
8 events
when toggle format what by license comment
Apr 13, 2017 at 12:44 history edited CommunityBot
replaced http://stats.stackexchange.com/ with https://stats.stackexchange.com/
Nov 14, 2013 at 18:55 vote accept daniellopez46
Nov 14, 2013 at 18:55 comment added daniellopez46 np. I was actually just inspecting y as you were writing your answer and thinking "I was not expecting to see 15 columns for m<-3..Should be choose(5,3) =10". But your edit fixed that. This is way cool! Thank you for very much!
Nov 14, 2013 at 18:41 comment added whuber Sorry: although I checked that, I misread the output and did not catch the discrepancy. There was a typo in the code where "2" appeared but "m" should have (and R issued no warnings about a mismatch between the sizes of arrays x0 and y; it merely "recycled" the elements). I fixed that typo and pasted the new output. You might find it informative (and reassuring) to run the code and inspect the array y, which contains all the $m$-tuples for each row in x. As another check, sum(z) should equal $\binom{p}{m}$ times the number of rows in $x$: $\binom{5}{3}\times 6=60$ in the example.
Nov 14, 2013 at 18:38 history edited whuber CC BY-SA 3.0
deleted 41 characters in body
Nov 14, 2013 at 18:31 comment added daniellopez46 @ whuber. Thanks for your posted Answer. Why is the output of z showing a count of 5 for (3,5,10)? Based on the original matrix I was expecting to see a count of 3. This would come from rows x[c(1:2,6),]. If I enter m<-5 I would expect to see in the output of z (3,5,8,10,15) with a count of 2 and and 5 additional groups each with a count of 1.
Nov 14, 2013 at 16:41 history edited whuber CC BY-SA 3.0
added 259 characters in body
Nov 14, 2013 at 15:44 history answered whuber CC BY-SA 3.0