Descriptives: Descriptives

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Calculating to return answer which are descriptive statistics values for a continuously variable or continuously variables in data frame.

Usage

1
Descriptives(x, plot = FALSE, r = 2, answer = 1, statistic = "ALL")

Arguments

x

A continuously variable or a data frame contain continuously variables.

plot

Parameter 'Plot' are used by 2 form:

Let plot=TRUE to paint description graph when x is time series.

Let plot=list(a1,a2,...) (in a1,a2,...are descriptive statistic values as 'Mean', 'Max',...) to paint comparing graph between variables.

r

Rounds the answer to the specified number of decimal places (default 2).(See round2str for details of r paramicter.)

answer

Form of answers are returned. Let answer=1 or answer=2 (default 1)

statistic

A list contain descriptive statistic values that user want R print screen (default ALL).

Details

Statistic descriptive values are calculated by theory of base statistic.

Value

N

Length sample

NaN

Number NA values

Min

Min value

1sq QU

Value in 25% of interval probabilities

Median

Median value

Mean

Mean value

3rd QU

Value in 75% of interval probabilities

Max

Max value

VAR

Variance value

SD

Standard Deviation

SE

Standard Deviation of the Estimated Means

Note

You must not withdraw discrete variables from data frame. When you let a data frame in to this function which will auto withdraw discrete variables and calculate descriptive statistic to continuously variables.

Author(s)

Mai Thi Hong Diem <maidiemks@gmail.com>

Hong Viet Minh <hongvietminh@gmail.com>

References

Theory of base statistic.

See Also

Frequencies, Dgroup

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#Load data
library(MASS)
data(crabs)

#Calculate descriptive statistic to a continuously variable
Descriptives(crabs$FL)

#Calculate descriptive statistic to continuously variables
Descriptives(crabs)
Descriptives(crabs,answer=2)
Descriptives(crabs,answer=2,r=6)

#To just see some descriptive statistic variables
Descriptives(crabs,statistic=list("Min","Mean","Median","Max"))

#Combined paint graph to compare
Descriptives(crabs,plot=list("Mean","SD"))

#Descriptives for time series
Descriptives(lh,plot=TRUE)

Example output

Loading required package: MASS
Loading required package: TSA
Loading required package: leaps
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-20. For overview type 'help("mgcv-package")'.
Loading required package: tseries

Attaching package: 'TSA'

The following objects are masked from 'package:stats':

    acf, arima

The following object is masked from 'package:utils':

    tar

Loading required package: TTR
Loading required package: urca

Attaching package: 'AnalyzeTS'

The following object is masked from 'package:base':

    pmax

              
N:      200.00
NaN:      0.00
Min:      7.20
1sq QU:  12.90
Median:  15.55
Mean:    15.58
3rd QU:  18.05
Max:     23.10
VAR:     12.21
SD:       3.49
SE:       0.24
         index     FL     RW     CL     CW     BD
N:      200.00 200.00 200.00 200.00 200.00 200.00
NaN:      0.00   0.00   0.00   0.00   0.00   0.00
Min:      1.00   7.20   6.50  14.70  17.10   6.10
1sq QU:  13.00  12.90  11.00  27.27  31.50  11.40
Median:  25.50  15.55  12.80  32.10  36.80  13.90
Mean:    25.50  15.58  12.73  32.10  36.41  14.03
3rd QU:  38.00  18.05  14.30  37.22  42.00  16.60
Max:     50.00  23.10  20.20  47.60  54.60  21.60
VAR:    209.29  12.21   6.62  50.67  61.96  11.72
SD:      14.46   3.49   2.57   7.11   7.87   3.42
SE:       1.02   0.24   0.18   0.50   0.55   0.24
       N: NaN: Min: 1sq QU: Median: Mean: 3rd QU: Max:   VAR:   SD:  SE:
index 200    0  1.0   13.00   25.50 25.50   38.00 50.0 209.29 14.46 1.02
FL    200    0  7.2   12.90   15.55 15.58   18.05 23.1  12.21  3.49 0.24
RW    200    0  6.5   11.00   12.80 12.73   14.30 20.2   6.62  2.57 0.18
CL    200    0 14.7   27.27   32.10 32.10   37.22 47.6  50.67  7.11 0.50
CW    200    0 17.1   31.50   36.80 36.41   42.00 54.6  61.96  7.87 0.55
BD    200    0  6.1   11.40   13.90 14.03   16.60 21.6  11.72  3.42 0.24
       N: NaN: Min: 1sq QU: Median:   Mean: 3rd QU: Max:       VAR:       SD:
index 200    0  1.0  13.000   25.50 25.5000  38.000 50.0 209.296482 14.467082
FL    200    0  7.2  12.900   15.55 15.5830  18.050 23.1  12.217297  3.495325
RW    200    0  6.5  11.000   12.80 12.7385  14.300 20.2   6.622078  2.573339
CL    200    0 14.7  27.275   32.10 32.1055  37.225 47.6  50.679919  7.118983
CW    200    0 17.1  31.500   36.80 36.4145  42.000 54.6  61.967678  7.871955
BD    200    0  6.1  11.400   13.90 14.0305  16.600 21.6  11.729065  3.424772
           SE:
index 1.022977
FL    0.247156
RW    0.181962
CL    0.503388
CW    0.556631
BD    0.242167
        index    FL    RW   CL    CW    BD
Min:      1.0  7.20  6.50 14.7 17.10  6.10
Median:  25.5 15.55 12.80 32.1 36.80 13.90
Mean:    25.5 15.58 12.73 32.1 36.41 14.03
Max:     50.0 23.10 20.20 47.6 54.60 21.60
         index     FL     RW     CL     CW     BD
N:      200.00 200.00 200.00 200.00 200.00 200.00
NaN:      0.00   0.00   0.00   0.00   0.00   0.00
Min:      1.00   7.20   6.50  14.70  17.10   6.10
1sq QU:  13.00  12.90  11.00  27.27  31.50  11.40
Median:  25.50  15.55  12.80  32.10  36.80  13.90
Mean:    25.50  15.58  12.73  32.10  36.41  14.03
3rd QU:  38.00  18.05  14.30  37.22  42.00  16.60
Max:     50.00  23.10  20.20  47.60  54.60  21.60
VAR:    209.29  12.21   6.62  50.67  61.96  11.72
SD:      14.46   3.49   2.57   7.11   7.87   3.42
SE:       1.02   0.24   0.18   0.50   0.55   0.24
             
N:      48.00
NaN:     0.00
Min:     1.40
1sq QU:  2.00
Median:  2.30
Mean:    2.40
3rd QU:  2.75
Max:     3.50
VAR:     0.30
SD:      0.55
SE:      0.07

AnalyzeTS documentation built on Dec. 9, 2019, 1:07 a.m.