JackLmer3: Jackknife components for normal data 3

Description Usage Arguments Details Value Note References See Also Examples

View source: R/JackLmer3.R

Description

Extracts additive genetic, non-additive genetic, and maternal variance components from a linear mixed-effect model using the lmer function of the lme4 package. Model random effects are dam, sire, dam by sire, and any additional fixed and/or random effects.

Usage

1
JackLmer3(observ, dam, sire, response, remain, ml = F, size = 1, first = NULL)

Arguments

observ

Data frame of observed data

dam

Column name containing dam (female) parent identity information.

sire

Column name containing sire (male) parent identity information.

response

Column name containing the offspring (response) phenotype values.

remain

Remaining formula using lme4 package format.

ml

Default is FALSE for restricted maximum likelihood. Change to TRUE for maximum likelihood.

size

Default is 1 for delete-one jackknife resampling. If size > 1, delete-d jackknife resampling occurs removing a block d equal to size.

first

Number of initial sub-samples to run. Useful for examing if there is variation among sub-samples before jackknife resampling the entire data set. There can be little variation for delete-one jackknife resampling with large data sets, and delete-d jackknife resampling should be considered.

Details

Uses delete-one jackknife resampling (Efron & Tibshirani 1993, p. 141-145). For the option of delete-d jackknife resampling, the rows of the observed data frame are shuffled and a block of observations of size d is deleted sequentially. Extracts the dam, sire, dam, dam by sire, and residual variance components. Extracts any additional fixed effect and random effect variance components. The fixed-effect variance component is as a single group using the method described by Nakagawa and Schielzeth (2013). Calculates the total variance component. Calculates the additive genetic, non-additive genetic, and maternal variance components (see Lynch and Walsh 1998, p. 603).

Value

A data frame with columns containing the raw variance components for dam, sire, dam by sire, residual, total, additive genetic, non-additive genetic, and maternal. Also columns containing the raw variance components for remaining formula components. The number of rows in the data frame matches the total number of observations (N) for delete-one jackknife resampling or M groups for delete-d jackknife resampling to the lowest integer. Each row represents a deleted single observation or deleted d observations group.

Note

Maximum likelihood (ML) estimates the parameters that maximize the likelihood of the observed data and has the advantage of using all the data and accounting for non-independence (Lynch and Walsh 1998, p. 779; Bolker et al. 2009). On the other hand, ML has the disadvantage of assuming that all fixed effects are known without error, producing a downward bias in the estimation of the residual variance component. This bias can be large if there are lots of fixed effects, especially if sample sizes are small. Restricted maximum likelihood (REML) has the advantage of not assuming the fixed effects are known and averages over the uncertainty, so there can be less bias in the estimation of the residual variance component. However, REML only maximizes a portion of the likelihood to estimate the effect parameters, but is the preferred method for analyzing large data sets with complex structure.

References

Efron B, Tibshirani R. 1993. An introduction to the Bootstrap. Chapman and Hall, New York.

Lynch M, Walsh B. 1998. Genetics and Analysis of Quantitative Traits. Sinauer Associates, Massachusetts.

Nakagawa S, Schielzeth H. 2013. A general and simple method for obtaining R2 from generalized linear mixed-effects models. Methods in Ecology and Evolution 4(2): 133-142. DOI: 10.1111/j.2041-210x.2012.00261.x

See Also

JackLmer, JackLmer2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(chinook_length) #Chinook salmon offspring length

#Delete-one
#length_jack3<- JackLmer3(observ=chinook_length,dam="dam",sire="sire",response="length",
#remain="egg_size + (1|tray)")
length_jack3<- JackLmer3(observ=chinook_length,dam="dam",sire="sire",response="length",
remain="egg_size + (1|tray)",first=2) #first 2

#Delete-d, d=5
#length_jack3.2<- JackLmer3(observ=chinook_length,dam="dam",sire="sire",response="length",
#remain="egg_size + (1|tray)",size=5)
length_jack3.2<- JackLmer3(observ=chinook_length,dam="dam",sire="sire",response="length",
remain="egg_size + (1|tray)",size=5,first=2) #first 2

Example output

Registered S3 methods overwritten by 'car':
  method                          from
  influence.merMod                lme4
  cooks.distance.influence.merMod lme4
  dfbeta.influence.merMod         lme4
  dfbetas.influence.merMod        lme4
[1] "2021-02-11 12:03:11 UTC"
[1] "Removing observation: 1 of 1210"
boundary (singular) fit: see ?isSingular
[1] "Removing observation: 2 of 1210"
boundary (singular) fit: see ?isSingular
Time difference of 0.5831962 secs
[1] "2021-02-11 12:03:11 UTC"
[1] "Removing block: 1 of 242"
boundary (singular) fit: see ?isSingular
[1] "Removing block: 2 of 242"
boundary (singular) fit: see ?isSingular
Time difference of 0.5836623 secs

fullfact documentation built on March 14, 2021, 5:08 p.m.