R/one_sse.R

Defines functions one_sse

Documented in one_sse

#' Calculates the sum of squared errors of prediction
#' \code{one_sse} calculates  the sum of squared errors of prediction for one
#' condition
#' @keywords internal
#' @export
one_sse <- function(d, groups, averages) {
  if (length(groups) != 0) averages <- semi_join(averages, d, by = groups)
  data.frame(sse = sum((averages$prob-d$ypred)^2))
}

Try the quickpsy package in your browser

Any scripts or data that you put into this service are public.

quickpsy documentation built on Oct. 2, 2019, 5:03 p.m.