GDP describerr Calculates summary statistics for the Numeric Variable x grouping by categorical variable y. The function is able to calculate the following descriptive statistics: Mean Median Standard Deviation Minimum Value Maximum Value Range Value of 75th percentile Value of 25th percentile Interquartile range Number of Missing values

gdpdescriberr(df1, x, y, .stats = c("mean", "sd", "median"), dec = 2)

Arguments

df1

cleaned data frame preprocessed by gdpcleanerr

x

column name of a data frame used to calculate the descriptive statistics

y

column name of a grouping variable

.stats

vector with the descriptive stats to calculate

dec

number of decimal places to return in the table

Value

data.frame

Examples

data <- tibble::tribble(~REF_DATE,~GEO,~DGUID,
~`North.American.Industry.Classification.System.(NAICS)`,
~UOM, ~UOM_ID,~SCALAR_FACTOR,~SCALAR_ID,~VECTOR, ~COORDINATE,
~VALUE,~STATUS,~SYMBOL,~TERMINATED,~DECIMALS,1997L,"Canada",
"2016A000011124","Total industries", "Dollars",81L,"millions",
6L, "v41894235",1.477, 816756.1, NA,NA, NA,1L,1997L,"Canada",
"2016A000011124", "Crop and animal production",
"Dollars",81L,"millions",6L,"v41700857", 1.1,12755.9,NA,NA, NA,1L)
gdpdescriberr(data, VALUE, GEO, .stats=c("mean", "sd", "median"), dec = 2)
#> # A tibble: 4 × 2
#>   V1     V2    
#>   <chr>  <chr> 
#> 1 GEO    Canada
#> 2 mean   414756
#> 3 sd     568514
#> 4 median 414756