proLik: Estimates the profile likelihood of a random effect

Description Usage Arguments Details Value Warning Author(s) See Also Examples

Description

When a mixed model is run in ASReml-R, this function can estimate the profile likelihood of variance components from the output.

Usage

1
proLik(full.model, component, negative = FALSE, nsample.units = 4, nse = 2, alpha = 0.05, threshold = 0.05)

Arguments

full.model

An asreml model object

component

A character vector indicating for which variance component the profile likelihood will be constructed. Must be an object in full.model$gammas.

negative

Logical indicating whether or not the component can take on a negative value (i.e., a covariance)

nsample.units

Number of sample units to be used in constructing the profile likelihood

nse

Number of standard errors on either side of the estimate, over which the profile likelihood should be constructed

alpha

The critical value for determining the Confidence Interval

threshold

Acceptable distance, between actual sample values and interpolated values, for determining the upper and lower limits of the Confidence Interval. Actual samples will be no more than this distance from the true value of the estimate

Details

For the negative argument, this should be used if the profile likelihood of a covariance component is to be constructed.

The function uses a grid search to obtain the approximate confidence limits. Therefore, nsample.units should be carefully thought about beforehand when running the function. Increasing this value will ensure a smoother surface, but at cost to time. The function weights this quantity to ensure more samples for regions of the profile likelihood greater than the estimate. The lower bound of the sampling interval to the estimate is made up of 2 times nsample.units, whereas the sampling interval from the estimate to the upper bound is 3 times nsample.units.

Similarly for nse, the function will include twice as many standard errors from the estimate to the upper bound than it does from the estimate to the lower bound. If negative is FALSE, and the lower bound of the sampling interval extends beyond zero, this will instead be set to 0.

Value

lambdas

negative log Likelihood ratio test statistic. Estimated from the log Likelihood of the full.model and the log Likelihood of the model with the component constrained to a value in the sampling interval

var.estimates

value along the sampling interval for which the component was constrained

UCL

approximate Upper Confidence Limit

LCL

approximate Lower Confidence Limit

component

the component for which the profile likelihood surface has been constructed

Warning

May be unfeasible to estimate profile likelihoods for complex models with many variance components

Author(s)

matthewwolak@gmail.com

See Also

aiFun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  ## Not run: 
    library(asreml)
    ginvA <- asreml.Ainverse(warcolak[, c(1,3,2)])$ginv
    ginvD <- makeD(warcolak[,1:3])$listDinv
    warcolak$IDD <- warcolak$ID
    warcolak.mod <- asreml(trait1 ~ 1, random = ~ped(ID) + giv(IDD), ginverse = list(ID = ginvA, IDD = ginvD), data = warcolak) 
    summary(warcolak.mod)$varcomp
    profileA <- proLik(full.model = warcolak.mod, component = "ped(ID)!ped", negative = FALSE, nsample.units = 3, nse = 3)
    profileA
    profileD <- proLik(full.model = warcolak.mod, component = "giv(IDD).giv", negative = FALSE, nsample.units = 3, nse = 3)

    x11(w = 6, h = 8)
    par(mfrow = c(2,1))
      plot.proLik(profileA) 
      plot.proLik(profileD)
   
## End(Not run)

nadiv documentation built on May 2, 2019, 4:55 p.m.