catEffectBootAdaptor: Adaptor for testing category effects in simulations using the...

Description Usage Arguments Value Author(s) See Also Examples

Description

Adaptor for testing category effects in simulations using the boot package and function.

Usage

1
catEffectBootAdaptor(df, index, testFnc = sumSqCat, useResp = TRUE, ...)

Arguments

df

dataframe structured as that returned by simCatResp, with category, bkg, resp columns.

index

index for rearrangement of data as provided by boot function

testFnc

function to calculate test statistic based its first argument, using the category labels in the second argument, and passed the other arguments (...) given to this adaptor function.

useResp

true if the statistic should be calculated for the rearranged resp column of the dataframe, otherwise false to use the bkg column.

...

other arguments to pass to the testFnc

Value

value of the test statistic

Author(s)

Peter N. Steinmetz <PeterNSteinmetz@steinmetz.org>

See Also

boot

Examples

1
2
3
4
5
6
7
8
9
  # Simulate 4 categories of responses and then compute the number of times
  # there would be a significant effect of a change in the categories relative
  # to background using the CBT. This would form a rough estimate of the power
  # of the CBT to detect such changes.
  library(boot)
  library(EffectsRelBaseline)
  simCatResp(1,c(1,1.5,2,1),6)->sim3
  boot(sim3,catEffectBootAdaptor,100,backMean=mean(1,1.5,2,1))->boot3
  sum(boot3$t0>boot3$t)

PsumtSim documentation built on May 1, 2019, 8:03 p.m.