descr offers a concise description of each variable in a data frame. It is built as a wrapper around qsu, but by default also computes frequency tables with percentages for categorical variables, and quantiles and the number of distinct values for numeric variables (next to the mean, sd, min, max, skewness and kurtosis computed by qsu).

descr(X, Ndistinct = TRUE, higher = TRUE, table = TRUE,
      Qprobs = c(0.01, 0.05, 0.25, 0.5, 0.75, 0.95, 0.99),
      cols = NULL, label.attr = "label", ...)

# S3 method for descr
print(x, n = 7, perc = TRUE, digits = 2, t.table = TRUE, summary = TRUE, ...)

# S3 method for descr
as.data.frame(x, ...)

Arguments

X

a data frame or list of atomic vectors. Atomic vectors, matrices or arrays can be passed but will first be coerced to data frame using qDF.

Ndistinct

logical. TRUE (default) computes the number of distinct values on all variables using fNdistinct.

higher

logical. Argument is passed down to qsu: TRUE (default) computes the skewness and the kurtosis.

table

logical. TRUE (default) calls table on all categorical variables (excluding Date variables).

Qprobs

double. Probabilities for quantiles to compute on numeric variables, passed down to quantile. If something non-numeric is passed (i.e. NULL, FALSE, NA, "" etc.), no quantiles are computed.

cols

select columns to describe using column names, indices, a logical vector or a function (i.e. is.numeric).

label.attr

character. The name of a label attribute to display for each variable (if variables are labeled).

...

other arguments passed to qsu.default.

x

an object of class 'descr'.

n

integer. The number of first and last entries to display of the table computed for categorical variables. If the number of distinct elements is < 2*n, the whole table is printed.

perc

logical. TRUE (default) adds percentages to the frequencies in the table for categorical variables.

digits

integer. The number of decimals to print in statistics and percentage tables.

t.table

logical. TRUE (default) prints a transposed table.

summary

logical. TRUE (default) computes and displays a summary of the frequencies if the size of the table for a categorical variables exceeds 2*n.

Details

descr was heavily inspired by Hmisc::describe, but computes about 10x faster. The performance is comparable to summary. descr was built as a wrapper around qsu, to enrich the set of statistics computed by qsu for both numeric and categorical variables.

qsu itself is yet about 10x faster than descr, and is optimized for grouped, panel data and weighted statistics. It is possible to also compute grouped, panel data and/or weighted statistics with descr by passing group-ids to g, panel-ids to pid or a weight vector to w. These arguments are handed down to qsu.default and only affect the statistics natively computed by qsu, i.e. passing a weight vector produces a weighted mean, sd, skewness and kurtosis but not weighted quantiles.

The list-object returned from descr can be converted to a tidy data frame using as.data.frame. This representation will not include frequency tables computed for categorical variables, and the method cannot handle arrays of statistics (applicable when g or pid arguments are passed to descr, in that case as.data.frame.descr will throw an appropriate error).

Value

A 2-level nested list, the top-level containing the statistics computed for each variable, which are themselves stored in a list containing the class, the label, the basic statistics and quantiles / tables computed for the variable. The object is given a class 'descr' and also has the number of observations in the dataset attached as an 'N' attribute, as well as an attribute 'arstat' indicating whether the object contains arrays of statistics, and an attribute 'table' indicating whether table = TRUE (i.e. the object could contain tables for categorical variables).

See also

Examples

## Standard Use descr(iris)
#> Dataset: iris, 5 Variables, N = 150 #> -------------------------------------------------------------------------------- #> Sepal.Length (numeric): #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 150 35 5.84 0.83 4.3 7.9 0.31 2.43 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 4.4 4.6 5.1 5.8 6.4 7.25 7.7 #> -------------------------------------------------------------------------------- #> Sepal.Width (numeric): #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 150 23 3.06 0.44 2 4.4 0.32 3.18 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 2.2 2.34 2.8 3 3.3 3.8 4.15 #> -------------------------------------------------------------------------------- #> Petal.Length (numeric): #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 150 43 3.76 1.77 1 6.9 -0.27 1.6 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1.15 1.3 1.6 4.35 5.1 6.1 6.7 #> -------------------------------------------------------------------------------- #> Petal.Width (numeric): #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 150 22 1.2 0.76 0.1 2.5 -0.1 1.66 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.1 0.2 0.3 1.3 1.8 2.3 2.5 #> -------------------------------------------------------------------------------- #> Species (factor): #> Stats: #> N Ndist #> 150 3 #> Table: #> Freq Perc #> setosa 50 33.33 #> versicolor 50 33.33 #> virginica 50 33.33 #> --------------------------------------------------------------------------------
descr(wlddev)
#> Dataset: wlddev, 12 Variables, N = 12744 #> -------------------------------------------------------------------------------- #> country (character): Country Name #> Stats: #> N Ndist #> 12744 216 #> Table: #> Freq Perc #> Afghanistan 59 0.46 #> Albania 59 0.46 #> Algeria 59 0.46 #> American Samoa 59 0.46 #> Andorra 59 0.46 #> Angola 59 0.46 #> Antigua and Barbuda 59 0.46 #> --- #> Freq Perc #> Vanuatu 59 0.46 #> Venezuela, RB 59 0.46 #> Vietnam 59 0.46 #> Virgin Islands (U.S.) 59 0.46 #> West Bank and Gaza 59 0.46 #> Yemen, Rep. 59 0.46 #> Zambia 59 0.46 #> Zimbabwe 59 0.46 #> #> Summary of Table: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 59 59 59 59 59 59 #> -------------------------------------------------------------------------------- #> iso3c (factor): Country Code #> Stats: #> N Ndist #> 12744 216 #> Table: #> Freq Perc #> ABW 59 0.46 #> AFG 59 0.46 #> AGO 59 0.46 #> ALB 59 0.46 #> AND 59 0.46 #> ARE 59 0.46 #> ARG 59 0.46 #> --- #> Freq Perc #> VNM 59 0.46 #> VUT 59 0.46 #> WSM 59 0.46 #> XKX 59 0.46 #> YEM 59 0.46 #> ZAF 59 0.46 #> ZMB 59 0.46 #> ZWE 59 0.46 #> #> Summary of Table: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 59 59 59 59 59 59 #> -------------------------------------------------------------------------------- #> date (Date): Date Recorded (Fictitious) #> Stats: #> N Ndist Min Max #> 12744 59 -3287 17897 #> -------------------------------------------------------------------------------- #> year (integer): Year #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 12744 59 1989 17.03 1960 2018 -0 1.8 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1960 1962 1974 1989 2004 2016 2018 #> -------------------------------------------------------------------------------- #> decade (numeric): Decade #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 12744 7 1988.98 17.63 1960 2020 0.01 1.95 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1960 1960 1970 1990 2000 2020 2020 #> -------------------------------------------------------------------------------- #> region (factor): Region #> Stats: #> N Ndist #> 12744 7 #> Table: #> Freq Perc #> East Asia & Pacific 2124 16.67 #> Europe & Central Asia 3422 26.85 #> Latin America & Caribbean 2478 19.44 #> Middle East & North Africa 1239 9.72 #> North America 177 1.39 #> South Asia 472 3.70 #> Sub-Saharan Africa 2832 22.22 #> -------------------------------------------------------------------------------- #> income (factor): Income Level #> Stats: #> N Ndist #> 12744 4 #> Table: #> Freq Perc #> High income 4720 37.04 #> Low income 1947 15.28 #> Lower middle income 2773 21.76 #> Upper middle income 3304 25.93 #> -------------------------------------------------------------------------------- #> OECD (logical): Is OECD Member Country? #> Stats: #> N Ndist #> 12744 2 #> Table: #> Freq Perc #> FALSE 10620 83.33 #> TRUE 2124 16.67 #> -------------------------------------------------------------------------------- #> PCGDP (numeric): GDP per capita (constant 2010 US$) #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 8995 8995 11563.65 18348.41 131.65 191586.64 3.11 16.96 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 223.54 374.38 1215.59 3619.61 14084.71 46591.94 87780.62 #> -------------------------------------------------------------------------------- #> LIFEEX (numeric): Life expectancy at birth, total (years) #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 11068 10048 63.84 11.45 18.91 85.42 -0.67 2.65 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 35.49 42.23 55.84 66.97 72.5 78.82 81.83 #> -------------------------------------------------------------------------------- #> GINI (numeric): GINI index (World Bank estimate) #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 1356 363 39.4 9.68 16.2 65.8 0.46 2.29 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 24.66 26.5 31.7 37.4 46.8 57.2 60.84 #> -------------------------------------------------------------------------------- #> ODA (numeric): Net ODA received (constant 2015 US$) #> Stats: #> N Ndist Mean SD Min Max Skew #> 8336 7564 428,746468 819,868971 -1.08038000e+09 2.45521800e+10 7.19 #> Kurt #> 122.9 #> Quant: #> 1% 5% 25% 50% 75% 95% #> -11,731500 1,097500 41,020000 157,360000 463,057500 1.82400500e+09 #> 99% #> 3.48697750e+09 #> --------------------------------------------------------------------------------
descr(GGDC10S)
#> Dataset: GGDC10S, 16 Variables, N = 5027 #> -------------------------------------------------------------------------------- #> Country (character): Country #> Stats: #> N Ndist #> 5027 43 #> Table: #> Freq Perc #> ARG 124 2.47 #> BOL 123 2.45 #> BRA 124 2.47 #> BWA 104 2.07 #> CHL 125 2.49 #> CHN 125 2.49 #> COL 123 2.45 #> --- #> Freq Perc #> SWE 126 2.51 #> THA 124 2.47 #> TWN 126 2.51 #> TZA 104 2.07 #> USA 129 2.57 #> VEN 125 2.49 #> ZAF 104 2.07 #> ZMB 104 2.07 #> #> Summary of Table: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 4 105 124 117 126 129 #> -------------------------------------------------------------------------------- #> Regioncode (character): Region code #> Stats: #> N Ndist #> 5027 6 #> Table: #> Freq Perc #> ASI 1372 27.29 #> EUR 1004 19.97 #> LAM 1117 22.22 #> MENA 257 5.11 #> NAM 129 2.57 #> SSA 1148 22.84 #> -------------------------------------------------------------------------------- #> Region (character): Region #> Stats: #> N Ndist #> 5027 6 #> Table: #> Freq Perc #> Asia 1372 27.29 #> Europe 1004 19.97 #> Latin America 1117 22.22 #> Middle East and North Africa 257 5.11 #> North America 129 2.57 #> Sub-saharan Africa 1148 22.84 #> -------------------------------------------------------------------------------- #> Variable (character): Variable #> Stats: #> N Ndist #> 5027 2 #> Table: #> Freq Perc #> EMP 2516 50.05 #> VA 2511 49.95 #> -------------------------------------------------------------------------------- #> Year (numeric): Year #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 5027 67 1981.58 17.57 1947 2013 -0.05 1.86 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1950 1953 1967 1982 1997 2009 2011 #> -------------------------------------------------------------------------------- #> AGR (numeric): Agriculture #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4364 4353 2,526696.5 37,129098.1 0 1.19187778e+09 23.95 642.16 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.09 23.18 930.7 4394.52 29781.04 2,393977.49 24,932575.1 #> -------------------------------------------------------------------------------- #> MIN (numeric): Mining #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4355 4224 1,867908.95 32,334251.7 0 1.10344053e+09 25.27 712.33 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.02 1.2 38.95 173.22 4841.26 713420.36 14,309891.9 #> -------------------------------------------------------------------------------- #> MAN (numeric): Manufacturing #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4355 4353 5,538491.36 63,090998.4 0 1.86843541e+09 20.71 498.7 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.05 27.31 620.44 3718.1 52805.35 2,978846.99 108,499037 #> -------------------------------------------------------------------------------- #> PU (numeric): Utilities #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4354 4237 335679.47 2,576027.41 0 65,324543.8 13.5 244.29 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0 2.16 25.74 167.95 4892.25 291356.48 11,866259.3 #> -------------------------------------------------------------------------------- #> CON (numeric): Construction #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4355 4339 1,801597.63 24,382598 0 860,638677 26.15 774.73 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.02 15.03 215.57 1473.45 13514.84 829361.57 37,430603.6 #> -------------------------------------------------------------------------------- #> WRT (numeric): Trade, restaurants and hotels #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4355 4344 3,392909.52 36,950812.9 0 1.15497404e+09 21.19 530.06 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.03 25.07 650.38 3773.64 41648.17 2,646521.57 79,618054.2 #> -------------------------------------------------------------------------------- #> TRA (numeric): Transport, storage and communication #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4355 4334 1,473269.72 16,815143.2 0 547,047040 22.77 604.58 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.05 12.28 205.79 1174.8 18927.21 1,059843.16 31,750009.1 #> -------------------------------------------------------------------------------- #> FIRE (numeric): Finance, insurance, real estate and business services #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4355 4349 1,657114.84 13,709981.9 -2848.81 387,997506 16.48 356.43 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0 3.87 128.18 960.13 13460.4 1,599086.92 55,536957 #> -------------------------------------------------------------------------------- #> GOV (numeric): Government services #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 3482 3470 1,712300.28 16,967383.7 0 485,535400 18.67 430.18 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.02 48.14 723.98 3928.51 37689.12 1,400263.37 56,340246.3 #> -------------------------------------------------------------------------------- #> OTH (numeric): Community, social and personal services #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4248 4238 1,684527.32 15,613923.6 0 402,671182 14.93 273.79 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.02 15.92 310.09 1433.17 13321.29 605013.39 42,264477.4 #> -------------------------------------------------------------------------------- #> SUM (numeric): Summation of sector GDP #> Stats: #> N Ndist Mean SD Min Max Skew Kurt #> 4364 4364 21,566436.8 251,812500 0 8.06794210e+09 22.53 589.58 #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.38 269.63 4803.94 23186.19 284646.08 15,030223.5 435,513356 #> --------------------------------------------------------------------------------
as.data.frame(descr(wlddev))
#> Variable Class Label N Ndist #> 1 country character Country Name 12744 216 #> 2 iso3c factor Country Code 12744 216 #> 3 date Date Date Recorded (Fictitious) 12744 59 #> 4 year integer Year 12744 59 #> 5 decade numeric Decade 12744 7 #> 6 region factor Region 12744 7 #> 7 income factor Income Level 12744 4 #> 8 OECD logical Is OECD Member Country? 12744 2 #> 9 PCGDP numeric GDP per capita (constant 2010 US$) 8995 8995 #> 10 LIFEEX numeric Life expectancy at birth, total (years) 11068 10048 #> 11 GINI numeric GINI index (World Bank estimate) 1356 363 #> 12 ODA numeric Net ODA received (constant 2015 US$) 8336 7564 #> Min Max Mean SD Skew #> 1 NA NA NA NA NA #> 2 NA NA NA NA NA #> 3 -3.287000e+03 1.789700e+04 NA NA NA #> 4 1.960000e+03 2.018000e+03 1.989000e+03 1.703005e+01 -6.402075e-16 #> 5 1.960000e+03 2.020000e+03 1.988983e+03 1.763107e+01 6.221301e-03 #> 6 NA NA NA NA NA #> 7 NA NA NA NA NA #> 8 NA NA NA NA NA #> 9 1.316464e+02 1.915866e+05 1.156365e+04 1.834841e+04 3.112130e+00 #> 10 1.890700e+01 8.541707e+01 6.384109e+01 1.144971e+01 -6.692252e-01 #> 11 1.620000e+01 6.580000e+01 3.939757e+01 9.676435e+00 4.613314e-01 #> 12 -1.080380e+09 2.455218e+10 4.287465e+08 8.198690e+08 7.191848e+00 #> Kurt 1% 5% 25% 50% 75% #> 1 NA NA NA NA NA NA #> 2 NA NA NA NA NA NA #> 3 NA NA NA NA NA NA #> 4 1.799310 1.960000e+03 1962.0000 1.974000e+03 1.989000e+03 2.004000e+03 #> 5 1.946267 1.960000e+03 1960.0000 1.970000e+03 1.990000e+03 2.000000e+03 #> 6 NA NA NA NA NA NA #> 7 NA NA NA NA NA NA #> 8 NA NA NA NA NA NA #> 9 16.958507 2.235368e+02 374.3818 1.215588e+03 3.619608e+03 1.408471e+04 #> 10 2.645842 3.549402e+01 42.2278 5.584225e+01 6.696500e+01 7.250112e+01 #> 11 2.293188 2.465500e+01 26.5000 3.170000e+01 3.740000e+01 4.680000e+01 #> 12 122.900291 -1.173150e+07 1097500.0000 4.102000e+07 1.573600e+08 4.630575e+08 #> 95% 99% #> 1 NA NA #> 2 NA NA #> 3 NA NA #> 4 2.016000e+03 2.018000e+03 #> 5 2.020000e+03 2.020000e+03 #> 6 NA NA #> 7 NA NA #> 8 NA NA #> 9 4.659194e+04 8.778062e+04 #> 10 7.882439e+01 8.183329e+01 #> 11 5.720000e+01 6.084500e+01 #> 12 1.824005e+09 3.486977e+09
## Passing Arguments down to qsu: For Panel Data Statistics descr(iris, pid = iris$Species)
#> Dataset: iris, 5 Variables, N = 150 #> -------------------------------------------------------------------------------- #> Sepal.Length (numeric): #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 150 5.84 0.83 4.3 7.9 0.31 2.43 #> Between 3 5.84 0.8 5.01 6.59 -0.21 1.5 #> Within 50 5.84 0.51 4.16 7.16 0.12 3.26 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 4.4 4.6 5.1 5.8 6.4 7.25 7.7 #> -------------------------------------------------------------------------------- #> Sepal.Width (numeric): #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 150 3.06 0.44 2 4.4 0.32 3.18 #> Between 3 3.06 0.34 2.77 3.43 0.43 1.5 #> Within 50 3.06 0.34 1.93 4.03 0.03 3.51 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 2.2 2.34 2.8 3 3.3 3.8 4.15 #> -------------------------------------------------------------------------------- #> Petal.Length (numeric): #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 150 3.76 1.77 1 6.9 -0.27 1.6 #> Between 3 3.76 2.09 1.46 5.55 -0.42 1.5 #> Within 50 3.76 0.43 2.5 5.11 0.12 3.89 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1.15 1.3 1.6 4.35 5.1 6.1 6.7 #> -------------------------------------------------------------------------------- #> Petal.Width (numeric): #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 150 1.2 0.76 0.1 2.5 -0.1 1.66 #> Between 3 1.2 0.9 0.25 2.03 -0.25 1.5 #> Within 50 1.2 0.2 0.57 1.67 -0.05 3.36 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.1 0.2 0.3 1.3 1.8 2.3 2.5 #> -------------------------------------------------------------------------------- #> Species (factor): #> Stats: #> N Ndist #> 150 3 #> #> Table: #> Freq Perc #> setosa 50 33.33 #> versicolor 50 33.33 #> virginica 50 33.33 #> --------------------------------------------------------------------------------
descr(wlddev, pid = wlddev$iso3c)
#> Dataset: wlddev, 12 Variables, N = 12744 #> -------------------------------------------------------------------------------- #> country (character): Country Name #> Stats: #> N Ndist #> 12744 216 #> #> Table: #> Freq Perc #> Afghanistan 59 0.46 #> Albania 59 0.46 #> Algeria 59 0.46 #> American Samoa 59 0.46 #> Andorra 59 0.46 #> Angola 59 0.46 #> Antigua and Barbuda 59 0.46 #> --- #> Freq Perc #> Vanuatu 59 0.46 #> Venezuela, RB 59 0.46 #> Vietnam 59 0.46 #> Virgin Islands (U.S.) 59 0.46 #> West Bank and Gaza 59 0.46 #> Yemen, Rep. 59 0.46 #> Zambia 59 0.46 #> Zimbabwe 59 0.46 #> #> Summary of Table: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 59 59 59 59 59 59 #> -------------------------------------------------------------------------------- #> iso3c (factor): Country Code #> Stats: #> N Ndist #> 12744 216 #> #> Table: #> Freq Perc #> ABW 59 0.46 #> AFG 59 0.46 #> AGO 59 0.46 #> ALB 59 0.46 #> AND 59 0.46 #> ARE 59 0.46 #> ARG 59 0.46 #> --- #> Freq Perc #> VNM 59 0.46 #> VUT 59 0.46 #> WSM 59 0.46 #> XKX 59 0.46 #> YEM 59 0.46 #> ZAF 59 0.46 #> ZMB 59 0.46 #> ZWE 59 0.46 #> #> Summary of Table: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 59 59 59 59 59 59 #> -------------------------------------------------------------------------------- #> date (Date): Date Recorded (Fictitious) #> Stats: #> N Ndist Min Max #> 12744 59 -3287 17897 #> -------------------------------------------------------------------------------- #> year (integer): Year #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 12744 1989 17.03 1960 2018 -0 1.8 #> Between 216 1989 0 1989 1989 - - #> Within 59 1989 17.03 1960 2018 -0 1.8 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1960 1962 1974 1989 2004 2016 2018 #> -------------------------------------------------------------------------------- #> decade (numeric): Decade #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 12744 1988.98 17.63 1960 2020 0.01 1.95 #> Between 216 1988.98 0 1988.98 1988.98 - - #> Within 59 1988.98 17.63 1960 2020 0.01 1.95 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1960 1960 1970 1990 2000 2020 2020 #> -------------------------------------------------------------------------------- #> region (factor): Region #> Stats: #> N Ndist #> 12744 7 #> #> Table: #> Freq Perc #> East Asia & Pacific 2124 16.67 #> Europe & Central Asia 3422 26.85 #> Latin America & Caribbean 2478 19.44 #> Middle East & North Africa 1239 9.72 #> North America 177 1.39 #> South Asia 472 3.70 #> Sub-Saharan Africa 2832 22.22 #> -------------------------------------------------------------------------------- #> income (factor): Income Level #> Stats: #> N Ndist #> 12744 4 #> #> Table: #> Freq Perc #> High income 4720 37.04 #> Low income 1947 15.28 #> Lower middle income 2773 21.76 #> Upper middle income 3304 25.93 #> -------------------------------------------------------------------------------- #> OECD (logical): Is OECD Member Country? #> Stats: #> N Ndist #> 12744 2 #> #> Table: #> Freq Perc #> FALSE 10620 83.33 #> TRUE 2124 16.67 #> -------------------------------------------------------------------------------- #> PCGDP (numeric): GDP per capita (constant 2010 US$) #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 8995 11563.65 18348.41 131.65 191586.64 3.11 16.96 #> Between 203 12488.86 19628.37 255.4 141165.08 3.21 17.25 #> Within 44.31 11563.65 6334.95 -30529.09 75348.07 0.7 17.05 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 223.54 374.38 1215.59 3619.61 14084.71 46591.94 87780.62 #> -------------------------------------------------------------------------------- #> LIFEEX (numeric): Life expectancy at birth, total (years) #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 11068 63.84 11.45 18.91 85.42 -0.67 2.65 #> Between 207 64.53 10.02 39.35 85.42 -0.53 2.23 #> Within 53.47 63.84 5.83 33.47 83.86 -0.25 3.75 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 35.49 42.23 55.84 66.97 72.5 78.82 81.83 #> -------------------------------------------------------------------------------- #> GINI (numeric): GINI index (World Bank estimate) #> Stats: #> N/T Mean SD Min Max Skew Kurt #> Overall 1356 39.4 9.68 16.2 65.8 0.46 2.29 #> Between 161 39.58 8.37 23.37 61.71 0.52 2.67 #> Within 8.42 39.4 3.04 23.96 54.8 0.14 5.78 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 24.66 26.5 31.7 37.4 46.8 57.2 60.84 #> -------------------------------------------------------------------------------- #> ODA (numeric): Net ODA received (constant 2015 US$) #> Stats: #> N/T Mean SD Min Max Skew #> Overall 8336 428,746468 819,868971 -1.08038000e+09 2.45521800e+10 7.19 #> Between 178 418,026522 548,293709 423846.15 3.53258914e+09 2.47 #> Within 46.83 428,746468 607,024040 -2.47969577e+09 2.35093916e+10 10.3 #> Kurt #> Overall 122.9 #> Between 10.65 #> Within 298.12 #> #> Quant: #> 1% 5% 25% 50% 75% 95% #> -11,731500 1,097500 41,020000 157,360000 463,057500 1.82400500e+09 #> 99% #> 3.48697750e+09 #> --------------------------------------------------------------------------------
## Grouped Statistics descr(iris, g = iris$Species)
#> Dataset: iris, 5 Variables, N = 150 #> -------------------------------------------------------------------------------- #> Sepal.Length (numeric): #> Stats: #> N Mean SD Min Max Skew Kurt #> setosa 50 5.01 0.35 4.3 5.8 0.12 2.65 #> versicolor 50 5.94 0.52 4.9 7 0.1 2.4 #> virginica 50 6.59 0.64 4.9 7.9 0.11 2.91 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 4.4 4.6 5.1 5.8 6.4 7.25 7.7 #> -------------------------------------------------------------------------------- #> Sepal.Width (numeric): #> Stats: #> N Mean SD Min Max Skew Kurt #> setosa 50 3.43 0.38 2.3 4.4 0.04 3.74 #> versicolor 50 2.77 0.31 2 3.4 -0.35 2.55 #> virginica 50 2.97 0.32 2.2 3.8 0.35 3.52 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 2.2 2.34 2.8 3 3.3 3.8 4.15 #> -------------------------------------------------------------------------------- #> Petal.Length (numeric): #> Stats: #> N Mean SD Min Max Skew Kurt #> setosa 50 1.46 0.17 1 1.9 0.1 3.8 #> versicolor 50 4.26 0.47 3 5.1 -0.59 2.93 #> virginica 50 5.55 0.55 4.5 6.9 0.53 2.74 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1.15 1.3 1.6 4.35 5.1 6.1 6.7 #> -------------------------------------------------------------------------------- #> Petal.Width (numeric): #> Stats: #> N Mean SD Min Max Skew Kurt #> setosa 50 0.25 0.11 0.1 0.6 1.22 4.43 #> versicolor 50 1.33 0.2 1 1.8 -0.03 2.51 #> virginica 50 2.03 0.27 1.4 2.5 -0.13 2.34 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.1 0.2 0.3 1.3 1.8 2.3 2.5 #> -------------------------------------------------------------------------------- #> Species (factor): #> Stats: #> N Ndist #> 150 3 #> #> Table: #> Freq Perc #> setosa 50 33.33 #> versicolor 50 33.33 #> virginica 50 33.33 #> --------------------------------------------------------------------------------
descr(GGDC10S, g = GGDC10S$Region)
#> Dataset: GGDC10S, 16 Variables, N = 5027 #> -------------------------------------------------------------------------------- #> Country (character): Country #> Stats: #> N Ndist #> 5027 43 #> #> Table: #> Freq Perc #> ARG 124 2.47 #> BOL 123 2.45 #> BRA 124 2.47 #> BWA 104 2.07 #> CHL 125 2.49 #> CHN 125 2.49 #> COL 123 2.45 #> --- #> Freq Perc #> SWE 126 2.51 #> THA 124 2.47 #> TWN 126 2.51 #> TZA 104 2.07 #> USA 129 2.57 #> VEN 125 2.49 #> ZAF 104 2.07 #> ZMB 104 2.07 #> #> Summary of Table: #> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 4 105 124 117 126 129 #> -------------------------------------------------------------------------------- #> Regioncode (character): Region code #> Stats: #> N Ndist #> 5027 6 #> #> Table: #> Freq Perc #> ASI 1372 27.29 #> EUR 1004 19.97 #> LAM 1117 22.22 #> MENA 257 5.11 #> NAM 129 2.57 #> SSA 1148 22.84 #> -------------------------------------------------------------------------------- #> Region (character): Region #> Stats: #> N Ndist #> 5027 6 #> #> Table: #> Freq Perc #> Asia 1372 27.29 #> Europe 1004 19.97 #> Latin America 1117 22.22 #> Middle East and North Africa 257 5.11 #> North America 129 2.57 #> Sub-saharan Africa 1148 22.84 #> -------------------------------------------------------------------------------- #> Variable (character): Variable #> Stats: #> N Ndist #> 5027 2 #> #> Table: #> Freq Perc #> EMP 2516 50.05 #> VA 2511 49.95 #> -------------------------------------------------------------------------------- #> Year (numeric): Year #> Stats: #> N Mean SD Min Max Skew Kurt #> Asia 1372 1980.69 18.01 1950 2012 0 1.8 #> Europe 1004 1979.99 18.14 1948 2011 -0 1.8 #> Latin America 1117 1980.53 17.92 1950 2012 0 1.8 #> Middle East and North Africa 257 1980.62 18.6 1948 2013 -0 1.8 #> North America 129 1978.75 18.69 1947 2011 0 1.8 #> Sub-saharan Africa 1148 1985.59 15.07 1960 2013 0 1.8 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 1950 1953 1967 1982 1997 2009 2011 #> -------------------------------------------------------------------------------- #> AGR (numeric): Agriculture #> Stats: #> N Mean SD Min #> Asia 1103 9,239810.75 73,388917.1 5.24 #> Europe 791 8703.97 11906.16 69.65 #> Latin America 1049 485922.33 3,170330.86 0 #> Middle East and North Africa 203 21797.51 38344.85 412.17 #> North America 125 33982.97 42429.57 2061.82 #> Sub-saharan Africa 1093 283350.54 1,427564.7 0.04 #> Max Skew Kurt #> Asia 1.19187778e+09 12.01 162.23 #> Europe 57488.44 1.61 4.76 #> Latin America 39,194000 8.82 86.32 #> Middle East and North Africa 243355.5 2.91 13.21 #> North America 161017 1.25 3.36 #> Sub-saharan Africa 17,625142.9 7.33 64.98 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.09 23.18 930.7 4394.52 29781.04 2,393977.49 24,932575.1 #> -------------------------------------------------------------------------------- #> MIN (numeric): Mining #> Stats: #> N Mean SD Min #> Asia 1103 6,714864.24 63,913433.6 0.16 #> Europe 782 3388.68 7699.3 2.8 #> Latin America 1049 501758.2 3,672600.12 0 #> Middle East and North Africa 203 10615.2 36879.15 10.34 #> North America 125 35859.04 61778.02 550.95 #> Sub-saharan Africa 1093 176227.49 1,195624.72 0.01 #> Max Skew Kurt #> Asia 1.10344053e+09 12.7 180.6 #> Europe 64788.06 4.17 24.65 #> Latin America 69,625000 11.68 171.51 #> Middle East and North Africa 290739 5.32 33.85 #> North America 316776 2.37 8.87 #> Sub-saharan Africa 15,568361.4 8.87 88.61 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.02 1.2 38.95 173.22 4841.26 713420.36 14,309891.9 #> -------------------------------------------------------------------------------- #> MAN (numeric): Manufacturing #> Stats: #> N Mean SD Min #> Asia 1103 20,767547.9 124,017608 136.89 #> Europe 782 55223.95 91748.81 333.81 #> Latin America 1049 960811.72 6,047028.87 0 #> Middle East and North Africa 203 22235.72 43022.59 240.69 #> North America 125 343074.7 506122.03 12897.93 #> Sub-saharan Africa 1093 105260.5 555212.8 0.02 #> Max Skew Kurt #> Asia 1.86843541e+09 10.41 126.86 #> Europe 537796 2.36 9.34 #> Latin America 78,124000 9.11 93.92 #> Middle East and North Africa 262505 2.92 13.02 #> North America 1,766043.9 1.49 3.85 #> Sub-saharan Africa 7,676500 8.67 88.74 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.05 27.31 620.44 3718.1 52805.35 2,978846.99 108,499037 #> -------------------------------------------------------------------------------- #> PU (numeric): Utilities #> Stats: #> N Mean SD Min #> Asia 1102 1,081364.11 4,793872.69 7.6 #> Europe 782 7111.43 13622.47 10.81 #> Latin America 1049 223292.44 1,609737.47 0 #> Middle East and North Africa 203 2529.68 4910.63 7.74 #> North America 125 44068.95 71925.42 463.21 #> Sub-saharan Africa 1093 22020.25 122089.09 0 #> Max Skew Kurt #> Asia 65,324543.8 7.48 74.61 #> Europe 102773.96 3 14.93 #> Latin America 20,679000 9.54 100.25 #> Middle East and North Africa 21237 2.15 6.7 #> North America 270330.51 1.64 4.45 #> Sub-saharan Africa 1,825400 9.03 99.43 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0 2.16 25.74 167.95 4892.25 291356.48 11,866259.3 #> -------------------------------------------------------------------------------- #> CON (numeric): Construction #> Stats: #> N Mean SD Min #> Asia 1103 6,600043.18 48,055878.8 43.1 #> Europe 782 17622.97 28584.79 128.19 #> Latin America 1049 436012.48 2,950538.7 0 #> Middle East and North Africa 203 6642.93 13037.94 26.83 #> North America 125 106162.3 178402.17 3676.41 #> Sub-saharan Africa 1093 73497.7 550630.53 0.02 #> Max Skew Kurt #> Asia 860,638677 13.2 197.66 #> Europe 181205.76 2.09 7.57 #> Latin America 42,701000 10.26 122.29 #> Middle East and North Africa 76747 2.9 11.81 #> North America 692087 1.91 5.54 #> Sub-saharan Africa 10,588300 12.92 201.92 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.02 15.03 215.57 1473.45 13514.84 829361.57 37,430603.6 #> -------------------------------------------------------------------------------- #> WRT (numeric): Trade, restaurants and hotels #> Stats: #> N Mean SD Min #> Asia 1103 12,283373.8 72,524320 152.9 #> Europe 782 40872.35 67182.39 344.71 #> Latin America 1049 847999.29 5,294147.93 0 #> Middle East and North Africa 203 18578.82 37541.51 150.8 #> North America 125 400759.76 642511.02 12579.48 #> Sub-saharan Africa 1093 230722.57 1,341125.15 0.01 #> Max Skew Kurt #> Asia 1.15497404e+09 10.7 135.87 #> Europe 402210.76 2.07 7.41 #> Latin America 69,154000 8.99 92.21 #> Middle East and North Africa 236592 3.16 14.71 #> North America 2,308153.02 1.73 4.73 #> Sub-saharan Africa 19,486200 9.12 98.41 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.03 25.07 650.38 3773.64 41648.17 2,646521.57 79,618054.2 #> -------------------------------------------------------------------------------- #> TRA (numeric): Transport, storage and communication #> Stats: #> N Mean SD Min #> Asia 1103 5,245717.6 33,003641.5 79 #> Europe 782 21148.54 36686.15 126.24 #> Latin America 1049 466527.62 2,956458.95 0 #> Middle East and North Africa 203 10652.28 23253.57 71.99 #> North America 125 134171.2 216436.13 4523.41 #> Sub-saharan Africa 1093 96252.2 634046.34 0.02 #> Max Skew Kurt #> Asia 547,047040 11.55 155.7 #> Europe 215350.33 2.36 9.1 #> Latin America 38,249000 9.14 95.02 #> Middle East and North Africa 144115 3.43 16.24 #> North America 788678.73 1.72 4.74 #> Sub-saharan Africa 9,773441.71 10.72 131.86 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.05 12.28 205.79 1174.8 18927.21 1,059843.16 31,750009.1 #> -------------------------------------------------------------------------------- #> FIRE (numeric): Finance, insurance, real estate and business services #> Stats: #> N Mean SD Min #> Asia 1103 5,592444.02 26,438065.9 23.1 #> Europe 782 17666.27 42118.1 63.39 #> Latin America 1049 797458.31 4,792126.14 -2848.81 #> Middle East and North Africa 203 14224.06 29896 12.45 #> North America 125 683714.58 1,307383.3 4237.91 #> Sub-saharan Africa 1093 100245.92 723873 0.01 #> Max Skew Kurt #> Asia 387,997506 8.59 96.57 #> Europe 310690 3.62 17.44 #> Latin America 61,965134.9 8.63 87.76 #> Middle East and North Africa 146593 2.54 9.01 #> North America 6,235285.98 2.24 7.3 #> Sub-saharan Africa 11,650290.1 11.09 139.1 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0 3.87 128.18 960.13 13460.4 1,599086.92 55,536957 #> -------------------------------------------------------------------------------- #> GOV (numeric): Government services #> Stats: #> N Mean SD Min #> Asia 868 6,551795.16 33,523686 0 #> Europe 782 57514.37 103507.97 154.58 #> Latin America 457 104151.17 376988.85 0 #> Middle East and North Africa 203 12613.11 25698.6 115.56 #> North America 125 439395.77 747123.15 11825.64 #> Sub-saharan Africa 1047 119592.28 722111.59 0.02 #> Max Skew Kurt #> Asia 485,535400 9.29 107.95 #> Europe 649612.02 2.56 10.43 #> Latin America 3,729607.87 5.78 43.44 #> Middle East and North Africa 174713.3 3.53 17.75 #> North America 3,065984.37 1.96 5.88 #> Sub-saharan Africa 10,003050.2 11.06 154.29 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.02 48.14 723.98 3928.51 37689.12 1,400263.37 56,340246.3 #> -------------------------------------------------------------------------------- #> OTH (numeric): Community, social and personal services #> Stats: #> N Mean SD Min #> Asia 1102 5,482995.35 29,561814 78.01 #> Europe 782 11692.75 20661.59 91.22 #> Latin America 1049 1,023708.74 6,978936.81 0 #> Middle East and North Africa 97 20033.42 24498.46 111.81 #> North America 125 83558.9 148752.62 2534.34 #> Sub-saharan Africa 1093 16659.52 86821.36 0 #> Max Skew Kurt #> Asia 402,671182 7.99 77.77 #> Europe 133230.69 2.43 9.68 #> Latin America 92,333000 9.21 96.28 #> Middle East and North Africa 90814 1.38 3.85 #> North America 559681.65 2 5.77 #> Sub-saharan Africa 1,411950.45 10.75 139.55 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.02 15.92 310.09 1433.17 13321.29 605013.39 42,264477.4 #> -------------------------------------------------------------------------------- #> SUM (numeric): Summation of sector GDP #> Stats: #> N Mean SD Min #> Asia 1103 78,158110 495,362238 650.9 #> Europe 791 238302.84 400180.41 513.59 #> Latin America 1049 5,788864.9 37,131918.6 0 #> Middle East and North Africa 203 129461.93 261686.6 1791.12 #> North America 125 2,304748.18 3,896447.24 62539.2 #> Sub-saharan Africa 1093 1,218795.8 6,786969.12 0.13 #> Max Skew Kurt #> Asia 8.06794210e+09 11.37 150.7 #> Europe 2,539942.74 2.29 9.09 #> Latin America 512,024135 9.32 100.02 #> Middle East and North Africa 1,650962.8 3.11 14.22 #> North America 15,918306.8 1.91 5.57 #> Sub-saharan Africa 91,111865.3 8.63 87.7 #> #> Quant: #> 1% 5% 25% 50% 75% 95% 99% #> 0.38 269.63 4803.94 23186.19 284646.08 15,030223.5 435,513356 #> --------------------------------------------------------------------------------