Learn R Programming

Path.Analysis (version 0.1)

desc: 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)

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

Arguments

datap

The data set

resp

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

Author

Ali Arminian abeyran@gmail.com

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:

  • 1st. quartile: Q_1 = (n + 1) x 1/4

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

  • 3rd Qu.: Q_3 = (n + 1) x 3/4

  • Arithmetic mean: x=1n _i=i^n x_i

  • Range: R_x = (x) - (x)

  • Variance: _x^2 = _i=1^n(x_i-x)^2n

  • Standard deviation: sd_x = _i (x_i - )^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: SEM_x = sd(x)n

  • coef.var or coefficient of variation: CV = sd(x)x 100

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

Run this code
# \donttest{
data(dtsimp)
desc(dtsimp, 1)
# }
# \donttest{
data(dtraw)
desc(dtraw[, -1], 1)

data(heart)
desc(heart, 2)
# }

Run the code above in your browser using DataLab