Below is the example of using the GetWbkMd operation to get values of summary statistics for all workbook series. The request contains an instance of opened workbook and parameters for getting statistics values.
{ "GetWbkMd" : { "tWbk" : { "id" : "S1!M!S!W1"
}, "tArg" : { "pattern" : { "obInst" : "true", "lanerStatistics" : "" } } } }
{ "GetWbkMdResult" : { "id" : { "id" : "S1!M!S!W1" }, "meta" : { "obInst" : {
"obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "WBK_AD", "n" : "Yearly data", "k" : "5505", "c" : "2827", "p" : "5471", "h" : "0"
} }, "dirty" : "1", "windowsPosition" : "Vertical", "hasPivot" : "0", "hasLaner" : "1", "series" : { "@count" : "3", "its" : ""
}, "lanerStatistics" : { "its" : { "it" : [ { "k" : "0", "id" : "Number of observations",
"n" : "Number of observations", "vis" : "1", "type" : "ObsCount", "value" : "", "group" : { "k" : "1", "id" : "General" } }
{ "k" : "1", "id" : "Determination coefficient (R^2)", "n" : "Determination coefficient (R^2)", "vis" : "1", "type" : "R2", "value" : "", "group" : { "k" : "2"
"id" : "Quality criteria" } }, { "k" : "2", "id" : "Adjusted determination coefficient (adj R^2)", "n" : "Adjusted determination coefficient (adj R^2)", "vis" : "1", "type" : "AdjR2", "value" : ""
"group" : { "k" : "2", "id" : "Quality criteria" } }, { "k" : "3", "id" : "Fisher statistics (F)", "n" : "Fisher statistics (F)"
"vis" : "1", "type" : "Fstat", "value" : "", "group" : { "k" : "2", "id" : "Quality criteria" } }, {
"k" : "4", "id" : "Fisher statistics probability (p-v)", "n" : "Fisher statistics probability (p-v)", "vis" : "1", "type" : "ProbFstat", "value" : "", "group" : { "k" : "2", "id" : "Quality criteria"
} }, { "k" : "5", "id" : "Log-likelihood function (LogL)", "n" : "Log-likelihood function (LogL)", "vis" : "1", "type" : "LogL", "value" : "", "group"
{ "k" : "2", "id" : "Quality criteria" } }, { "k" : "6", "id" : "Akaike information criterion (AIC)", "n" : "Akaike information criteria (AIC)", "vis" : "1"
"type" : "AIC", "value" : "", "group" : { "k" : "2", "id" : "Quality criteria" } }, { "k" : "7",
"id" : "Schwarz information criterion (SC)", "n" : "Schwarz information criterion (SC)", "vis" : "1", "type" : "SC", "value" : "", "group" : { "k" : "2", "id" : "Quality criteria" }
}, { "k" : "8", "id" : "Standard error (SE)", "n" : "Standard error (SE)", "vis" : "1", "type" : "SE", "value" : "", "group" : {
"k" : "2", "id" : "Quality criteria" } }, { "k" : "9", "id" : "Durbin-Watson statistic (DW)", "n" : "Durbin-Watson statistic (DW)", "vis" : "1", "type" : "DW"
"value" : "", "group" : { "k" : "3", "id" : "Diagnostic criteria" } }, { "k" : "10", "id" : "Lower limit probability"
"n" : "Lower limit probability", "vis" : "1", "type" : "DWLowerBound", "value" : "", "group" : { "k" : "3", "id" : "Diagnostic criteria" } }
{ "k" : "11", "id" : "Upper limit probability", "n" : "Upper limit probability", "vis" : "1", "type" : "DWUpperBound", "value" : "", "group" : { "k" : "3"
"id" : "Diagnostic criteria" } }, { "k" : "12", "id" : "Mean error", "n" : "Mean error", "vis" : "1", "type" : "ME", "value" : ""
"group" : { "k" : "4", "id" : "Residual analysis" } }, { "k" : "13", "id" : "Mean absolute error", "n" : "Mean absolute error"
"vis" : "1", "type" : "MAE", "value" : "", "group" : { "k" : "4", "id" : "Residual analysis" } }, {
"k" : "14", "id" : "Mean squared error", "n" : "Mean squared error", "vis" : "1", "type" : "MSE", "value" : "", "group" : { "k" : "4", "id" : "Residual analysis"
} }, { "k" : "15", "id" : "Root mean squared error", "n" : "Root mean squared error squares", "vis" : "1", "type" : "SqMSE", "value" : "", "group"
{ "k" : "4", "id" : "Residual analysis" } }, { "k" : "16", "id" : "Residuals variance", "n" : "Residuals variance", "vis" : "1"
"type" : "VE", "value" : "", "group" : { "k" : "4", "id" : "Residual analysis" } }, { "k" : "17",
"id" : "Standard deviation of residuals", "n" : "Standard deviation of residuals", "vis" : "1", "type" : "SEE", "value" : "", "group" : { "k" : "4", "id" : "Residual analysis" }
}, { "k" : "18", "id" : "Minimum", "n" : "Minimum", "vis" : "1", "type" : "Min", "value" : "-0.285802", "group" : {
"k" : "5", "id" : "Characteristics" } }, { "k" : "19", "id" : "Maximum", "n" : "Maximum", "vis" : "1", "type" : "Max"
"value" : "11.809686", "group" : { "k" : "5", "id" : "Characteristics" } }, { "k" : "20", "id" : "Average"
"n" : "Average", "vis" : "1", "type" : "Average", "value" : "4.735390", "group" : { "k" : "5", "id" : "Characteristics" } }
{ "k" : "21", "id" : "Median", "n" : "Median", "vis" : "1", "type" : "Median", "value" : "2.527168", "group" : { "k" : "5"
"id" : "Characteristics" } }, { "k" : "22", "id" : "Mode", "n" : "Mode", "vis" : "1", "type" : "Mode", "value" : "2.739778"
"group" : { "k" : "5", "id" : "Characteristics" } }, { "k" : "23", "id" : "Standard deviation", "n" : "Standard deviation"
"vis" : "1", "type" : "StDev", "value" : "4.918221", "group" : { "k" : "5", "id" : "Characteristics" } }, {
"k" : "24", "id" : "Variance", "n" : "Variance", "vis" : "1", "type" : "Dispersion", "value" : "24.188898", "group" : { "k" : "5", "id" : "Characteristics"
} }, { "k" : "25", "id" : "Start date", "n" : "Start date", "vis" : "1", "type" : "StartDate", "value" : "", "group"
{ "k" : "5", "id" : "Characteristics" } }, { "k" : "26", "id" : "End date", "n" : "End date", "vis" : "1"
"type" : "EndDate", "value" : "", "group" : { "k" : "5", "id" : "Characteristics" } }, { "k" : "27"
"id" : "Earliest start date", "n" : "Earliest start date", "vis" : "1", "type" : "FStartDate", "value" : "2000-01-01", "group" : { "k" : "5", "id" : "Characteristics" }
}, { "k" : "28", "id" : "Latest start date", "n" : "Latest start date", "vis" : "1", "type" : "LStartDate", "value" : "2000-01-01", "group" : {
"k" : "5", "id" : "Characteristics" } }, { "k" : "29", "id" : "Earliest end date", "n" : "Earliest end date", "vis" : "1", "type" : "FEndDate"
"value" : "2012-01-01", "group" : { "k" : "5", "id" : "Characteristics" } }, { "k" : "30", "id" : "Latest end date"
"n" : "Latest end date", "vis" : "1", "type" : "LEndDate", "value" : "2013-01-01", "group" : { "k" : "5", "id" : "Characteristics" } }
{ "k" : "31", "id" : "Number of observations", "n" : "Number of observations", "vis" : "1", "type" : "ObservCnt", "value" : "41", "group" : { "k" : "5"
"id" : "Characteristics" } }, { "k" : "32", "id" : "Number of empty values", "n" : "Number of empty values", "vis" : "1", "type" : "EmptyCnt", "value" : "1"
"group" : { "k" : "5", "id" : "Characteristics" } }, { "k" : "33", "id" : "Scale", "n" : "Scale"
"vis" : "1", "type" : "Scale", "value" : "", "group" : { "k" : "5", "id" : "Characteristics" } }, {
"k" : "34", "id" : "Skew", "n" : "Skew", "vis" : "1", "type" : "Skew", "value" : "", "group" : { "k" : "5", "id" : "Characteristics"
} }, { "k" : "35", "id" : "Kurtosis", "n" : "Kurtosis", "vis" : "1", "type" : "Kurt", "value" : "", "group" :
{ "k" : "5", "id" : "Characteristics" } } ] } } } } }
The GewWbkStat function gets values of summary statistics for workbook series. Input parameters:
wbk. Workbook instance.
After execution the function returns a result of data extraction. The console window displays requested values of summary statistics.
public static GetWbkMdResult GetWbkStat(WbkId wbk) {// Set operation execution parameters var tOp = new GetWbkMd { tWbk = wbk, tArg = new GetWbkMdArg {// Set data extraction pattern pattern = new WbkMdPattern { lanerStatistics = new LnStatisticsPattern() } } }; // Create proxy object for operation execution var somClient = new SomPortTypeClient(); // Execute operation var gRes = somClient.GetWbkMd(tOp); Console.WriteLine("Workbook statistics obtained: " + gRes.id.id); // Output statistics to console window Console.WriteLine("---Statistics---"); LnStatistics stats = gRes.meta.lanerStatistics; ulong gKey = 0; foreach (LnStatistic st in stats.its) { if (gKey != st.group.k) { Console.WriteLine("".PadRight(3) + st.group.id); gKey = st.group.k; } Console.Write("".PadRight(6) + st.n + "(" + st.type + "): "); if (st.value != "") {Console.WriteLine(st.value);} else {Console.WriteLine("-");} }; return gRes; }
See also: