hanaml.KsTest.Rd
hanaml.KsTest is a R wrapper for SAP HANA PAL Kolmogorov-Smirnov test.
hanaml.KsTest(
data,
distribution.name = NULL,
distribution.parameter = NULL,
test.type = NULL
)
DataFrame
DataFrame containting the data.
character, optional
The distribution name. If not provided, it will take first two columns to do the two-sample test.
"beta"
"cauchy"
"chi_square"
"exponential"
"gamma"
"lognormal"
"normal"
"student_t"
"uniform"
"weibull"
list, optional
The distribution parameter for the given distribution. The name is the parameter name.
"beta" : list("shape1"=0.5, "shape2"=0.5)
"cauchy" : list("location"=0, "scale"=1)
"chi_square" : list("degrees_of_freedom"=1)
"exponential" : list("rate"=1)
"gamma" : list("shape"=1, "scale"=1)
"lognormal" : list("location"=0, "scale"=1)
"normal" : list("mean"=0, "sd"=1)
"students_t" : list("degrees_of_freedom"=1)
"uniform" :list("min"= 0, "max"=1)
"weibull" : list("shape"=1, "scale"= 1)
c("two-sided", "less", "greater"), optional
Defines the null and alternative hypotheses.
Defaults to "two-sided".
DataFrame
Returned statistics, structured as follows:
STAT_NAME
: name of the statistics including KS statistic and p-value.
STAT_VALUE
: values of the statistics.
hanaml.KsTest performs one-sample or two-sample Kolmogorov-Smirnov test for goodness of fit.
Input DataFrame data:
> data$head(3)$Collect()
DATA
0 0.58
1 0.42
2 0.52
3 0.33
4 0.43
5 0.23
6 0.58
7 0.76
8 0.53
9 0.64
Invoke the function:
> res <- hanaml.KsTest(data=data,
distribution.name="uniform",
distribution.parameter=list("min"=0, "max"=1)
Output:
> res$Collect()
NAME VALUE
0 KS statistic 0.26
1 p-value 0.4466