NAG CL Interface
g22ybc (lm_describe_data)
1
Purpose
g22ybc describes a data matrix.
2
Specification
The function may be called by the names: g22ybc or nag_blgm_lm_describe_data.
3
Description
Let
denote a data matrix with
observations on
independent variables, denoted
. The
th independent variable,
can be classified as either binary, categorical, ordinal or continuous, where:
- Binary
- can take the value or .
- Categorical
- can take one of distinct values or levels. Each level represents a discrete category but does not necessarily imply an ordering. The value used to represent each level is therefore arbitrary and, by convention and for convenience, is taken to be the integers from to .
- Ordinal
- As with a categorical variable can take one of distinct values or levels. However, unlike a categorical variable, the levels of an ordinal variable imply an ordering and hence the value used to represent each level is not arbitrary. For example, implies a value that is twice as large as .
- Continuous
- can take any real value.
g22ybc returns a G22 handle containing a description of a data matrix, . The data matrix makes no distinction between binary, ordinal or continuous variables.
A name can also be assigned to each variable. If names are not supplied then the default vector of names, is used.
4
References
None.
5
Arguments
-
1:
– void **
Input/Output
-
On entry: must be set to
NULL, alternatively an existing G22 handle may be supplied in which case this function will destroy the supplied G22 handle as if
g22zac had been called.
On exit: holds a G22 handle to the internal data structure containing a description of the data matrix,
. You
must not change the G22 handle other than through the functions in
Chapter G22.
-
2:
– Integer
Input
-
On entry: , the number of observations in the data matrix, .
Constraint:
.
-
3:
– Integer
Input
-
On entry: , the number of variables in the data matrix, .
Constraint:
.
-
4:
– const Integer
Input
-
On entry:
contains the number of levels associated with the
th variable of the data matrix, for
.
If the th variable is binary, ordinal or continuous, should be set to ; otherwise should be set to the number of levels associated with the th variable and the corresponding column of the data matrix is assumed to take the value to .
Constraint:
, for .
-
5:
– Integer
Input
-
On entry: the number of variable names supplied in
vnames.
Constraint:
or .
-
6:
– const char *
Input
-
On entry: if
,
must contain the name of the
th variable, for
. If
,
vnames is not referenced and may be
NULL.
The names supplied in
vnames should be at most
characters long and be unique. If a name longer than
characters is supplied it will be truncated.
Variable names must not contain any of the characters +.*-:^()@.
-
7:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
- NE_ARRAY_SIZE
-
On entry, and .
Constraint: or .
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_HANDLE
-
On entry,
hddesc is not
NULL or a recognised G22 handle.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_ARRAY
-
On entry, and .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
- NE_INVALID_FORMAT
-
On entry, variable name contains one more invalid characters, .
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library CL Interface for further information.
- NE_NON_UNIQUE
-
On entry, variable names and are not unique (possibly due to truncation), and .
Maximum variable name length is .
On entry, variable names and are not unique, and .
- NW_TRUNCATED
-
At least one variable name was truncated to characters. Each truncated name is unique and will be used in all output.
7
Accuracy
Not applicable.
8
Parallelism and Performance
g22ybc is not threaded in any implementation.
9.1
Internal Changes
Internal changes have been made to this function as follows:
- At Mark 27: Functionality has been expanded allowing the function to be used with g02jhc. An additional argument has been added to the interface and some of the error exits have been renumbered.
For details of all known issues which have been reported for the NAG Library please refer to the
Known Issues.
10
Example
This example performs a linear regression using
g02dac. The linear regression model is defined via a text string which is parsed using
g22yac. The corresponding design matrix associated with the model and the dataset described via a call to
g22ybc is generated using
g22ycc.
Verbose labels for the parameters of the model are constructed using information returned in
vinfo by
g22ydc.
See also the examples in
g22yac,
g22ycc and
g22ydc.
10.1
Program Text
10.2
Program Data
10.3
Program Results
11
Optional Parameters
As well as the optional parameters common to all G22 handles described in
g22zmc and
g22znc, a number of additional optional parameters can be specified for a G22 handle holding the description of a data matrix as returned by
g22ybc in
hddesc.
Each writeable optional parameter has an associated default value; to set any of them to a non-default value, use
g22zmc. The value of an optional parameter can be queried using
g22znc.
The remainder of this section can be skipped if you wish to use the default values for all optional parameters.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in
Section 11.1.
11.1
Description of the Optional Parameters
For each option, we give a summary line, a description of the optional parameter and details of constraints.
The summary line contains:
- a parameter value,
where the letters , and denote options that take character, integer and real values respectively;
- the default value.
Keywords and character values are case and white space insensitive.
If queried, this optional parameter will return , the number of observations in the data matrix.
If queried, this optional parameter will return , the number of variables in the data matrix.
Storage Order | | Default |
This optional parameter states how the data matrix, , will be stored in its input array.
If , , the value for the th variable of the th observation of the data matrix is stored in .
If , , the value for the th variable of the th observation of the data matrix is stored in .
Where
dat is the input parameter of the same name in
g22ycc.
Constraint:
or .