# rg.mvalloc: Robust Multivariate Allocation Procedure In StatDA: Statistical Analysis for Environmental Data

## Description

Function to allocate an individual to one of several populations.

## Usage

 `1` ```rg.mvalloc(pcrit = 0.05, x, ...) ```

## Arguments

 `pcrit` When the probability of group membership is less than pcrit it is allocated to group 0. `x` contains the individuals to be allocated `...` arguments for creating a list of groups

## Details

m objects are the reference populations generated by md.gait, rg.robmva or rg.mva to estimate Mahalanobis distancesand predicted probabilities of group membership for individuals in matrix x. Note that the log |determinant| of the appropriate covariance matrix is added to the Mahalanobis distance on the assumption that the covariance matrices are inhomogeneous. If the data require transformation this must be undertaken before calling this function. This implies that a similar transformation must have been used for all the reference data subsets.

## Value

 `groups` the groups `m` number of groups `n` number of individuals to be allocated `p` number of columns `pgm` number of individuals to be allocated multiplied with the groups `pcrit` critical probability `xalloc` number of individuals as integer

## Author(s)

Peter Filzmoser <P.Filzmoser@tuwien.ac.at> http://cstat.tuwien.ac.at/filz/

## References

C. Reimann, P. Filzmoser, R.G. Garrett, and R. Dutter: Statistical Data Analysis Explained. Applied Environmental Statistics with R. John Wiley and Sons, Chichester, 2008.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18``` ```#input data data(ohorizon) vegzn=ohorizon[,"VEG_ZONE"] veg=rep(NA,nrow(ohorizon)) veg[vegzn=="BOREAL_FOREST"] <- 1 veg[vegzn=="FOREST_TUNDRA"] <- 2 veg[vegzn=="SHRUB_TUNDRA"] <- 3 veg[vegzn=="DWARF_SHRUB_TUNDRA"] <- 3 veg[vegzn=="TUNDRA"] <- 3 el=c("Ag","Al","As","B","Ba","Bi","Ca","Cd","Co","Cu","Fe","K","Mg","Mn", "Na","Ni","P","Pb","Rb","S","Sb","Sr","Th","Tl","V","Y","Zn") x <- log10(ohorizon[!is.na(veg),el]) v <- veg[!is.na(veg)] res.zone1=rg.mva(as.matrix(x[v==1,])) res.zone2=rg.mva(as.matrix(x[v==2,])) res.zone3=rg.mva(as.matrix(x[v==3,])) res=rg.mvalloc(pcrit=0.01,x,res.zone1,res.zone2,res.zone3) ```

### Example output

```Loading required package: geoR
--------------------------------------------------------------
Analysis of Geostatistical Data
For an Introduction to geoR go to http://www.leg.ufpr.br/geoR
geoR version 1.7-5.2.1 (built on 2016-05-02) is now loaded
--------------------------------------------------------------

Warning messages:
1: no DISPLAY variable so Tk is not available
2: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
3: 'rgl_init' failed, running with rgl.useNULL = TRUE
call: fun(...)
n = 329 	nc = 329 	p = 27 		nc/p = 12.19
Eigenvalues: 7.39 3.37 3.227 2.465 1.751 1.597 1.045 0.8917 0.8494 0.5894 0.5627 0.4491 0.3906 0.3693 0.3042 0.2794 0.2435 0.2139 0.1794 0.1695 0.1453 0.1202 0.1078 0.08965 0.05534 0.04615 0.01626
n = 139 	nc = 139 	p = 27 		nc/p = 5.15
Eigenvalues: 7.999 4.196 2.843 2.498 2.079 1.183 1.06 0.773 0.6318 0.4884 0.478 0.4057 0.3643 0.2883 0.2668 0.2123 0.1734 0.1566 0.154 0.1309 0.109 0.08617 0.07937 0.05226 0.04218 0.03785 0.01623
n = 100 	nc = 100 	p = 27 		nc/p = 3.7
*** Proceed with Care, n is < 5p ***
Eigenvalues: 8.369 3.73 2.54 2.092 1.764 1.58 1.446 0.775 0.733 0.6799 0.45 0.4143 0.3447 0.2657 0.2562 0.2183 0.2052 0.1669 0.1407 0.1192 0.1181 0.07443 0.0694 0.05564 0.04798 0.04274 0.03177
m = 3 	 px = 27 	 nx = 568
*** Proceed with Care, n < 5p for group as.matrix(x[v == 3, ]) ***
```

StatDA documentation built on March 13, 2020, 2:42 a.m.