Learn R Programming

PublicWorksFinanceIT (version 0.3.1)

summary_stat: Returns summary statistics of Financial variables

Description

The function allows to obtain summary statistics for financial variables. Mean and standard deviation are computed by default. If requested spatial autocorrelation is computed through the Moran test.

Usage

summary_stat(
data,
corr = FALSE,
variable,
d1,
d2,
plot = FALSE)

Value

A list with class list containing the following components:

variable

the names of the financial variables

mean

the value of the mean for each financial variable

sd

the value of the standard deviation for each financial variables

moran.test

list containing the results of the moran.test function

Arguments

data

Dataset of class 'data.frame'. Specify the dataset obtained from the retrieving and the merge_data functions.

corr

Logical. By default set to FALSE. If spatial autocorrelation is of interest set to TRUE. To compute the spatial autocorrelation point geometries are required.

variable

Character. Specify the name of the variable for which to obtain the spatial autocorrelation.

d1

See dnearneigh function for details.

d2

See dnearneigh function for details.

plot

Logical. By default set to FALSE. If Moran plot for spatial autocorrelation is of interest set the argument to TRUE.

Author

Lorena Ricciotti

References

Moran, Patrick AP (1950). "A test for the serial independence of residuals." Biometrika, 37(1/2), 178–181. JSTOR.