Question: Using R Provide the code that parallelizes the following: library ( MKinfer ) # Load package used for permutation t - test # Create a
Using R Provide the code that parallelizes the following:
libraryMKinfer # Load package used for permutation ttest
# Create a function for running the simulation:
simulatetypeI functionn n distr, level B alternative "two.sided",
# Create a data frame to store the results in:
pvalues data.framepttest repNA Bppermttest repNA Bpwilcoxon repNA B
fori in :B
# Generate data:
x distrn
y distrn
# Compute pvalues:
pvaluesi ttestx y
alternative alternative$pvalue
pvaluesi perm.ttestx yalternative alternative,R $perm.pvalue
pvaluesi wilcox.testx yalternative alternative$pvalue
# Return the type I error rates:
returncolMeanspvalues level
Provide the code that runs the following code in parallel with workers with mclapply:
lapplyairquality functionxxmeanxsdx
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
