Title: | Phenotypic Integration Index |
---|---|
Description: | Provides functions to estimate the size-controlled phenotypic integration index, a novel method by Torices & Méndez (2014) to solve problems due to individual size when estimating integration (namely, larger individuals have larger components, which will drive a correlation between components only due to resource availability that might obscure the observed measures of integration). In addition, the package also provides the classical estimation by Wagner (1984), bootstrapping and jackknife methods to calculate confidence intervals and a significance test for both integration indices. |
Authors: | R. Torices, A. J. Muñoz-Pajares |
Maintainer: | A. J. Muñoz-Pajares <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.3.1 |
Built: | 2024-11-29 08:43:44 UTC |
Source: | CRAN |
PHENIX estimates a phenotypic integration index taking into account the size of the studied organ. For that, the magnitude of phenotypic integration between a set of traits in a population is quantified by the variance of the eigenvalues of the partial-correlation matrix (Torices & Méndez 2014). This partial-correlation matrix assess the correlation structure between all traits after controlling by the organ size. In addition, PHENIX also computes the integration values based on the correlation matrix between traits (Wagner 1984). Confidence intervals of both indices are calculated by bootstrapping and jackknife and the statistical significance is calculated by simulating a null distribution.
Package: | PHENIX |
Type: | Package |
Version: | 1.1 |
Date: | 2015-1-22 |
License: | GPL-2 |
R. Torices, A.J. Muñoz-Pajares
Maintainer: A.J. Muñoz-Pajares to <[email protected]>
R Torices, AJ Muñoz-Pajares (2015). PHENIX: An R package to estimate a size-controlled phenotypic integration index Applications in plant sciences 3 (5) DOI: 10.3732/apps.1400104
This function calculates the partial correlation matrix between a set of traits and a third control variable.
cor.par(traits, c.trait, trait.names = FALSE, silent=FALSE)
cor.par(traits, c.trait, trait.names = FALSE, silent=FALSE)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
c.trait |
a vector containing the third control variable to estimate partial correlations, for instance: organ size or individual size |
trait.names |
a logical. If 'FALSE' (default), trait names in the output are defined as "Trait 1", "Trait 2", ..., "Trait n". If 'TRUE', output trait names are the same than those in the input dataframe |
silent |
a logical. If 'FALSE' (default), return a warning message if any row contains missing data (and is removed from the original dataset before computation). |
This function is utilised internally by pintsc
and pintsc.boot
to estimate the phenotypic integration index from partial correlations. Rows containing missing values are removed.
A matrix with the pairwise partial correlation between traits.
R. Torices, A.J. Muñoz-Pajares
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) print(tussilago) cor.par(tussilago[,1:5], tussilago[,6], trait.names=TRUE) # NA automatically removed traits<-na.exclude(tussilago) # NA manually removed cor.par(traits[,1:5], traits[,6], trait.names=TRUE)
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) print(tussilago) cor.par(tussilago[,1:5], tussilago[,6], trait.names=TRUE) # NA automatically removed traits<-na.exclude(tussilago) # NA manually removed cor.par(traits[,1:5], traits[,6], trait.names=TRUE)
phenotypic integration example dataset from Méndez & Traveset (2003).
data(paeonia)
data(paeonia)
This data set represents the dry mass (in grams) of inflorescence components of the herbaceous perennial plant Paeonia cambessedesii. Variables include mass for 'PETIOLE', 'RECEPTACLE', 'SEPAL', 'LEAF_ACC', 'PETAL', 'STAMEN', and 'CARPEL'. 'LEAF_ACC' represent the dry mass of the accessory leaf (subtending the flower but close to the sepals). Furthermore the first and last columns include the individual number ('ID') and the total weight of the inflorescence ('TOTAL').
M. Méndez, A. Traveset
Méndez, M. & Traveset, A. 2003. Sexual allocation in single-flowered individuals of a hermaphroditic species in relation to plant and flower size. Oecologia 137:69-75.
data(paeonia)
data(paeonia)
Estimates phenotypic integration indices based on the variance of the eigenvalues of the correlation matrix between phenotypic traits following Wagner (1984).
pint(traits)
pint(traits)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
This function estimates the phenotypic integration index (PINT) using the correlation matrix following Wagner (1984), as well as a phenotypic integration index (PINT.c) corrected by the number of traits and individuals of each population. The uncorrected estimate is also expressed as percentage depending on the maximum possible integration levels.
A list with five elements containing:
PINT: |
The phenotypic integration index. |
RelPINT: |
Percentage of maximum possible integration. |
PINT.c: |
Corrected phenotypic integration index. |
N: |
Number of observations used. |
R. Torices, A.J. Muñoz-Pajares
Cheverud, J.M., Wagner, G.P. & Dow, M.M. 1989. Methods for the comparative analysis of variation patterns. Systematic Zoology 38:201–213
Pavlicev, M., Cheverud, J.M. & Wagner, G.P. 2009. Measuring morphological integration using eigenvaluev ariance. Evolutionary Biology 36:157–170
Wagner, G.P. 1984. On the eigenvalue distribution of genetic and phenotypic dispersion matrices: evidence for a nonrandom organization of quantitative character variation. Journal of Mathematical Biology 21:77–95
pint.p
, pint.boot
, pint.jack
, pintsc
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) pint (tussilago[,1:5]) # the last column is not included since represents the total size # NOTE that the number of observations used by the function was 18 instead 29 that were # included in the 'tussilago' data set. Missing values were removed.
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) pint (tussilago[,1:5]) # the last column is not included since represents the total size # NOTE that the number of observations used by the function was 18 instead 29 that were # included in the 'tussilago' data set. Missing values were removed.
This function estimates the confidence intervals of the phenotypic integration index (Wagner, 1984) using bootstrap.
pint.boot(traits, replicates = 1000, verbose=FALSE)
pint.boot(traits, replicates = 1000, verbose=FALSE)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
replicates |
a numeric, the number of randomizations (1000 by default) |
verbose |
a logic, if TRUE, values obtained during the bootstrap resampling are also reported. |
Rows containing missing values are removed.
A matrix with two columns and nine rows. Columns contain information for the uncorrected and corrected indices whereas rows contain mean, median, standard deviation (SD), standard error (SE), lower and higher confidence interval at 99%, lower and higher confidence interval at 95%, and the number of randomizations.
R. Torices, A.J. Muñoz-Pajares
Cheverud, J.M., Wagner, G.P. & Dow, M.M. 1989. Methods for the comparative analysis of variation patterns. Systematic Zoology 38:201–213
Pavlicev, M., Cheverud, J.M. & Wagner, G.P. 2009. Measuring morphological integration using eigenvaluev ariance. Evolutionary Biology 36:157–170
pint
, pint.p
, pintsc.boot
, pint.jack
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grames) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) pint.boot(tussilago[,1:5], 100) # The phenotypic integration intervals do not include 0. # For faster execution, we used 100 replicates in this example. # For real data set increase this number: # pint.boot(tussilago[,1:5], 5000)
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grames) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) pint.boot(tussilago[,1:5], 100) # The phenotypic integration intervals do not include 0. # For faster execution, we used 100 replicates in this example. # For real data set increase this number: # pint.boot(tussilago[,1:5], 5000)
This function estimates the confidence intervals of the phenotypic integration index (Wagner, 1984) using jackknife resampling.
pint.jack(traits,n.remove=1, verbose=FALSE)
pint.jack(traits,n.remove=1, verbose=FALSE)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
n.remove |
a numeric, the number of individuals to remove on every jackknife iteration |
verbose |
a logic, if TRUE, values obtained during the jackknife resampling are also reported. |
For every iteration, this function removes a given number of individuals before estimating phenotypic integration indices. Then, the process is repeated until all the possible combinations of this number of individuals have been removed. Rows containing missing values are removed.
A matrix with two columns and nine rows. Columns contain information for the uncorrected and corrected indices whereas rows contain mean, median, standard deviation (SD), standard error (SE), lower and higher confidence interval at 99%, lower and higher confidence interval at 95%, and the number of iterations.
A.J. Muñoz-Pajares, R. Torices
Cheverud, J.M., Wagner, G.P. & Dow, M.M. 1989. Methods for the comparative analysis of variation patterns. Systematic Zoology 38:201–213
Pavlicev, M., Cheverud, J.M. & Wagner, G.P. 2009. Measuring morphological integration using eigenvaluev ariance. Evolutionary Biology 36:157–170
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grames) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) pint.jack(tussilago[,1:5], 1) # Replicates are obtained removing one individual pint.jack(tussilago[,1:5], 3) # Replicates are obtained removing three individuals
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grames) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) pint.jack(tussilago[,1:5], 1) # Replicates are obtained removing one individual pint.jack(tussilago[,1:5], 3) # Replicates are obtained removing three individuals
Estimates p-values for the phenotypic integration index described by Wagner (1984). For that, it generates a null distribution based on product–moment correlations.
pint.p(traits,n.replicates=1000,N.Pearson=15,plot="Results",tails=1)
pint.p(traits,n.replicates=1000,N.Pearson=15,plot="Results",tails=1)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
n.replicates |
a numeric, number of randomizations to estimate the null distribution (1000 by default) |
N.Pearson |
a numeric (>2) to shape the distribution probability to sample the correlation matrix. See Details. |
plot |
a string. Possible values are "Results" or "R" to display the simulated null distribution and the observed value as a histogram; and "Pearson.distribution" or "P" to check the distribution generated by the N.Pearson parameter to produce the correlation matrix. Any other value will produce no plot. |
tails |
possible values are 1 and 2 to set the test for one or two tails. By default is set to 1, because values of integration are expected to be higher in the real than in the simulated dataset. |
This function generates a set of theoretical correlation matrices, with as many rows and columns as the number of variables contained in 'traits'. Values in this matrix are randomly drawn using a Pearson product moment correlation coefficient distribution (as implemented in the SuppDists package). The distribution is shaped by the N.Pearson value as follows:
N.Pearson = 3 increases frequency for extreme values (that is -1 and +1).
N.Pearson = 4 generates a uniform distribution (similar probability for all values).
N.Pearson > 5 increases frequency for central values (that is, 0).
The option plot="Pearson.distribution" or plot="P" displays the distribution used to generate the theoretical correlation matrices. This plot produces an histogram with 100,000 observations taken from the distribution shaped by the N.Pearson value.
A list with the following elements:
Simulated.cor |
The simulated theoretical correlation matrices. |
Simulated.int |
The phenotypic integration indices estimated on the simulated matrices. |
Simulated.Range |
The range (minimum-maximum) of phenotypic integration indices estimated on the simulated matrices. |
Simulated.Mean |
The mean of phenotypic integration indices estimated on the simulated matrices. |
Real.int |
The phenotypic integration indices estimated on the real dataset. |
Summary |
A data frame containing the integration indices (as rows) for the real and simulated dataset and the p-value (as columns) |
A.J. Muñoz-Pajares, R. Torices
Harder, L.D. 2009. Questions about floral (dis)integration. New Phytologist 183:247–248.
Ordano, M., Fornoni, J., Boege, K. & Domínguez, C.A. 2008. The adaptive value of phenotypic floral integration. New Phytologist 179:1183–1192.
Wagner, G.P. 1984. On the eigenvalue distribution of genetic and phenotypic dispersion matrices: evidence for a non-random organization of quantitative character variation. Journal of Mathematical Biology 21:77–95.
data(tussilago) # Using a uniform distribution to generate the correlation matrices: ## A) Showing uniform distribution unif1<-pint.p(traits=tussilago,n.replicates=1000, N.Pearson=4,plot="P") ## B) Showing the resulting null distribution and the real value (red line) unif2<-pint.p(traits=tussilago,n.replicates=1000, N.Pearson=4,plot="R") dev.new() # Using a non-uniform distribution to generate the correlation matrices: ## A) Showing the Pearson product moment correlation coefficient distribution prmo1<-pint.p(traits=tussilago,n.replicates=1000, N.Pearson=15,plot="P") ## B) Showing the resulting null distribution and the real value (red line) prmo2<-pint.p(traits=tussilago,n.replicates=1000, N.Pearson=15,plot="R") # Comparing the uniform and the non-uniform distributions # as in Harder New Phytologist (2009) 183: 247-248 vari<-2 #variable to plot (INT.c) toplot1<-unif2$Simulated.int[vari,] toplot2<-prmo2$Simulated.int[vari,] HIST<-hist(as.matrix(toplot2),plot=FALSE) MaxY<-max(HIST$density) Max<-max(toplot1,toplot2) Min<-min(HIST$mids) plot(c(1,2),xlim=c((Min-0.05*Max),(Max+0.05*Max)),ylim=c(0,(MaxY+0.05*MaxY)), type="n",ylab="Density",xlab="Maximum integration (percentage)") hist(as.matrix(toplot1),add=TRUE,freq=FALSE,breaks=28) hist(as.matrix(toplot2),add=TRUE,freq=FALSE,col="grey",breaks=8) # And the real value as a red line: abline(v=prmo1$Real[vari],lty=2, col="red")
data(tussilago) # Using a uniform distribution to generate the correlation matrices: ## A) Showing uniform distribution unif1<-pint.p(traits=tussilago,n.replicates=1000, N.Pearson=4,plot="P") ## B) Showing the resulting null distribution and the real value (red line) unif2<-pint.p(traits=tussilago,n.replicates=1000, N.Pearson=4,plot="R") dev.new() # Using a non-uniform distribution to generate the correlation matrices: ## A) Showing the Pearson product moment correlation coefficient distribution prmo1<-pint.p(traits=tussilago,n.replicates=1000, N.Pearson=15,plot="P") ## B) Showing the resulting null distribution and the real value (red line) prmo2<-pint.p(traits=tussilago,n.replicates=1000, N.Pearson=15,plot="R") # Comparing the uniform and the non-uniform distributions # as in Harder New Phytologist (2009) 183: 247-248 vari<-2 #variable to plot (INT.c) toplot1<-unif2$Simulated.int[vari,] toplot2<-prmo2$Simulated.int[vari,] HIST<-hist(as.matrix(toplot2),plot=FALSE) MaxY<-max(HIST$density) Max<-max(toplot1,toplot2) Min<-min(HIST$mids) plot(c(1,2),xlim=c((Min-0.05*Max),(Max+0.05*Max)),ylim=c(0,(MaxY+0.05*MaxY)), type="n",ylab="Density",xlab="Maximum integration (percentage)") hist(as.matrix(toplot1),add=TRUE,freq=FALSE,breaks=28) hist(as.matrix(toplot2),add=TRUE,freq=FALSE,col="grey",breaks=8) # And the real value as a red line: abline(v=prmo1$Real[vari],lty=2, col="red")
This function estimates the phenotypic integration indices controlling by a third variable.
pintsc(traits,control=NA)
pintsc(traits,control=NA)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
control |
a vector containing the variable to control by size. |
This function estimates the same set of indices than pint
but from partial correlation
matrix instead of the correlation matrix: PINTsc: The variance of the eigenvalues using the partial correlation
matrix instead of a correlation matrix. Torices & Méndez (2014) proposed this index for analysing phenotypic
integration of resource allocation to different components in an individual or a given organ when resource
allocation data come from observational studies in which resource availability is not controlled and therefore
could lead to components correlations only by the fact of different resource availability. Thus, PINT can be
estimated using the matrix of partial correlations in which size of the organ or individual is used as the third
control variable. PINTsc.c: The PINTsc corrected by the number of traits and individuals of each population.
RelPINTsc: The same as RelPINT but estimated with the partial correlation matrix.
Rows containing missing values are removed.
A list with five elements containing:
PINTsc: |
The phenotypic integration index. |
RelPINTsc: |
Percentage of maximum possible integration. |
PINTsc.c: |
Corrected phenotypic integration index. |
N: |
Number of observations used. |
R. Torices, A.J. Muñoz-Pajares
Torices, R. & Méndez, M. 2014. Resource allocation to inflorescence components is highly integrated despite differences between allocation currencies and sites. International Journal of Plant Science 175(6):713–723.
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added #'TOTALSIZE' data(tussilago) # To estimate the PINT indices controlling by a third variable # it is mandatory to define the "control" variable. Otherwise, it gives an error: # # pintsc(traits=tussilago) pintsc(traits=tussilago[,1:5],control=tussilago[,6])
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added #'TOTALSIZE' data(tussilago) # To estimate the PINT indices controlling by a third variable # it is mandatory to define the "control" variable. Otherwise, it gives an error: # # pintsc(traits=tussilago) pintsc(traits=tussilago[,1:5],control=tussilago[,6])
This function estimates the confidence intervals of the phenotypic integration index controlling by a third variable using bootstrap.
pintsc.boot(traits, control=NA, replicates = 1000, verbose=FALSE)
pintsc.boot(traits, control=NA, replicates = 1000, verbose=FALSE)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
control |
a vector containing the variable to control by size. |
replicates |
a numeric, the number of randomizations (1000 by default). |
verbose |
a logic, if TRUE, values obtained during the bootstrap resampling are also reported. |
Rows containing missing values are removed.
A matrix with two columns and nine rows. Columns contain information for the uncorrected and corrected indices whereas rows contain mean, median, standard deviation (SD), standard error (SE), lower and higher confidence interval at 99%, lower and higher confidence interval at 95%, and the number of randomizations.
R. Torices, A.J. Muñoz-Pajares
pintsc
, pint.boot
, pintsc.jack
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) # Iit is mandatory to define the "control" variable. Otherwise, it gives an error: # pintsc.boot(tussilago, 5000) pintsc.boot(traits=tussilago[,1:5], replicates=100, control=tussilago[,6]) # The phenotypic integration index intervals do not include 0. # For faster execution, we used 100 replicates in this example. # For real data set increase this number: # pintsc.boot(traits=tussilago[,1:5], replicates=5000, control=tussilago[,6])
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) # Iit is mandatory to define the "control" variable. Otherwise, it gives an error: # pintsc.boot(tussilago, 5000) pintsc.boot(traits=tussilago[,1:5], replicates=100, control=tussilago[,6]) # The phenotypic integration index intervals do not include 0. # For faster execution, we used 100 replicates in this example. # For real data set increase this number: # pintsc.boot(traits=tussilago[,1:5], replicates=5000, control=tussilago[,6])
This function estimates the confidence intervals of the phenotypic integration index controlling by a third variable using jackknife resampling.
pintsc.jack(traits, control=NA, n.remove = 1, verbose=FALSE)
pintsc.jack(traits, control=NA, n.remove = 1, verbose=FALSE)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
control |
a vector containing the variable to control by size. |
n.remove |
a numeric, the number of individuals to remove on every jackknife iteration |
verbose |
a logic, if TRUE, values obtained during the jackknife resampling are also reported. |
For every iteration, this function removes a given number of individuals before estimating phenotypic integration indices. Then, the process is repeated until all the possible combinations of this number of individuals have been removed. Rows containing missing values are removed.
A matrix with two columns and nine rows. Columns contain information for the uncorrected and corrected indices whereas rows contain mean, median, standard deviation (SD), standard error (SE), lower and higher confidence interval at 99%, lower and higher confidence interval at 95%, and the number of randomizations.
A.J. Muñoz-Pajares, R. Torices
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) # Iit is mandatory to define the "control" variable. Otherwise, it gives an error: # pintsc.jack(tussilago, 1) pintsc.jack(traits=tussilago[,1:5], control=tussilago[,6], 1)
# Dataset from Torices & Méndez (2014) # This data set represents the dry mass (in grams) of inflorescence components of the sunflower # species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' # (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of # female flower). Furthermore in the last column the total weight of the inflorescence is added # 'TOTALSIZE' data(tussilago) # Iit is mandatory to define the "control" variable. Otherwise, it gives an error: # pintsc.jack(tussilago, 1) pintsc.jack(traits=tussilago[,1:5], control=tussilago[,6], 1)
Estimates p-values for the size-controlled phenotypic integration index by generating a null distribution based on product–moment correlations.
pintsc.p(traits,control=NA,n.replicates=1000,N.Pearson=15,plot="Results",tails=1)
pintsc.p(traits,control=NA,n.replicates=1000,N.Pearson=15,plot="Results",tails=1)
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
control |
a vector containing the variable to control by size. |
n.replicates |
a numeric, number of randomizations to estimate the null distribution (1000 by default) |
N.Pearson |
a numeric (>2) to shape the distribution probability to sample the correlation matrix. See Details. |
plot |
a string. Possible values are "Results" or "R" to display the simulated null distribution and the observed value as a histogram; and "Pearson.distribution" or "P" to check the distribution generated by the N.Pearson parameter to produce the correlation matrix. Any other value will produce no plot. |
tails |
possible values are 1 and 2 to set the test for one or two tails. By default is set to 1, because values of integration are expected to be higher in the real than in the simulated dataset. |
This function generates a set of theoretical correlation matrices, with as many rows and columns as the number of variables contained in 'traits'. Values in this matrix are randomly drawn using a Pearson product moment correlation coefficient distribution (as implemented in the SuppDists package). The distribution is shaped by the N.Pearson value as follows:
N.Pearson = 3 increases frequency for extreme values (that is -1 and +1).
N.Pearson = 4 generates a uniform distribution (similar probability for all values).
N.Pearson > 5 increases frequency for central values (that is, 0).
The option plot="Pearson.distribution" or plot="P" displays the distribution used to generate the theoretical correlation matrices. This plot produces an histogram with 100,000 observations taken from the distribution shaped by the N.Pearson value.
A list with the following elements:
Simulated.cor |
The simulated theoretical correlation matrices. |
Simulated.int |
The phenotypic integration indices estimated on the simulated matrices. |
Simulated.Range |
The range (minimum-maximum) of phenotypic integration indices estimated on the simulated matrices. |
Simulated.Mean |
The mean of phenotypic integration indices estimated on the simulated matrices. |
Real.int |
The phenotypic integration indices estimated on the real dataset. |
Summary |
A data frame containing the integration indices (as rows) for the real and simulated dataset and the p-value (as columns) |
A.J. Muñoz-Pajares, R. Torices
Harder, L.D. 2009. Questions about floral (dis)integration. New Phytologist 183:247–248.
Ordano, M., Fornoni, J., Boege, K. & Domínguez, C.A. 2008. The adaptive value of phenotypic floral integration. New Phytologist 179:1183–1192.
Wagner, G.P. 1984. On the eigenvalue distribution of genetic and phenotypic dispersion matrices: evidence for a non-random organization of quantitative character variation. Journal of Mathematical Biology 21:77–95.
pintsc
, pintsc.boot
, pintsc.jack
data(tussilago) # Using a uniform distribution to generate the correlation matrices: ## A) Showing uniform distribution unif1<-pintsc.p(traits=tussilago[,1:5], control=tussilago[,6], n.replicates=1000, N.Pearson=4, plot="P") ## B) Showing the resulting null distribution and the real value (red line) unif2<-pintsc.p(traits=tussilago[,1:5], control=tussilago[,6], n.replicates=1000, N.Pearson=4, plot="R") # Using a non-uniform distribution to generate the correlation matrices: dev.new() ## A) Showing the Pearson product moment correlation coefficient distribution prmo1<-pintsc.p(traits=tussilago[,1:5], control=tussilago[,6], n.replicates=1000, N.Pearson=15, plot="P") ## B) Showing the resulting null distribution and the real value (red line) prmo2<-pintsc.p(traits=tussilago[,1:5], control=tussilago[,6], n.replicates=1000, N.Pearson=15, plot="R") # Comparing the uniform and the non-uniform distributions # as in Harder New Phytologist (2009) 183: 247–248 vari<-2 #variable to plot (INT.c) toplot1<-unif2$Simulated.int[vari,] toplot2<-prmo2$Simulated.int[vari,] HIST<-hist(as.matrix(toplot2),plot=FALSE) MaxY<-max(HIST$density) Max<-max(toplot1,toplot2) Min<-min(HIST$mids) plot(c(1,2),xlim=c((Min-0.05*Max),(Max+0.05*Max)),ylim=c(0,(MaxY+0.05*MaxY)), type="n",ylab="Density",xlab="Maximum integration (percentage)") hist(as.matrix(toplot1),add=TRUE,freq=FALSE,breaks=28) hist(as.matrix(toplot2),add=TRUE,freq=FALSE,col="grey",breaks=18) # And the real value as a red line: abline(v=prmo1$Real[vari],lty=2, col="red")
data(tussilago) # Using a uniform distribution to generate the correlation matrices: ## A) Showing uniform distribution unif1<-pintsc.p(traits=tussilago[,1:5], control=tussilago[,6], n.replicates=1000, N.Pearson=4, plot="P") ## B) Showing the resulting null distribution and the real value (red line) unif2<-pintsc.p(traits=tussilago[,1:5], control=tussilago[,6], n.replicates=1000, N.Pearson=4, plot="R") # Using a non-uniform distribution to generate the correlation matrices: dev.new() ## A) Showing the Pearson product moment correlation coefficient distribution prmo1<-pintsc.p(traits=tussilago[,1:5], control=tussilago[,6], n.replicates=1000, N.Pearson=15, plot="P") ## B) Showing the resulting null distribution and the real value (red line) prmo2<-pintsc.p(traits=tussilago[,1:5], control=tussilago[,6], n.replicates=1000, N.Pearson=15, plot="R") # Comparing the uniform and the non-uniform distributions # as in Harder New Phytologist (2009) 183: 247–248 vari<-2 #variable to plot (INT.c) toplot1<-unif2$Simulated.int[vari,] toplot2<-prmo2$Simulated.int[vari,] HIST<-hist(as.matrix(toplot2),plot=FALSE) MaxY<-max(HIST$density) Max<-max(toplot1,toplot2) Min<-min(HIST$mids) plot(c(1,2),xlim=c((Min-0.05*Max),(Max+0.05*Max)),ylim=c(0,(MaxY+0.05*MaxY)), type="n",ylab="Density",xlab="Maximum integration (percentage)") hist(as.matrix(toplot1),add=TRUE,freq=FALSE,breaks=28) hist(as.matrix(toplot2),add=TRUE,freq=FALSE,col="grey",breaks=18) # And the real value as a red line: abline(v=prmo1$Real[vari],lty=2, col="red")
phenotypic integration example dataset from Torices & Méndez (2014).
data(tussilago)
data(tussilago)
This data set represents the dry mass (in grams) of inflorescence components of the sunflower species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL' (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of female flower). Furthermore in the last column the total weight of the inflorescence is added 'TOTALSIZE'.
R. Torices, M. Méndez
Torices, R. & Méndez, M. 2014. Resource allocation to inflorescence components is highly integrated despite differences between allocation currencies and sites. International Journal of Plant Science 175(6):713–723.
data(tussilago)
data(tussilago)