Hi
I have a panel dataset with large number of groups and differing number
of observations for each group. I want to randomly select say, 20% of
the groups or 200 groups, but along with all observations from the
selcted groups (with the corresponding data).
I guess it is possible to generate a random sample from the groups ids
and then match that with the entire dataset to have the intended
dataset, but it sounds cumbersome and possibly there is an easier way to
do this? checked the package 'sampling' or command 'sample', but they
cant do exactly the same thing.
I was wondering if someone on this list will be able to share his/her
knowldege?
Thanks in advance,
Zia
**********************************************************
Zia Wadud
PhD Student
Centre for Transport Studies
Department of Civil and Environmental Engineering
Imperial College London
London SW7 2AZ
Tel +44 (0) 207 594 6055
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.