# NOT RUN {
set.seed(1234)
selected.r <- "weib" #select Weibull as the distribution
shape <- 1 # specify shape parameter
scale <- 1 # specify scale parameter
n <- 100 # specify sample size
param <- 0.9 # specify parameter
xout<-r.sample(n,selected.r,shape,scale) # specify sample
Rhostar.p.exact(xout,param,selected.r,shape,scale) # calculate Rhostar.p.exact
#-0.05206678 # returns the result
selected.r2 <- "norm" #select Normal as the distribution
n <- 100 # specify sample size
mean <- 0 # specify the mean
sd <- 1 # specify the variance
param <- 0.9 # specify parameter
xout <-r.sample(n,selected.r2,mean,sd) # specify sample
Rhostar.p.exact(xout,param,selected.r2,mean,sd) # calculate Rhostar.p.exact
#-0.008687447 # returns the result
selected.r3 <- "cauchy" #select Cauchy as the distribution
n <- 100 # specify sample size
location <- 0 # specify the location parameter
scale <- 1 # specify the scale parameter
param <- 0.9 # specify parameter
xout<-r.sample(n,selected.r3,location,scale) # specify sample
Rhostar.p.exact(xout,param,selected.r3,location,scale) # calculate Rhostar.p.exact
#0.0280602 # returns the result
# }
Run the code above in your browser using DataLab