Learn R Programming

Sim.DiffProc (version 2.5)

test_ks_dnorm: Kolmogorov-Smirnov Tests (Normal Distribution)

Description

Performs one sample Kolmogorov-Smirnov tests.

Usage

test_ks_dnorm(X, mean, sd)

Arguments

X
a numeric vector of data values.
mean
mean of the distribution.
sd
standard deviation of the distribution.

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the test statistic.
  • p.valuethe p-value of the test.
  • alternativea character string describing the alternative hypothesis.
  • data.namea character string giving the name(s) of the data.

Details

see detail ks.test.

Examples

Run this code
## Example 1
 X <- rnorm(1000,1,1)
 test_ks_dnorm(X, mean=1, sd=1)
 test_ks_dlognorm(exp(X), meanlog=1, sdlog=1)
## Example 2
 X = c(runif(100),rt(200,20),rnorm(200))
 X = sample(X)
 test_ks_dnorm(X, mean=mean(X), sd=sd(X))

Run the code above in your browser using DataLab