RATS 10.1
RATS 10.1

SMPL( options )  start end

# list of variables (in Regression Format, only needed with REGLIST option)

 

SMPL allows you to set the entry range which will be used by default for the start and end on subsequent instructions. SMPL is not as important in RATS as similar instructions in some other time series programs, because most RATS instructions will automatically determine the range to use given the series involved. You'll notice that it is almost never used in our example programs. As you get more familiar with the style used in RATS, you may find yourself using SMPL less and less.

Parameters

start, end

starting,ending entry or date of the range. You can use an asterisk (*) for either parameter if you want to fix only one end of the range. RATS will determine the *’ed end separately for each instruction. See the examples.
 

SMPL with no parameters tells RATS to return to using the maximum possible range.

Options

SERIES=SMPL series [unused]

This sets the sample based on the values of a data series or a logical expression that can be evaluated across entry numbers. Any entries for which the supplied series or formula are zero, missing (NA), or “false” will be excluded from the sample. This offers an alternative to the SMPL options available on many instructions, and allows you to do transformations that would be very difficult otherwise.

 

REGLIST/[NOREGLIST]

set the sample based on a set of regressors, listed on a supplementary card. Any entry for which any of the listed regressors are missing is excluded.

Description

Following a SMPL instruction, RATS will use the SMPL range on any subsequent instructions for which you do not give an explicit entry range. You can always override the current SMPL by providing the entry range on an instruction.

 

You can set and clear the SMPL any number of times.

Examples

smpl(series=(year==1988))

linreg(robust) vfrall

# constant beertax

scatter(vmin=0.0,style=dots,lines=%beta,hlabel="(a) 1988 Data")

# beertax vfrall

smpl

 

This restricts the LINREG and SCATTER to operate only on those entries where YEAR==1988. After the two instructions, the SMPL is disabled so instructions after that will have their standard default ranges.


 

smpl 1950:1 1985:4

instruments constant cons{1} dy{1} gnp{1} govt dm rsum{1} rate{4}

linreg(inst) cons

# constant gnp cons{1}

linreg(inst) invest

# constant dy{1} gnp rate{4}

 

This runs the two LINREG instructions over the common range from 1950:1 to 1985:4.

 


Copyright © 2025 Thomas A. Doan