Description Usage Arguments Details Value Author(s) References See Also Examples

Calculate a weighted mean, between-group standard deviation and standard error on the weighted mean using the Maximum likelihood algorithm of Vangel-Rukhin.

1 2 3 4 5 |

`x` |
numeric vector of the sample mean values of each group |

`s2` |
numeric vector of the sample variances of each group |

`n` |
integer vector of sample size of each group |

`init.mu` |
numeric initial value for the mean |

`init.sigma2` |
numeric initial value for the between-group component of variance |

`labels` |
vector of group names. Coerced to character on use. |

`max.iter` |
numeric maximum number of iterations |

`tol` |
numeric tolerance; iteration stops when the relative step size drops below 'tol' |

`trace` |
when TRUE shows the sequence of intermediate results |

`..., digits` |
Passed to |

The Vangel-Rukhin MLE algorithm finds the between-method variance by iteratively solving the equation relating the weighted mean to the weighting factor applied. The weighting factor is the inverse of the sum of the standard error in 'x' and the between-method variance, scaled by the between-method variance.

For the default method, 's2' is interpreted as a vector of sample variances. 'x' is interpreted as a vector of sample means and the algorithm is applied to the corresponding group means, variances, and sample sizes.

The Vangel-Rukhin MLE algorithm shows an improvement in the number of iterations required to converge over the classical MLE based on the Score equations.

The function mle.1wre implements the MLE for the one way random effects based on the Fisher scoring equations and is provided for comparison purpose only.

`vr.mle`

returns an object of class "summary.vr.mle" which contains
the following fields:

`mu` |
the estimated mean |

`var.mu` |
the variance associated with the estimated mean |

`sigma2` |
the estimated between variance component |

`llh` |
the log likelihood of the estimates |

`tot.iter` |
the total number of iterations ran |

`cur.rel.abs.error` |
the current relative absolute error reached |

`gammai` |
a vector with the estimates of the weights |

`converged` |
TRUE is convergence criteria was met, FALSE otherwise |

`reduced.model` |
TRUE implies that a reduced model, with no
between-group effect, is suggested, based on |

H. Gasca-Aragon

Vangel, M. G. and Rukhin, A. L. (1999), Biometrics, Vol 55, No. 1 pp 129-136

Searle, S. R., Cassella, G., and McCulloch, C. E. (1992). Variance Components. New York: Wiley.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ```
##===================================================================
## the dietary fiber in apples example in the Vangel and Rukhin paper
##===================================================================
m1 <- c(12.46, 13.035, 12.44, 12.87, 13.42, 12.08, 13.18, 14.335, 12.23)
s1 <- c(0.028, 0.233, 0.325, 0.071, 0.339, 0.325, 0.099, 0.064, 0.212)
n1 <- c(2, 2, 2, 2, 2, 2, 2, 2, 2)
res<- vr.mle(m1, s1^2, n1, tol=1e-6)
res$mu
sqrt(res$var.mu)
res$sigma2
res$mu+c(-1,1)*qnorm(0.975)*sqrt(res$var.mu)
res$tot.iter
res$converged
res$reduced.model
# output
# 12.90585
# 0.2234490
# 0.4262122
# 12.46790 13.34380
# 6
# converged = TRUE
# reduced.model = FALSE
``` |

metRology documentation built on May 2, 2019, 12:20 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.