desc: Descriptive statistics

View source: R/desc.R

descR Documentation

Descriptive statistics

Description

[Experimental]

  • desc() estimates the descriptive statistics such as Min(Minimum), ⁠1st Qu.⁠(quartile), Median, Mean (average), ⁠3rd Qu.⁠(3rd quartile), Max(maximum), var (variance), std.dev(standard deviation), coef.var (CV or coefficient of variation) of the data set.

Usage

desc(datap, resp)

Arguments

datap

The data set

resp

an integer value indicating the column in datap that corresponds to the response variable.

Details

The desc() function estimates the descriptive statistics, in tables for one or more independent (exogenous) variables on a dependent(endogenous) variable. It acts only on numerical variables. For example for the variable x:

\loadmathjax
  • ⁠1st. quartile:⁠ \mjsdeqnQ_1 = (n + 1) x 1/4

  • ⁠2nd. quartile or Median:⁠ \mjsdeqnmd = (n + 1) x 2/4

  • ⁠3rd Qu.:⁠ \mjsdeqnQ_3 = (n + 1) x 3/4

  • ⁠Arithmetic mean:⁠ \mjsdeqn\barx=\frac1n \sum_i=i^n x_i

  • ⁠Range:⁠ \mjsdeqnR_x = \max(x) - \min(x)

  • Variance: \mjsdeqn\sigma_x^2 = \frac\sum_i=1^n(x_i-\barx)^2n

  • ⁠Standard deviation:⁠ \mjsdeqnsd_x = \sqrt\frac\sum_i (x_i - \mu)^2n

  • ⁠SEM or SE.mean⁠, the standard error of the mean is calculated simply by taking the standard deviation and dividing it by the square root of the sample size: \mjsdeqnSEM_x = \fracsd(x)\sqrtn

  • ⁠coef.var or coefficient of variation:⁠ \mjsdeqnCV = \fracsd(x)\barx \times 100

Value

Returns a list of 3 objects:

desc1

Descriptive statistics1 of input data

desc2

Descriptive statistics2 of input data

corcf

A table of correlation coefficients

Author(s)

Ali Arminian abeyran@gmail.com

References

Bhattacharyya GK and Johnson RA 1997. Statistical Concepts and Methods, John Wiley and Sons, New York.

Draper N and Smith H 1981. Applied Regression Analysis, John Wiley & Sons, New York.

Neter, J, Whitmore, GA, Wasserman, W 1992. Applied Statistics. Allyn & Bacon, Incorporated, ISBN 10: 0205134785 / ISBN 13: 9780205134786.

Snedecor, G.W., Cochran, W.G. 1980. Statistical Methods. Iowa State University Press.

See Also

correlation, multiple linear regression,

Examples


data(dtsimp)
desc(dtsimp, 1)


data(dtraw)
desc(dtraw[, -1], 1)

data(heart)
desc(heart, 2)



Path.Analysis documentation built on Sept. 30, 2024, 9:25 a.m.