Description Usage Arguments Details Value Note Author(s) References See Also Examples
Descriptive statistics in group for a continous variable. Usual using to statistic a time series following dates in week or months in year.
1 |
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). |
Data is divided into groups by follow and then every group are calculated by Descriptives function.
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 |
The function just maximum calculated for two factors.
Hong Viet Minh <hongvietminh@gmail.com>
Theory of base statistic.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.