# NOT RUN {
##### Example 1 #####
data(rock)
res = corr_tests( d = rock,
X = c("area"),
C = NA,
Ys = c("perm", "peri", "shape"),
method = "nreject" )
# mean rejections in resamples
# should be close to 0.05 * 3 = 0.15
mean( as.numeric(res$nrej.bt) )
# }
# NOT RUN {
# }
# NOT RUN {
##### Example 1 #####
cor = make_corr_mat( nX = 10,
nY = 20,
rho.XX = 0.10,
rho.YY = 0.5,
rho.XY = 0.1,
prop.corr = .4 )
d = sim_data( n = 300, cor = cor )
# X1 is the covariate of interest, and all other X variables are adjusted
all.covars = names(d)[ grep( "X", names(d) ) ]
C = all.covars[ !all.covars == "X1" ]
# may take 10 min to run
res = corr_tests( d,
X = "X1",
C = C,
Ys = names(d)[ grep( "Y", names(d) ) ],
method = "nreject" )
# look at the main results
res$null.int
res$excess.hits
res$global.test
# }
Run the code above in your browser using DataLab