I'm trying to run an ANOVA using bootstrapped data (because my data are not normally distributed) but I don't really know if I did this correctly & how to make sense of my output.
This is what I'm trying to do: I conducted the same experiment with the same subjects online & in the lab (= independent variable "testing situation" with 2 factor levels). In the experiment, I manipulate cognitive load as an independent variable with 4 factor levels (called "no-back", "zero-back", "one-back" and "two-back") and I measure the reaction times (in ms) as a dependent variable.
This means I have a 2 x 4 within-subjects-design with the reaction times as the outcome variable and want to know if there are main or interaction effects.
What I tried to do is the following:
# write regression function
bootReg <- function(formula, # Formula of the regression
data,
indices)
{
d <- data[indices,]
fit <- lm(formula, data=d)
return(coef(fit))
}
# bootstrap the data
boot.object <- boot(statistic = bootReg, formula = lm(RT ~ Code + Situation + Block, data = dataframe), data = dataframe, R = 2000)
My output looks like this:
ORDINARY NONPARAMETRIC BOOTSTRAP
Call:
boot(data = NBACK_DESCR, statistic = bootReg, R = 2000, formula = lm(NBACK_Median_RT ~
Code + Situation + Block, data = NBACK_DESCR))
Bootstrap Statistics :
original bias std. error
t1* 322.927313 -9.0002985 79.96588
t2* -12.014833 5.6209447 117.02878
t3* 109.197500 0.8386920 120.86134
t4* 338.548500 1.0563602 123.06327
t5* 212.354750 0.5961423 307.84955
t6* 115.336083 1.0862478 78.74367
t7* 204.884583 0.6035880 94.50454
t8* -119.986083 2.2980845 72.79074
t9* -93.026833 3.3750698 79.26258
t10* 0.311750 7.5767305 183.46302
t11* 200.108625 -1.8049229 371.22341
t12* -53.072917 0.2976762 95.20676
t13* 126.300083 3.3038699 107.50477
t14* -3.794000 2.6890971 85.11730
t15* 68.130917 0.1380621 109.92370
t16* -144.711750 1.6015020 74.13766
t17* 0.920000 0.8054492 98.44356
t18* -120.711167 0.7836202 78.31914
t19* 10.794083 -0.6042305 98.66546
t20* 519.203600 9.8466741 571.22411
t21* 90.910500 -0.2344282 90.77725
t22* 108.026250 1.1320475 77.27769
t23* 16.168000 0.3672671 126.07834
t24* 284.315333 -2.4115301 287.93144
t25* 198.447917 2.9121272 112.64016
t26* 37.165250 1.5303775 94.42860
t27* -98.688833 3.0493664 79.98359
t28* 45.922417 2.0774330 74.65226
t29* -6.227517 3.8654708 166.54048
t30* 50.998118 2.9716901 49.62328
t31* -23.885188 6.9669819 64.99859
t32* 59.188070 10.5457197 73.22344
Does anyone know what this means and how I can see if I have significant interaction or main effects?
I guess t1* is the original test statistic & the other t*s are the bootstrapped test statistics, but even if that's right, that doesn't really help me with understanding what this output is trying to tell me.
My idea was to count how many ts are > t1, divide that by the number of samples (in this case 2000? Or 31?) to get p-values. Also I thought about doing that for different kinds of models with different combinations of predictors to see which are significant. Does that make sense?! I really don't know. Also I guess I should apply a correction?
It would be really great if anyone could help me with this - I'm an undergrad currently trying to learn R programming and I'm completely lost! Thanks in advance!
