r <- 4
n <- 200
p <- 20
mu <- (1:p)/p
cov <- diag(length(mu))
set.seed(108)
data <- MASS::mvrnorm(n, mu, cov)
sample.mean <- colMeans(data)
## softmin.LOO
difference.matrix.r <- matrix(rep(data[,r], p-1), ncol=p-1, byrow=FALSE) - data[,-r]
argmin.HT(difference.matrix.r)
## use seed
argmin.HT(difference.matrix.r, seed=19)
# provide centered test statistic (to simulate asymptotic normality)
true.mean.difference.r <- mu[r] - mu[-r]
argmin.HT(difference.matrix.r, true.mean=true.mean.difference.r)
# keep the data unstandardized
argmin.HT(difference.matrix.r, scale.input=FALSE)
# use an user-specified lambda
argmin.HT(difference.matrix.r, lambda=sqrt(n)/2.5)
# add a seed
argmin.HT(difference.matrix.r, seed=19)
## argmin.LOO/hard min
argmin.HT(difference.matrix.r, method='HML')
## nonsplit
argmin.HT(difference.matrix.r, method='NS', lambda=sqrt(n)/2.5)
## Bonferroni (choose t test because of normal data)
argmin.HT(difference.matrix.r, method='MT', test='t')
## z test
argmin.HT(difference.matrix.r, method='MT', test='z')
## Gupta
critical.val <- get.quantile.gupta.selection(p=length(mu))
argmin.HT(data, r, method='GTA', critical.val=critical.val)
Run the code above in your browser using DataLab