mean_rating: Bootstrap helper function

Description Usage Arguments Details Examples

Description

To be used as a parameter inside boot::boot, which 'generates bootstrap replicates of a statistic', the statistic in this case is the mean zipf_rtg in the dataframe of ratings returned by zipf_hcp.

Usage

1
mean_rating(data, index)

Arguments

data

dataframe

index

indexes

Details

The dataframe to be used is inside a list, so either extract the dataframe and give it its own name, or reference it using '$ratings'.

Examples

1
2
3
4
5
6
7
## Not run: 
library(boot)
# assume we have called zipf_hcp and the returned list is called "zipf"
# to use the mean_rating within boot::boot function:
boot(data = zipf$ratings, statistic = mean_rating, R = 1000)

## End(Not run)

durtal/RcappeR documentation built on May 15, 2019, 6 p.m.