Dgroup: Discriptives Follow Groups

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

Description

Descriptive statistics in group for a continous variable. Usual using to statistic a time series following dates in week or months in year.

Usage

1
Dgroup(x, follow = NULL, r = 2, answer = 1, statistic = "ALL")

Arguments

x

A continous variable or a time series.

follow

A factor or a list factor which contain not too two factors.

r

Rounds the answer to the specified number of decimal places (default 2).

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

Data is divided into groups by follow and then every group are calculated by Descriptives function.

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

The function just maximum calculated for two factors.

Author(s)

Hong Viet Minh <hongvietminh@gmail.com>

References

Theory of base statistic.

See Also

Descriptives,Frequencies

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#Factor date
date<-as.factor(c("Tue","Wed","Thu","Fri","Mon","Tue","Wed","Thu","Fri","Mon",
"Tue","Wed","Thu","Fri","Mon","Tue","Wed","Thu","Fri","Mon","Tue","Wed","Thu",
"Fri","Mon","Tue","Wed","Thu","Fri","Mon","Tue","Wed","Thu"))

#Factor hk
hk<-as.factor(c("hk1","hk2","hk1","hk3","hk3","hk1","hk1","hk1","hk2","hk2","hk2",
"hk1","hk2","hk1","hk1","hk1","hk2","hk1","hk1","hk1","hk1","hk2","hk1",
"hk1","hk1","hk1","hk3","hk1","hk3","hk3","hk2","hk3","hk1"))

#A continous variable
coffee<-c(5,6,8,4,3,7,6,0,3,2,3,4,9,1,3,8,7,8,2,3,8,6,4,4,6,7,6,5,2,3,8,4,4)

#Descriptive statistics in group
Dgroup(coffee,r=4,answer=2)
Dgroup(coffee,follow=list(date),r=4)
Dgroup(coffee,follow=date,r=4,answer=2)
Dgroup(coffee,follow=date,r=4,statistic=list("Mean","Max"))
Dgroup(coffee,r=4,follow=list(date,hk),answer=1)
Dgroup(coffee,r=4,follow=list(date,hk),answer=2)
Dgroup(coffee,r=4,follow=list(hk,date),answer=1)
Dgroup(coffee,r=4,follow=list(hk,date),answer=2)

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