Εstimate and return the necessary parameters for descriptive statistics visualizations, used in OpenBudgets.eu. It includes functions for measuring central tendency and dispersion of amount variables along with their distributions and correlations and the frequencies of categorical variables for Budget data of municipalities across Europe, according to the OpenBudgets.eu data model.

This package can generally be used to extract visualization parameters convert them to JSON format and use them as input in a different graphical interface. Most functions can have general use out of the OpenBudgets.eu data model.

# install DescriptiveStats.OBeu- cran stable version install.packages (DescriptiveStats.OBeu) # or # alternatively install the development version from github devtools :: install_github "okgreece/DescriptiveStats.OBeu" )

Load library DescriptiveStats.OBeu

library (DescriptiveStats.OBeu)









Descriptive Statistics on OpenBudgets.eu platform

open_spending.ds is designed to estimate and return the basic descriptive measures, the correlation and the boxplot parameters of all the numerical variables and the frequencies of all factor variables of OpenBudgets.eu datasets. The input data must be a JSON link according to the OpenBudgets.eu data model. There are different parameters that a user could specify, e.g. dimensions , measured.dimensions and amounts should be defined by the user, to form the dimensions of the dataset. Then the basic descriptive measures of tendency and spread, boxplot and histogram parameters are estimated in order to describe and visualize the distribution characteristics of the desired dataset. open_spending.ds estimates and returns the json data that are described with the OpenBudgets.eu data model, using ds.analysis function. descript = open_spending.ds json_data = Wuppertal_openspending, dimensions = "functional_classification_3.Produktgruppe|date_2.Year" , amounts = "Amount" ) # Pretty output using prettify of jsonlite library jsonlite :: prettify indent = 2 ) #> { #> "descriptives": { #> "Min": { #> "Amount": [ #> 533.21 #> ] #> }, #> "Max": { #> "Amount": [ #> 2997043.49 #> ] #> }, #> "Range": { #> "Amount": [ #> 2996510.28 #> ] #> }, #> "Mean": { #> "Amount": [ #> 659132.4457 #> ] #> }, #> "Median": { #> "Amount": [ #> 476400.565 #> ] #> }, #> "Quantiles": { #> "Amount": [ #> 313924.26, #> 656962.815 #> ] #> }, #> "Variance": { #> "Amount": [ #> 469375540712.697 #> ] #> }, #> "StandardDeviation": { #> "Amount": [ #> 685109.8749 #> ] #> }, #> "Kurtosis": [ #> 5.7675 #> ], #> "Skewness": [ #> 2.5221 #> ] #> }, #> "boxplot": { #> "Amount": { #> "lo.whisker": [ #> 533.21 #> ], #> "lo.hinge": [ #> 306296.49 #> ], #> "median": [ #> 476400.565 #> ], #> "up.hinge": [ #> 658308.4 #> ], #> "up.whisker": [ #> 1185907.2 #> ], #> "box.width": [ #> 1.5 #> ], #> "lo.out": [ #> #> ], #> "up.out": [ #> 2954238.51, #> 2979998.49, #> 2992244.95, #> 2916160.36, #> 2885816.5, #> 2997043.49, #> 2875275.56, #> 1252420.49, #> 1248584.45 #> ], #> "n": [ #> 100 #> ] #> } #> }, #> "histogram": { #> "Amount": { #> "cuts": [ #> 0, #> 500000, #> 1000000, #> 1500000, #> 2000000, #> 2500000, #> 3000000 #> ], #> "counts": [ #> 54, #> 32, #> 7, #> 0, #> 0, #> 7 #> ], #> "mean": [ #> 659132.4457 #> ], #> "median": [ #> 476400.565 #> ] #> } #> }, #> "frequencies": { #> "frequencies": { #> "functional_classification_3.Produktgruppe": [ #> { #> "Var1": "", #> "Freq": 2 #> }, #> { #> "Var1": "(entfallen in 2013) Geschäftsbereichsleitung GB 1.1 ", #> "Freq": 5 #> }, #> { #> "Var1": "Beschäftigtenvertretung", #> "Freq": 1 #> }, #> { #> "Var1": "Bezirksvertretungen", #> "Freq": 7 #> }, #> { #> "Var1": "Geschäftsbereichsleitung GB 1", #> "Freq": 15 #> }, #> { #> "Var1": "Geschäftsbereichsleitung GB 2.1", #> "Freq": 7 #> }, #> { #> "Var1": "Geschäftsbereichsleitung GB 2.2", #> "Freq": 7 #> }, #> { #> "Var1": "Geschäftsbereichsleitung GB 4", #> "Freq": 28 #> }, #> { #> "Var1": "Gleichstellung von Frau und Mann", #> "Freq": 7 #> }, #> { #> "Var1": "Politische Gremien", #> "Freq": 7 #> }, #> { #> "Var1": "Verwaltungsführung", #> "Freq": 14 #> } #> ], #> "date_2.Year": [ #> { #> "Var1": "2009", #> "Freq": 16 #> }, #> { #> "Var1": "2010", #> "Freq": 15 #> }, #> { #> "Var1": "2011", #> "Freq": 14 #> }, #> { #> "Var1": "2012", #> "Freq": 14 #> }, #> { #> "Var1": "2013", #> "Freq": 15 #> }, #> { #> "Var1": "2014", #> "Freq": 13 #> }, #> { #> "Var1": "2015", #> "Freq": 13 #> } #> ] #> }, #> "relative.frequencies": { #> "functional_classification_3.Produktgruppe": [ #> { #> "Var1": "", #> "Freq": 0.02 #> }, #> { #> "Var1": "(entfallen in 2013) Geschäftsbereichsleitung GB 1.1 ", #> "Freq": 0.05 #> }, #> { #> "Var1": "Beschäftigtenvertretung", #> "Freq": 0.01 #> }, #> { #> "Var1": "Bezirksvertretungen", #> "Freq": 0.07 #> }, #> { #> "Var1": "Geschäftsbereichsleitung GB 1", #> "Freq": 0.15 #> }, #> { #> "Var1": "Geschäftsbereichsleitung GB 2.1", #> "Freq": 0.07 #> }, #> { #> "Var1": "Geschäftsbereichsleitung GB 2.2", #> "Freq": 0.07 #> }, #> { #> "Var1": "Geschäftsbereichsleitung GB 4", #> "Freq": 0.28 #> }, #> { #> "Var1": "Gleichstellung von Frau und Mann", #> "Freq": 0.07 #> }, #> { #> "Var1": "Politische Gremien", #> "Freq": 0.07 #> }, #> { #> "Var1": "Verwaltungsführung", #> "Freq": 0.14 #> } #> ], #> "date_2.Year": [ #> { #> "Var1": "2009", #> "Freq": 0.16 #> }, #> { #> "Var1": "2010", #> "Freq": 0.15 #> }, #> { #> "Var1": "2011", #> "Freq": 0.14 #> }, #> { #> "Var1": "2012", #> "Freq": 0.14 #> }, #> { #> "Var1": "2013", #> "Freq": 0.15 #> }, #> { #> "Var1": "2014", #> "Freq": 0.13 #> }, #> { #> "Var1": "2015", #> "Freq": 0.13 #> } #> ] #> } #> }, #> "correlation": { #> #> } #> } #>