res_gamma | R Documentation |
This function calcualtes the parameters of a Gamma distribution from the residuals from an individuals' own mean. That is, the distribution of (standard) deviations from individuals' own mean are calculated and then an estimate of the parameters of a Gamma distribution are calculated.
res_gamma(x, ID)
x |
A data vector to operate on |
ID |
an ID variable of the same length as |
a list of the shape (alpha) and rate (beta) parameters and the mean and variance
Joshua F. Wiley <jwiley.psych@gmail.com>
set.seed(1234)
y <- rgamma(100, 3, 2)
x <- rnorm(100 * 10, mean = 0, sd = rep(y, each = 10))
ID <- rep(1:100, each = 10)
res_gamma(x, ID)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.