Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get bootstrapped p-values and bootstrapped t-values and how does the function boot() work?
    primarykey
    data
    text
    <p>I would like to get the bootstrapped t-value and the bootstrapped p-value of a lm. I have the following code (basically copied from a paper) which works.</p> <pre><code># First of all you need the following packages install.packages("car") install.packages("MASS") install.packages("boot") library("car") library("MASS") library("boot") boot.function &lt;- function(data, indices){ data &lt;- data[indices,] mod &lt;- lm(prestige ~ income + education, data=data) # the liear model # the first element of the following vector contains the t-value # and the second element is the p-value c(summary(mod)[["coefficients"]][2,3], summary(mod)[["coefficients"]][2,4]) } </code></pre> <p>Now, I compute the bootstrapping model, which gives me the following:</p> <pre><code>duncan.boot &lt;- boot(Duncan, boot.function, 1999) duncan.boot ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = Duncan, statistic = boot.function, R = 1999) Bootstrap Statistics : original bias std. error t1* 5.003310e+00 0.288746545 1.71684664 t2* 1.053184e-05 0.002701685 0.01642399 </code></pre> <p>I have two questions:</p> <ol> <li><p>My understanding is that the bootsrapped value is the original plus the bias, which means that both bootstrapped values (the bootstrapped t-value as well as the bootstrapped p-value) are greater than the original values. This in turn is not possible, because if the t-value rises (which means more significance) the p-values MUST be lower, right? Therefore I think that I have not yet really understood the output of the boot function (here: <code>duncan.boot</code>). How do I compute the bootstrapped values?</p></li> <li><p>I do not understand how the boot() works. If you look at <code>duncan.boot &lt;- boot(Duncan, boot.function, 1999)</code> you see that I have not passed any arguments for the function "boot.function". I suppose that R sets <code>data &lt;- Duncan</code>. But since I have not passed anything for the argument "indices", I do not understand how the following line in the function "boot.function" works <code>data &lt;- data[indices,]</code></p></li> </ol> <p>I hope the questions make sense!??</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload