How to create a random, representative sub sample of a panel in R? I am trying to run a nonparametric regression on a data set that has 1,000,000 observations and 8 covariates. It is clear I do not have the computing power to run this. I wanted to create a representative subsample of the panel and run the regression with less data. The data has over 13,000 individuals for 72 periods. How could I get a representative subsample? How can I pick which individuals to drop? Or periods?
 A: It seems like you do not have a single row for each subject. Let us assume that your dataframe (assuming it is called df) contains a column called ID which is the unique identifier for each subject.
# Fraction of the subjects to sample
sampling_pct = 0.7
# Obtain an array with unique subject IDs
subject_ids = unique(df$ID)
# Sample from the subject ids
sample_subject_ids = sample(subject_ids, round(sampling_pct * length(subject_ids)))
# Get the rows for the sampled subjects
sample_df = subset(df, ID %in% sample_subject_ids)

A: You can randomly sample rows this way:
df[sample(nrow(df), size = 1000, replace = FALSE),]. 
The sample size of 1000 is arbitrary in my example. You'll want to choose a sample size based on your memory/computation constraints and the statistical power you're willing to lose.
EDIT: This answer only works if your data frame is structured such that each row is one subject. 
A: Not a direct answer, but a more general (and, hopefully, still useful) advice. I would recommend you to use specialized packages for panel data analysis in R, such as plm (http://cran.r-project.org/web/packages/plm). A detailed vignette describes various convenient features of the package. Another R package phtt is also interesting and related, but might not be relevant to your situation.
P.S. Recently I have run across the book "Applied Panel Data Analysis for Economic and Social Surveys" (Springer), which you might also find relevant and helpful. Check this discussion as well.
