Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Eviews5 / EViews5 / Docs / EViews 5 Command Ref.pdf
Скачиваний:
47
Добавлен:
23.03.2015
Размер:
5.23 Mб
Скачать

sample—429

print x

the print statement will not be executed since execution will stop after executing the commands in SIMUL.PRG. If this behavior is not intended, you should consider using the include (p. 637) statement.

Cross-references

See “Executing a Program” on page 84 for further details.

See also include (p. 637).

sample

Object Declaration

 

 

Declare a sample object.

The sample statement declares, and optionally defines, a sample object.

Syntax

Command: 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 set (p. 444) 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

430—Appendix B. Command Reference

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.

Cross-references

See “Samples” on page 93 of the User’s Guide, and “Dates” on page 129 for a discussion of using dates and samples in EViews.

See also set (p. 444) and smpl (p. 474).

save

Command | Graph Proc | Table Proc

 

 

Save graph to disk as a Windows metafile or PostScript file. Save table to disk as a CSV, tab-delimited ASCII text, RTF, or HTML file.

save may also be used as a command to save the current workfile to disk. This latter usage is provided only for backward compatibility, as it has been replaced with the equivalent wfsave (p. 540) command.

Syntax

Object Proc:

object_name.save(options) [path\]file_name

Follow the keyword with a name for the file. file_name may include the file type extension, or the file type may be specified using the “t=” option. The graph may be saved with an

.EMF, .WMF, or .EPS extension.

If an explicit path is not specified, the file will be stored in the default directory, as set in the File Locations global options.

General Graph Options

t=file_type

Specifies the file type, where file_type may be one of:

 

Enhanced Windows metafile (“emf”, “meta”, or “meta-

 

file”), ordinary Windows metafile (“wmf”), or Encapsu-

 

lated PostScript (“eps”, “ps” or “postscript”).

 

Files will be saved with the “.emf”, “.wmf”, and “.eps”

 

extensions, respectively.

 

 

u=units

Specify units of measurement, where units is one of:

 

“in” (inches), “cm” (centimeters), “pt” (points), “pica”

 

(picas).

save—431

w=width Set width of the graphic in the selected units.

h=height Set height of the graphic in the selected units.

c / -c

[Save / Do not save] the graph in color.

 

 

Note that if only a width or a height option is specified, EViews will calculate the other dimension holding the aspect ratio of the graph constant. If both width and height are provided, the aspect ratio will no longer be locked. EViews will default to the current graph dimensions if size is unspecified.

All defaults are taken from the global graph export settings (Options/Graphics Defaults.../ Exporting).

Postscript specific Graph Options

box / -box

[Save / Do not save] the graph with a bounding box.

 

The bounding box is an invisible rectangle placed

 

around the graphic to indicate its boundaries. The

 

default is taken from the global graph export settings.

 

 

land

Save the graph in landscape orientation. The default

 

uses portrait mode.

Table Options

t=file_type

Specifies the file type, where file_type may be one of:

(default=

“csv”(CSV - comma-separated), “rtf” (Rich-text for-

“csv”)

mat), “txt” (tab-delimited text), or “html” (HTML -

 

Hypertext Markup Language).

 

Files will be saved with the “.csv”, “.rtf”, “.txt”, and

 

“.htm” extensions, respectively.

 

 

s=arg

Scale size, where arg is from 0.05 to 2, representing the

 

fraction of the original table size (only valid for HTML

 

or RTF files).

 

 

r=cell_range

Range of table cells to be saved. See setfillcolor

 

(p. 453) for the cell_range syntax. If a range is not pro-

 

vided, the entire table will be saved.

 

 

n=string

Replace all cells that contain NA values with the speci-

 

fied string. “NA” is the default.

432—Appendix B. Command Reference

f / -f

[Use full precision values/ Do not use full precision]

 

when saving values to the table (only applicable to

 

numeric cells). By default, the values will be saved as

 

they appear in the currently formatted table.

 

 

Examples

graph1.save(t=ps, -box, land) c:\data\MyGra1

saves GRAPH1 as a PostScript file MYGRA1.EPS. The graph is saved in landscape orientation without a bounding box.

graph2.save(u=pts, w=300, h=300) MyGra2

saves GRAPH2 in the default directory as an Enhanced Windows metafile MYGRA2.EMF. The image will be scaled to 300 × 300 points.

The command:

tab1.save mytable

saves TAB1 to a CSV file named “MYTABLE.CSV” in the default directory.

tab1.save(t=csv, n="NAN") mytable

saves TAB1 to a CSV (comma separated value) file named MYTABLE.CSV and writes all NA values as “NAN”.

tab1.save(r=B2:C10, t=html, s=.5) mytable

saves from data from the second row, second column, to the tenth row, third column of TAB1 to a HTML file named MYTABLE.HTM at half of the original size.

tab1.save(f, n=".", r=B) mytable

saves the data in the second column in full precision to a CSV file named “MYTABLE.CSV”, and writes all NA values as “.”.

Cross-references

See Chapter 14, “Graphs, Tables, and Text Objects”, beginning on page 413 of the User’s Guide for a discussion of graphs and tables.

To save a workfile, see wfsave (p. 540). To redirect output, see output (p. 380).

Соседние файлы в папке Docs