fitFT: Conduct an analysis-of-deviance for the MSU pollinator...

Description Usage Arguments Details Value Author(s) See Also

View source: R/fitFT.R

Description

Conduct an analysis-of-deviance for the MSU pollinator analysis assuming a Poisson-distributed outcome and varying exposure.

Usage

1
fitFT(df, year, offsetVar = NULL, CNMax = 10)

Arguments

df

A data.frame containing columns for TotalPollinatorVisits, Cultivar, SamplingPeriods, and FlowerType. Typically, Cultivar is nested within FlowerType.

year

The numeric four-digit year. Used to handle slight differences in recorded data layout.

offsetVar

The variable to be utilized as an offset, submitted as a character string. Typically SamplingPeriods. Default is NULL, or no offset.

CNMax

The maximum condition number to serve as a cutoff, beyond which models are not considered.

Details

Function fitFT serves as a preparation and wrapper function for function fits which conducts the statistical fitting via either of glm or MASS::glm.nb.

Processing includes the creation of a binary explanatory variables for consideration of different cutpoints. Cutpoints are binary, in that cultivar records greater than or equal to a predefined number of TotalPollinatorVisits are grouped as 1, while all others (so those less than TotalPollinatorVisits) are zero. All possible binary outcomes from 1 through 10 are considered.

Following the creation of appropriate data sets, R-type formula strings are then created, possibly including Cultivar as an additional explanatory covariate via function modelStrings. Up to 5 explanatory covariates are allowed, with possibly two interactions.

Next, given the model strings, design matrices are constructed so that condition numbers can be calculated for each. The condition number of the underlying variance-covariance matrix of the centered design matrix allows for interpretation of the multicollinearity of the variables whose columns form the original design matrix. Condition numbers are ratios of the largest eigenvalue to the smallest eigenvalue, which themselves are estimates of variance in rotated dimensions in which they matter the most. More practically, the presence of a large condition number implies a more ellipsoidal data cloud when compared to clouds tied to smaller condition numbers. The ellipsoidal nature of the cloud is very similar to ellipsoidal clouds observed in two-dimensional data plots used to assess two-dimensional correlation. The condition-number approach is the generalization of the typical approach used for two dimensions to assess correlation.

Those model strings with a sufficiently low condition number are then passed to the fits function, which then conducts the actual fitting of count statistical models.

Value

A list containing results of the original fit, adjusted Tukey-like pairwise multiple comparisons, and the analysis-of-deviance. The four constituent objects are

Author(s)

Jason Mitchell, based on original work by Zoe Gustafson.

See Also

stats::glm, stats::anova, stats::confint, multcomp::glht


studyvin/pollinatorAttractiveness documentation built on Dec. 23, 2021, 6:38 a.m.