Parameters

allocate_Z ()

Allocates the two-dimensional data array Z,
based on the v (number of variables) and n (number of
observations) members of dset
. The variable at
position 0 is initialized to all 1s; other variables
are initialized to NADBL (unless OPT_B is given).

Parameters

dset

pointer to dataset.

opt

may include OPT_B to indicate that the data columns
will be "borrowed".

Returns

0 on success, E_ALLOC on error.

dataset_allocate_varnames ()

Given a blank dset
, which should have been obtained using
datainfo_new(), allocate space for the names of variables.
The v
member of dset
(representing the number of variables,
including the automatically added constant at position 0) must be
set before calling this function.

set_sorted_markers ()

dataset_set_regular_markers ()

start_new_Z ()

Initializes the data array within dset
(adding the constant in
position 0).

Parameters

dset

pointer to dataset.

opt

if includes OPT_R we're sub-sampling from a full data set;
if includes OPT_P, do not null out dset->S and markers.

Returns

0 on successful completion, non-zero on error.

is_trend_variable ()

int
is_trend_variable (const double *x,
int n);

Parameters

x

array to examine.

n

number of elements in array.

Returns

1 if x
is a simple linear trend variable, with each
observation equal to the preceding observation plus 1, or
if x
is a quadratic trend starting at 1 for the first
observation in the data set, and 0 otherwise.

Parameters

Returns

dataset_add_observations ()

Extends all series in the dataset by the specified number of
extra observations. The added values are initialized to
the missing value code, NADBL, with the exception of
simple deterministic variables when OPT_A is given.

Parameters

dset

pointer to dataset.

n

number of observations to add.

opt

use OPT_A to attempt to recognize and
automatically extend simple deterministic variables such
as a time trend and periodic dummy variables;
use OPT_D to drop any observation markers rather than
expanding the set of markers and padding it out with
dummy values.

Parameters

Returns

dataset_add_series_as ()

Adds to the dataset a new series with name name
and
values given by x
. The new variable is added at one
level "deeper" (in terms of function execution) than the
current level. This is for use with user-defined functions.

Parameters

dset

pointer to dataset.

x

array to be added.

name

name to give the new variable.

Returns

0 on success, E_ALLOC on error.

dataset_copy_series_as ()

Makes a copy of series v
under the name name
.
The copy exists in a variable namespace one level "deeper"
(in terms of function execution) than the variable being copied.
This is for use with user-defined functions: a variable
supplied to a function as an argument is copied into the
function's namespace under the name it was given as a
parameter.

Returns

dataset_drop_listed_variables ()

Deletes the variables given in list
from the dataset. Remaining
variables may have their ID numbers changed as a consequence. If
renumber
is not NULL, this location receives 1 in case variables
have been renumbered, 0 otherwise.

Parameters

list

list of variable to drop, by ID number.

dset

pointer to dataset.

renumber

location for return of information on whether
remaining variables have been renumbered as a result, or
NULL.

Parameters

Returns

dataset_destroy_hidden_variables ()

Deletes from the dataset any "hidden" variables that have
been added automatically (for example, auto-generated variables
used for the x-axis in graph plotting), and that have ID
numbers greater than or equal to vmin
. Never deletes the
automatically generated constant (ID number 0).

Returns

series_get_string_vals ()

Parameters

dset

pointer to dataset.

i

index number of series.

n_strs

location to receive the number of strings, or NULL.

Returns

the array of strings associated with distinct numerical
values of series i
, or NULL if there's no such array. The returned
array should not be modified in any way; copy the strings first if
you need to modify them.