sd_sk: Calculate the standard error of q sample quantile using exact...

Description Usage Arguments Details Value Examples

View source: R/ex.R

Description

Calculate the standard error of q sample quantile using exact variance formula of skewness

Usage

1
sd_sk(x, q, n)

Arguments

x

the quantiles of skewness coefficient

q

quantiles

n

number of samples

Details

The variance of q sample quantile of skewness is Var(hat(x[q]))=frac(q(1-q),nf^2*(x)) where f is the density of the sampled distribution. Using the normal approximation for the density, the skewness is asymptotically normal with mean 0 and variance frac(6(n-2),(n+1)(n+3))

Value

the standard error of q sample quantile of skewness coefficient

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
 m=1000;n=100
 stat = replicate(m, expr={
 x = rnorm(n)
 y = sk(x)
 })
 q = c(.025,.05,.95,.975)
 x = quantile(stat,q)
 print('The standard error of the estimates:');sd_sk(x,q,n)

## End(Not run)

XixuHu/SC19090 documentation built on Jan. 2, 2020, 8:40 p.m.