boot.mean {sur}R Documentation

Bootstrapped Mean

Description

Function to obtain a sampling distribution of means by bootstrapping.

Usage

boot.mean(x, B, n = length(x))

Arguments

x

original sample, given as a numeric or logical object, to be used to generate bootstrapped samples.

B

number of bootstrapped samples to be generated by randomly sampling with replacement.

n

size of each bootstrapped sample. Default setting is the size of the original sample.

Value

A list with components:

Replications

number of bootstrapped means computed.

mean

mean of bootstrapped means.

se

standard error, estimated as the standard deviation of bootstrapped means.

bootstrap.samples

means of bootstrapped samples.

Examples

# using simple vector
a = 1:10
set.seed(1234)
boot.mean(a, B = 500)

# using variable from data frame
set.seed(1234)
boot.mean(Framingham$AGE3, B = 1000)

[Package sur version 1.0.4 Index]