Transcription of sample — Draw random sample - Stata
{{id}} {{{paragraph}}}
Draw random sampleSyntaxMenuDescriptionOptionsRemark s and examplesReferencesAlso seeSyntaxsample#[if][in][, count by(groupvars)]byis allowed; see [D] >Resampling>Draw random sampleDescriptionsampledraws random samples of the data in memory. Sampling here is defined as drawingobservations without replacement; see [R]bsamplefor sampling with size of the sample to be drawn can be specified as a percentage or as a count: samplewithout thecountoption draws a#% pseudorandom sample of the data in memory,thus discarding (100 #)% of the observations. samplewith thecountoption draws a#-observation pseudorandom sample of the data inmemory, thus discardingN #observations.#can be larger thanN, in which case allobservations are either case, observations not meeting the optionalifandincriteria are kept (sampled at 100%).If you are interested in reproducing results, you must first set the random -number seed; see [R] that#insample#be interpreted as an observation count rather than as a 5without thecountoption means that a 5% sample be drawn; typingsample5, count, however, would draw a sample of 5 #as greater than the number of observations in the dataset is not considered an (groupvars)specifies that a#% sample be drawn within each set of values ofgroupvars, thusmaintaining the proportion of each be combined withby().
4sample— Draw random sample. generate u=runiform(). sort u. keep in 1/12524 (56 observations deleted) That is, we put the resulting sample in random order …
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}