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

View source: R/two.level.components.r

Takes a large sample from the background population and calculates the within and between covariance matricies, a vector of means, a vector of the counts of replicates for each item from the sample, and other bits needed to make up a `compcovar`

object

1 | ```
two.level.components(dat, data.columns, item.column)
``` |

`dat` |
a matrix, or data.frame, of observations, with cases in rows, and properties as columns. |

`data.columns` |
an array indicating which columns are the properties. |

`item.column` |
an integer indicating which column gives the item. |

Uses ML estimation at the moment - hopefully give some alternative ways of estimating the covariance matricies in the future.

Returns a `compcovar`

object

Can be used directly for variance component estimation.

David Lucy [email protected] - http://www.maths.lancs.ac.uk/~lucy

Aitken, C.G.G. & Lucy, D. (2004) Evaluation of trace evidence in the form of multivariate data. *Applied Statistics*: **53**(1); 109-122.

`compcovar`

`compitem`

`two.level.comparison.items`

`two.level.components`

`two.level.density.LR`

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# load this library
library(comparison)
# load Greg Zadora's glass data
data(glass)
# make it into a data frame
dat <- as.data.frame(glass)
# calculate a compcovar object based upon dat
# using K, Ca and Fe - warning - could take time
# on slower machines
Z <- two.level.components(dat, c(7,8,9), 1)
``` |

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.