Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

combinevar

Combining Mean and Variances from Multiple Samples


Description

This function takes multiple mean and sample variance estimates and combines them.

Usage

combinevar(xbar = NULL, s_squared = NULL, n = NULL)

Arguments

xbar

vector of means

s_squared

vector of sample variances

n

vector of number of observations

Details

If a Monte Carlo simulation is run over 1000 loops and then again over another 1000 loops, one may wish to update the mean and variance from the first 1000 loops with the second set of simulation results.

Value

Vector containing the combined mean and sample variance.

Author(s)

John M. Hoenig, Virginia Institute of Marine Science hoenig@vims.edu

Examples

xbar <- c(5,5)
s<-c(2,4)
n <- c(10,10)
combinevar(xbar,s,n)

fishmethods

Fishery Science Methods and Models

v1.11-1
GPL (>= 2)
Authors
Gary A. Nelson <gary.nelson@mass.gov>
Initial release
2019-12-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.