Type: | Package |
Title: | Three-Mode Principal Components Analysis |
Version: | 1.5.1 |
Maintainer: | Gustavo Gimenez <gustavo.gimenez@faea.uncoma.edu.ar> |
Description: | Performs Three-Mode Principal Components Analysis, which carries out Tucker Models. |
Depends: | R (≥ 3.3.0) |
Suggests: | knitr,testthat |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.0.1 |
URL: | https://github.com/gusart/tuckerR_mmgg |
BugReports: | https://github.com/gusart/tuckerR_mmgg/issues |
NeedsCompilation: | no |
Packaged: | 2018-06-14 16:29:23 UTC; gusart |
Author: | Marta Marticorena [aut], Gustavo Gimenez [cre], Cecilia Gonzalez [ctb], Sergio Bramardi [aut] |
Repository: | CRAN |
Date/Publication: | 2018-06-14 16:44:33 UTC |
Three-Mode Principal Components: Tuckers Models
Description
This package performs Three-Mode Principal Components using Tuckers Models and plot interactive Biplot. These Three-Mode Principal Component Analysis, provides both useful analytic and graphic tools to study and characterize phytogenetic resources, specially when the influence of environmental factors are possible.
Author(s)
Marta Marticorena, Gustavo Gimenez, Cecilia Gonzalez, Sergio Bramardi
Aplication of the Diffit method.
Description
The diffit method is used to apply when we need to know the axis number to be gathered in the P mode, and Q mode. The third mode, K it is related to the environment numbers. The diffit method consist on fitting each value with the Tuckle algorithm.
Usage
diffit(datos, amb = 2, stand = TRUE, niter = 10000)
Arguments
datos |
datos original data from data frames |
amb |
numbers of environment |
stand |
a boolean value, if it is TRUE (value set by default) each variable is centered and scale by variable. |
niter |
the iteration number for the Tuckals algorithm, by default 10000 iteration. |
Details
The final result is the model which has the most coefficient diffits the greatest variability explained and the one which exceed the threshold.
Value
saldiffit
a list with a combination numbers of axis,
percentage of variability explained and Diffit rate. The critic value or
threhold is also return.
Author(s)
Marta Marticorena, Gustavo Gimenez, Cecilia Gonzalez, Sergio Bramardi
References
- MARTICORENA, M.; BRAMARDI, S.; DEFACIO, R. 2010.
Characterization of maize populations in different environmental conditions by means of Three-Mode Principal Components Analysis. Revista Ciencia e Investigacion Agraria. 37(3): 93-105.
- Timmerman, M.E., and H. Kiers. 2000.
Three-mode principal components analysis. Choosing numbers of components and sensitivity to local optima. The British Journal of the Mahematical and Statistical Psychology 53: 1-16.
Examples
#Copy and paste this example in your console without the comment
#data(maize_pop,package = "tuckerR.mmgg")
#dif_sal <- diffit(maize_pop,amb=2)
#print(dif_sal) the best combination is 3 3 2
31 Native Populations of Maize from Province of Buenos Aires
Description
These populations are part of collection of local populations corresponding to different races that are conserved in the Active Germplasm Bank of INTA Pergamino Experimental Station, Argentina.
Usage
data("maize_pop")
Format
A data frame with 10 characteristics of 31 maize populations in two different conditions corresponding to production areas of Buenos Aires. Since the variables are repeated in both places the data frame has a total of 20 variables, 10 for an environment and evaluated them in the other conditions. First and second conditions the numerical vectors are the following:
LMZ
a numeric vector with ear length(cm), in first condition
DMZ
a numeric vector with ear diameter (mm),in first condition
AGR
a numeric vector with grain width (mm),in first condition
LGR
a numeric vector with grain length (cm), in first condition
PROL
a numeric vector prolicicacy (ears/plant), in first condition
GRXM
a numeric vector with grains by meter in first condition
PESO_1000
a numeric vector with weight of 1000 grains (grs)
REND
a numeric vector with yield (kg/ha), in first condition
ALTPL
a numeric vector height of the plant (cm) in first condition
ALTMZ
a numeric vector with height of ear insertion (cm) in first condition
LMZ
a numeric vector with ear length(cm), in second condition
DMZ
a numeric vector with ear diameter (mm),in second condition
AGR
a numeric vector with grain width (mm),in second condition
LGR
a numeric vector with grain length (cm), in second condition
PROL
a numeric vector prolicicacy (ears/plant), in second condition
GRXM
a numeric vector with grains by meter in second condition
PESO_1000
a numeric vector with weight of 1000 grains (grs) in second condition
REND
a numeric vector with yield (kg/ha), in second condition
ALTPL
a numeric vector height of the plant (cm) in second condition
ALTMZ
a numeric vector with height of ear insertion (cm) in second condition
Details
Ten quantitative variables were evaluated in two tests conducted in the 2003/04 season in the localities Pergamino A INTA) and Ferre. These variables allowed for morphologic-agronomic characterization and may be influenced, to a certain extent, by environmental conditions.
References
MARTICORENA, M.; BRAMARDI, S.; DEFACIO, R. (2010). Characterization of maize populations in different environmental conditions by means of Three-Mode Principal Components Analysis. Revista Ciencia e Investigacion Agraria. 37(3): 93-105.
Examples
data(maize_pop,package = "tuckerR.mmgg")
str(maize_pop); summary(maize_pop)
Concatenate data frame in array and matrix by cases, variables and environments
Description
Concatenate data frame in array and matrix by cases, variables
and environments to performs three mode principal components with the
function tucker2R
.
Usage
matrition(datos, I, J, K)
Arguments
datos |
original data from data frames |
I |
the numbers of cases |
J |
the numbers of variables |
K |
the numbers of environment or conditions |
Details
This process is also knowing as 'matricizing' or 'unfolding'.
Value
matrizlista
return a list with: the array "m" with all the
data concatenate in array. X1 the data is concatenate by cases, X2 the data
concatenate by variables and X3 the data concatenate by environments.
Examples
data(maize_pop,package = "tuckerR.mmgg")
conc_matrix <- matrition(maize_pop,I=30,J=10,K=2)
conc_matrix$m #get m array
conc_matrix$X1 #get matrix by cases
conc_matrix$X2 #get matrix by variables
conc_matrix$X3 #get matrix by environments
Plot an interactive Biplot
Description
The interactive Biplot consists of combining two of the modes, obtaining markers for the individuals and vectors for the variables that were concatenated with the conditions. To plot the interactive Biplot this function need the output for the tucker2R function.
Usage
plot(saltuck, ...)
## S3 method for class 'marta'
plot(saltuck)
Arguments
saltuck |
is a list with the results of the algorithm to plot the biplot, where the names of the conditions are well kept. |
... |
Arguments to be passed to plot. |
Details
The interactive Biplot allows for the visualization of the inter structure of the differents data tables.
Value
NULL
Author(s)
Marta Marticorena, Gustavo Gimenez, Cecilia Gonzalez, Sergio Bramardi
References
- MARTICORENA, M.; BRAMARDI, S.; DEFACIO, R. 2010.
Characterization of maize populations in different environmental conditions by means of Three Mode Principal Components Analysis. Revista Ciencia e Investigacion Agraria. 37(3): 93-105.
- Gabriel, K.R. 1971.
The biplot graphic display of matrices with appications to principal components analysis. Biometrika. 58, 453-467.
Examples
data(maize_pop,package = "tuckerR.mmgg")
prueba1 <- tucker2R(maize_pop, amb=2, stand=TRUE, nc1=3, nc2=3)
plot(prueba1)
Three-Mode Principal Components: Tucker 2 Model
Description
This function performs Three-Mode Principal Components using Tucker-2 Model.Compute all the output necessary to plot interactive Biplot.The Three-Mode Principal Component Analysis, provides both useful analytic and graphic tools to study and characterize phytogenetic resources, especially when the influence of environmental factors are possible.
Usage
tucker2R(datos, amb= 2, stand = TRUE, nc1 = 2, nc2 = 2, niter = 10000)
Arguments
datos |
a data frame with n rows for individuals and p variable for columns. All the conditions must be the same variables names and individuals. |
amb |
The diferent conditions, in which the same variables and individuals had been studied. By default is 2. |
stand |
a boolean value, if it is TRUE (value set by default) each variable is centered and scale by variable. |
nc1 |
number of components in the first mode, by default is 2 |
nc2 |
number of components in the second mode, by default is 2 |
niter |
the iteration number for the Tuckals algorithm, by default 10000 iteration |
Details
To determine the number of components that are going to be retained, we use previously to the algorithm applications,method called DifFit. The number of components in the third mode is obtained from the number of conditions.The labels of the variables must be the same for all conditions in the data frame.
Value
Resultado
a list which stores the name of the individual and
the variables, the number of iterations, the variability explained by the
model, and the total variability.
Proyeccion
It is a list which holds the projection of individuals and
variables to see if the biplot is difficult to understand because of the
huge number of cases or plotted vectors.
saltuck
is a list with the results of the algorithm to plot the biplot,
where the names of the conditions are well kept.
Author(s)
Marta Marticorena, Gustavo Gimenez, Cecilia Gonzalez, Sergio Bramardi
References
- Marticorena, M.; Bramardi, S.; Defacio, R. 2010.
Characterization of maize populations in different environmental conditions by means of Three-Mode Principal Components Analysis. Revista Ciencia e Investigacion Agraria. 37(3): 93-105.
- Timmerman, M.E., and H. Kiers. 2000.
Three-mode principal components analysis. Choosing numbers of components and sensitivity to local optima. The British Journal of the Mahematical and Statistical Psychology 53: 1-16.
See Also
The function plot.marta for a complete analisis.
Examples
data(maize_pop,package = "tuckerR.mmgg")
(output <- tucker2R(maize_pop,amb=2,stand=TRUE,nc1=3,nc2=3))