binnedMSE: Calculate the MSE for binned data

Description Usage Arguments Details Value Examples

View source: R/extractMoments.r

Description

Calculate the MSE for binned data

Usage

1
2
binnedMSE(counts, mu, lowerBounds = seq(0, 95, 5), upperBounds = seq(5, 100,
  5))

Arguments

counts

A matrix of data frame of observed counts of binned data

mu

The true observed mean

lowerBounds

A vector of the lower cut points of the binnned data

upperBounds

A vector of the upper cutpoints of the original binnned data

Details

Assumes that the midpoint of the bin is the mean of that prediction.

Value

A vector with one observation for each row in counts

Examples

1
2
3
4
5
6
upper <- seq(10, 100, 10)
lower <- seq(0, 90, 10)
counts <- c(0, 0, 4, 4, 4, 2, 0, 0, 0, 0)
counts2 <- c(1, 2, 1, 4, 4, 2, 0, 0, 0, 0)
counts_df <- as.data.frame(rbind(counts, counts2))
binnedMSE(counts_df, mu = 33, lowerBounds = lower, upperBounds = upper)

aserlich/gameify documentation built on Sept. 27, 2019, 5:41 p.m.