Description Usage Arguments Value Author(s) Examples
Computes the true R-squared if the mixture labels were known without error. Currently only works if all components have the same variance.
1 |
p |
Real vector of mixture proportions. |
mu |
Real vector of mixture component means. |
sigma |
Mixture component standard deviation, same for all components. |
The R-squared value for a (hypothetical) regression of data values
onto mixture label, as a k
level factor.
Toby Johnson Toby.x.Johnson@gsk.com
1 2 3 4 5 6 7 | xx <- fitmix.simulate(100, c(0.49, 0.42, 0.09), c(0, 1, 2), c(.3, .3, .3))
## additive model, common variance, Hardy--Weinberg
fit.a <- fitmix(xx, 3, maxit = 10, restarts = 3,
sigma.common = TRUE, p.binomial = TRUE, mu.additive = TRUE)
fitmix.plot(xx, fit.a$p, fit.a$mu, fit.a$sigma)
fitmix.r2(fit.a$p, fit.a$mu, unique(fit.a$sigma))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.