next up previous contents index
Next: Constructing data over many Up: Using data Previous: Example

Defining single observations

 


tex2html_wrap_inline33790 tex2html_wrap_inline33790 Syntax

  1. BD>data : D(I)=E tex2html_wrap_inline33798 tex2html_wrap_inline33712

  2. BD>data : D(E tex2html_wrap_inline33794 )=E tex2html_wrap_inline33798 tex2html_wrap_inline33712

where tex2html_wrap_inline35840 is the name of a data-carrier, tex2html_wrap_inline36394 is a valid equation (optionally excluding parentheses), tex2html_wrap_inline36396 is a valid equation which should round to a positive integer (the rounding is performed by the program), and tex2html_wrap_inline36398 is a positive integer.

tex2html_wrap_inline33806 tex2html_wrap_inline33806

In addition to reading lists of data for collections of quantities, the DATA:  command can also be used to define one-off observations. Here, tex2html_wrap_inline35840 is the name of some data-element or element (the data-element will be constructed if it does not exist already), tex2html_wrap_inline36398 is the case being defined, and the result of the equation tex2html_wrap_inline34518 will be assigned as the observation. For example, the following fragment of code

BD>data : pressure(3)=50.7 tex2html_wrap_inline33712

makes the third observation on the data-carrier ``pressure'' equal to 50.7. The first form of the syntax is the most commonly used. The second form of the syntax allows the case number to be defined as an equation: the following two lines of code are equivalent:

  1. BD>c : %t=1 tex2html_wrap_inline33712

    BD>data : x((%t+3))=5 tex2html_wrap_inline33712

  2. BD>data : x(4)=5 tex2html_wrap_inline33712

 



David Wooff
Wed Oct 21 15:14:31 BST 1998