Skip to content

Commit

Permalink
exported estimate_mean_and_sd, incremented package version to 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
markolalovic committed Jul 26, 2024
1 parent 5468ad7 commit f332f67
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion R/estimation.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,19 @@ estimate_params <- function(data, n_levels, skew = 0) {
#' Estimates the mean and standard deviation of a latent variable given the
#' discrete probabilities of its observed Likert scale responses.
#'
#' @param prob vector of probabilities for each response category.
#' @param prob named vector of probabilities for each response category.
#' @param n_levels number of response categories for the Likert scale item.
#' @param skew marginal skewness of the latent variable, defaults to 0.
#' @param eps tolerance for convergence, defaults to 1e-6.
#' @param maxit maximum number of iterations, defaults to 100.
#'
#' @return A numeric vector with two elements: the estimated mean and
#' standard deviation.
#'
#' @examples
#' prob <- c("1" = 0.313, "2" = 0.579, "3" = 0.105, "4" = 0.003)
#' # returns estimates that are close to the actual mean and sd: c(-1, 0.5)
#' estimate_mean_and_sd(prob, 5)
#'
#' @details
#' This function uses an iterative algorithm to solve the system of non-linear
Expand Down
8 changes: 7 additions & 1 deletion man/estimate_mean_and_sd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f332f67

Please sign in to comment.