[R] Odp: Sampling problem

wangwallace talenttree at gmail.com
Tue Nov 16 18:53:57 CET 2010


Fabulicious!!!!!!!!!!!!!!!!! It worked!!! 

One more question, in the following data frame as posted above:

    SubID    CSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4
      1          6      5       6       2      6      2        2       4
      2          6      4       7       2      6      6        2       3
      3          5      5       5       5      5      5        4       5
      4          5      4       3       4      4      4        5       2
      5          5      6       7       5      6      4        4       1
      6          5      4       3       6      4      3        7       3
      7          3      6       6       3      6      5        2       1
      8          3      6       6       3      6      5        4       7 

I want to draw the first random sample consisting of a row of integers under
the first group of variables (CSE1, CSE2, CSE3, CSE4). For example, assuming
the first draw yielded a sample of the first row (6, 5, 6, 2), now I want to
draw another random sample consisting of two rows of integers under the
second group of variables (WSE1, WSE2, WSE3, WSE4). Also, for the second
draw, I want to restrict a vector I am going to sample from to only those
rows that are not correspond to SubID I have sampled. That is, I want to
sample two rows of integers under the second group of variables (WSE1, WSE2,
WSE3, WSE4) from rows 2, 3, 4, 5, 6, 7, and 8.

Also, I want to repeat this whole process (drawing 1 random row of integers
under the first group of variables first, AND then another two random rows
under the second group of variables) for 1000 times. Any ideas? would that
be possible to do it by just revising the syntax you wrote above? many
thanks!!!
-- 
View this message in context: http://r.789695.n4.nabble.com/Sampling-problem-tp3043804p3045352.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list