Object Reference : Object View and Procedure Reference : Sample
  
 
sample
Declare a sample object.
The sample statement declares, and optionally defines, a sample object.
Syntax
sample smpl_name [smpl_statement]
Follow the sample keyword with a name for the sample object and a sample statement. If no sample statement is provided, the sample object will be set to the current workfile sample.
To reset the sample dates in a sample object, you must use the Sample::set procedure.
Examples
sample ss
declares a sample object named SS and sets it to the current workfile sample.
sample s2 1974q1 1995q4
declares a sample object named S2 and sets it from1974Q1 to 1995Q4.
sample fe_bl @all if gender=1 and race=3
smpl fe_bl
The first line declares a sample FE_BL that includes observations where GENDER=1 and RACE=3. The second line sets the current sample to FE_BL.
sample sf @last-10 @last
declares a sample object named SF and sets it to the last 10 observations of the current workfile range.
sample s1 @first 1973q1
s1.set 1973q2 @last
The first line declares a sample object named S1 and sets it from the beginning of the workfile range to 1973Q1. The second line resets S1 from 1973Q2 to the end of the workfile range.
sample s2 @all if @hourf<=9.5 and @hourf<=14.5
declares a sample S2 that includes all observations that are between 9:30AM and 2:30PM.
Cross-references
See “Samples”and “Dates” for a discussion of using samples and dates in EViews.
See also Sample::set and smpl.