Given a data frame of sample data, a column name, a nominal quantity, and a batch size, calculates the mean of the column and determines whether the batch should be accepted or rejected based on the comparison of the mean with the nominal quantity minus the estimation of the standard deviation.
mean_analysis(df, col_name, batch_size, nominal_quantity)A data frame containing the sample data for analysis.
A string representing the name of the column to analyze within the data frame.
A numeric value indicating the size of the batch being produced.
A numeric value indicating the nominal quantity of the product being produced.
A string indicating whether the batch should be accepted or rejected based on the mean analysis.
df <- data.frame(values = rep(10,30))
result <- mean_analysis(df, "values", 500, 10)
result
#> $decision
#> [1] "Accept"
#>
#> $std_dev_estimate
#> [1] 0
#>
#> $sample_mean
#> [1] 10
#>
#> $mean_limit
#> [1] 10
#>
#> $plot
#>