void AddAnalysisVars( Matrix mVarNames <, Matrix mVarLabels>, Matrix mValues <, boolean bNominal> )
void AddAnalysisVars( Matrix mVarNames, Matrix mVarLabels, Matrix mValues, Matrix mNominal )
Matrix mVarNames
A vector that specifies the names to assign to the variables in the DataObject. The string mVarNames[i] specifies the name
of the variable whose initial data comes from mValues[,i]. Each string must be a valid SAS variable name.
Matrix mVarLabels
A vector that specifies the labels to assign to the variables in the DataObject. A variable's label describes the variable. The string mVarLabels[i]
specifies the label of the variable whose name is mVarNames[i]. If the mVarLabels parameter is not specified, each variable
is assigned a label that is the same as its name.
Matrix mValues
A matrix that contains the variables' initial data. The column vector mValues[,i] contains the data for the variable whose name
is mVarNames[i].
boolean bNominal
If mValues contains exclusively nominal data, set bNominal to true. If mData contains exclusively interval data,
set bNominal to false.
Matrix mNominal
A vector that specifies whether each column in mValues contains interval or nominal data. Set mNominal[i] to zero if
the column vector mValues[,i] contains interval data. Set mNominal[i] to a nonzero value if the column vector
mValues[,i] contains nominal data.
This method adds one or more analysis variables to the DataObject. If neither bNominal nor mNominal is specified, mValues is assumed to contain exclusively interval data.
For information about analysis variables, please refer to the Remarks section for the method AddAnalysisVar.
declare DataObject dobj; dobj = DataObject.Create( "Sample Data" ); mData = { 20 165, 30 170, 40 175, 50 180, 60 170, 70 160 }; mVarNames = { "Age", "Weight" }; dobj.AddVars( mVarNames, mData ); DataTable.Create( dobj ).ActivateWindow(); print "To complete this example, please follow these steps:"; print "(1) Click the Save button on the toolbar and save"/; print " the data set somewhere on your disk."; print "(2) Press ALT+F5 to resume the program."; print "(3) When the program finishes, close the data table"/; print " window and notice that it does not prompt you"/; print " to save changes."; pause "nodialog:"; dobj.GetVarData( "Weight", w ); r1 = rank( w ); r2 = ranktie( w ); mVarNames = { "Rank", "Ranktie" }; dobj.AddAnalysisVars( mVarNames, r1 || r2 );
DataObject.AddAnalysisVar
DataObject.AddVar
DataObject.AddVars