DataObject.AddVar

Prototypes

void AddVar( String sVarName, Matrix mData )

void AddVar( String sVarName, String sVarLabel, Matrix mData <, boolean bNominal> )

void AddVar( String sVarName, double[] adData )

void AddVar( String sVarName, String sVarLabel, double[] adData <, boolean bNominal> )

void AddVar( String sVarName <, String sVarLabel>, String[] asData )

Parameters

String sVarName
The name for the new variable. This string must be a valid SAS variable name.

String sVarLabel
The label for the new variable. This string can be used to describe the variable. If the sVarLabel parameter is not specified, the variable is assigned a label that is the same as its name.

Matrix mData
The observation data for the new variable. This must be either an n x 1 column vector or a 1 x n row vector.

boolean bNominal
If bNominal is true, the data is treated as nominal data. If bNominal is false, the data is treated as interval data. Calling this method without specifying the bNominal parameter is equivalent to calling it with bNominal equal to false.

double[] adData
The observation data for the new variable.

String[] asData
The observation data for the new variable.

Remarks

This method adds a variable to the DataObject.

Example
x = { 1 2 3 4 5 6 7 8 };
y = { 2 1 4 5 6 5 6 9 };
declare DataObject dobj = DataObject.Create( "Sample Data" );
dobj.AddVar( "Pred", "Predictor", x );
dobj.AddVar( "Resp", "Response", y );
DataTable.Create( dobj ).ActivateWindow();
See Also

DataObject.AddAnalysisVar
DataObject.AddAnalysisVars
DataObject.AddVars