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!W3"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"useGridAutoAdjust" : "true",
"lanerStatistics" : ""
}
}
}
}
{
"GetWbkMdResult" :
{
"id" :
{
"id" : "S1!M!S!W3"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "2",
"@hf" : "0",
"i" : "WBK_AD",
"n" : "Annual data",
"k" : "5505",
"c" : "2827",
"p" : "5471",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"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" : "Performance 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" : "Performance criteria"
}
},
{
"k" : "3",
"id" : "Fisher statistic (F)",
"n" : "Fisher statistic (F)",
"vis" : "1",
"type" : "Fstat",
"value" : "",
"group" :
{
"k" : "2",
"id" : "Performance criteria"
}
},
{
"k" : "4",
"id" : "Fisher statistic probability (p-v)",
"n" : "Fisher statistic probability (p-v)",
"vis" : "1",
"type" : "ProbFstat",
"value" : "",
"group" :
{
"k" : "2",
"id" : "Performance criteria"
}
},
{
"k" : "5",
"id" : "Log-likelihood function (LogL)",
"n" : "Log-likelihood function (LogL)",
"vis" : "1",
"type" : "LogL",
"value" : "",
"group" :
{
"k" : "2",
"id" : "Performance criteria"
}
},
{
"k" : "6",
"id" : "Akaike information criterion (AIC)",
"n" : "Akaike information criterion (AIC)",
"vis" : "1",
"type" : "AIC",
"value" : "",
"group" :
{
"k" : "2",
"id" : "Performance criteria"
}
},
{
"k" : "7",
"id" : "Schwarz information criterion (SC)",
"n" : "Schwarz information criterion (SC)",
"vis" : "1",
"type" : "SC",
"value" : "",
"group" :
{
"k" : "2",
"id" : "Performance criteria"
}
},
{
"k" : "8",
"id" : "Standard error (SE)",
"n" : "Standard error (SE)",
"vis" : "1",
"type" : "SE",
"value" : "",
"group" :
{
"k" : "2",
"id" : "Performance 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",
"vis" : "1",
"type" : "SqMSE",
"value" : "",
"group" :
{
"k" : "4",
"id" : "Residual analysis"
}
},
{
"k" : "16",
"id" : "Residual variance",
"n" : "Residual 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.61346821",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "19",
"id" : "Maximum",
"n" : "Maximum",
"vis" : "1",
"type" : "Max",
"value" : "1.68005197",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "20",
"id" : "Average",
"n" : "Average",
"vis" : "1",
"type" : "Average",
"value" : "1.139227082222222",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "21",
"id" : "Median",
"n" : "Median",
"vis" : "1",
"type" : "Median",
"value" : "1.14567254",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "22",
"id" : "Mode",
"n" : "Mode",
"vis" : "1",
"type" : "Mode",
"value" : "0.69913685",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "23",
"id" : "Standard deviation",
"n" : "Standard deviation",
"vis" : "1",
"type" : "StDev",
"value" : "0.3502606231582123",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "24",
"id" : "Variance",
"n" : "Variance",
"vis" : "1",
"type" : "Dispersion",
"value" : "0.1226825041351792",
"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" : "1995-01-01",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "28",
"id" : "Latest start date",
"n" : "Latest start date",
"vis" : "1",
"type" : "LStartDate",
"value" : "1995-01-01",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "29",
"id" : "Earliest end date",
"n" : "Earliest end date",
"vis" : "1",
"type" : "FEndDate",
"value" : "2015-01-01",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "30",
"id" : "Latest end date",
"n" : "Latest end date",
"vis" : "1",
"type" : "LEndDate",
"value" : "2015-01-01",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "31",
"id" : "Number of observations",
"n" : "Number of observations",
"vis" : "1",
"type" : "ObservCnt",
"value" : "63",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "32",
"id" : "Number of empty values",
"n" : "Number of empty values",
"vis" : "1",
"type" : "EmptyCnt",
"value" : "0",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "33",
"id" : "Scale",
"n" : "Scale",
"vis" : "1",
"type" : "Scale",
"value" : "",
"group" :
{
"k" : "5",
"id" : "Characteristics"
}
},
{
"k" : "34",
"id" : "Skewness",
"n" : "Skewness",
"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"
}
}
]
}
}
}
}
}
public static GetWbkMdResult GetWbkStat(WbkId wbk)
{// Set operation execution parameters
var tOp = new GetWbkMd
{
tWbk = wbk,
tArg = new GetWbkMdArg
{// Set pattern for getting data
pattern = new WbkMdPattern
{
lanerStatistics = new LnStatisticsPattern()
}
}
};
// Create a proxy object for operation execution
var somClient = new SomPortTypeClient();
// Execute operation
var gRes = somClient.GetWbkMd(tOp);
Console.WriteLine("Workbook statistics are obtained: " + gRes.id.id);
// Display statistics in the 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: