Skip to contents

Estimate t Distribution Parameters

Usage

util_t_param_estimate(.x, .auto_gen_empirical = TRUE)

Arguments

.x

The vector of data to be passed to the function, where the data comes from the rt() function.

.auto_gen_empirical

This is a boolean value of TRUE/FALSE with default set to TRUE. This will automatically create the tidy_empirical() output for the .x parameter and use the tidy_combine_distributions(). The user can then plot out the data using $combined_data_tbl from the function output.

Value

A tibble/list

Details

This function will attempt to estimate the t distribution parameters given some vector of values produced by rt(). The estimation method uses both method of moments and maximum likelihood estimation.

Author

Steven P. Sanderson II, MPH

Examples

library(dplyr)
library(ggplot2)

set.seed(123)
x <- rt(100, df = 10, ncp = 0.5)
output <- util_t_param_estimate(x)

output$parameter_tbl
#> # A tibble: 2 × 7
#>   dist_type      samp_size  mean variance method df_est ncp_est
#>   <chr>              <int> <dbl>    <dbl> <chr>   <dbl>   <dbl>
#> 1 T Distribution       100 0.612    0.949 MME     0.959   0.612
#> 2 T Distribution       100 0.612    0.949 MLE     8.32    0.571

output$combined_data_tbl |>
  tidy_combined_autoplot()