Description Usage Arguments Value Author(s) References See Also Examples
View source: R/gppr.gradients.R
gam.gradients uses numerical approximations to the first and second order partial derivatives of population mean fitness with respect to population mean phenotype to obtain directional and quadratic selection gradients.
1 2 3 | gppr.gradients(mod, phenotype, covariates = NULL, standardized = FALSE,
se.method = "boot.para", n.boot = 1000,
parallel = "no", ncpus = 1)
|
mod |
a fitted object produced by gppr. Must include predictor variables specified by |
phenotype |
a vector of one or two character strings specifying predictor variables in selection gradients are to be calculated |
covariates |
a character vector listing any covariates in the model |
se.method |
the method by which to obtain standard errors and P-values of the selection gradients. Options are 'n' for none, 'boot.para' for parametric bootstrapping (default), 'boot.case' for case bootstrapping, 'posterior' for an algorithm based on simulation from the multivariate normal approximation to the posterior distribution of the model parameters, and 'permute' for permutation-based P-values (no SEs). |
n.boot |
number of bootstrap replicates for evaluating statistical uncertainty in the selection gradients. |
standardized |
whether or not to standardize to unit variance to obtain selection gradient estimates that are comparable across traits and populations |
parallel |
whether or not to use parallel processing to speed up computation of bootstrap standard errors. Default in 'no' for no parallel computing. Under linux only, |
ncpus |
the number of cpus to be used for parallel processing of bootstrap standard errors. Only used under linux. |
A list. Element 1 is a table of estimates, standard errors and P-values, and element 2 contains the bootstrap or permutation values.
Michael Morrissey michael.morrissey@st-andrews.ac.uk
M.B. Morrissey. in prep.
1 2 3 4 5 6 7 8 9 10 11 | # simulated data (two traits, stabilizing selection on trait 1)
n<-250
z<-cbind(rnorm(n,0,1),rnorm(n,0,1))
W<-rpois(n,exp(2-0.6*z[,1]^2))
d<-as.data.frame(cbind(W,z))
names(d)<-c("W","z1","z2")
fit.func<-gppr(y="W",xterms=c("z1","z2"),data=d,family="poisson",
nterms=2,max.terms=2)
gppr.gradients(mod= fit.func,phenotype=c("z1","z2"),se.method='n',standardize=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.